Skip to content

Commit

Permalink
v1.5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Oterem committed Jun 3, 2017
1 parent c930733 commit f8bb026
Show file tree
Hide file tree
Showing 20 changed files with 600 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/admin_page/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!--END of Google Firebase API loading files-->

<!--Loaded a personal script to combine API's as well as page design and logic initate-->
<script src="config.js"></script>
<script src="../config.js"></script>
<script src="script.js"></script>
<link rel='stylesheet' href='style.css' />
<!--END of Loaded a personal script to combine API's as well as page design and logic initate-->
Expand Down
76 changes: 56 additions & 20 deletions src/admin_page/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ let db_rendering = function()
is_admin=1;


let change_colors_btn = document.createElement("button");
change_colors_btn.type = "button";
change_colors_btn.innerHTML = "Manage users";
change_colors_btn.addEventListener("click",function()
let manage_users_btn = document.createElement("button");
manage_users_btn.type = "button";
manage_users_btn.className = "manage_users_btn";
manage_users_btn.innerHTML = "Manage users";
manage_users_btn.addEventListener("click",function()
{
window.location = "../manage_users/manage_users.html";
});
document.getElementById("row0").appendChild(change_colors_btn);
document.getElementById("top_buttons_div").appendChild(manage_users_btn);
}
});

Expand Down Expand Up @@ -68,15 +69,27 @@ let db_rendering = function()
cell2.innerHTML = status.fontcolor("orange");
}
}
let cell3 = document.createTextNode(email);
row.insertCell(2).appendChild(cell3);
let cell4 = document.createElement('input');
cell4.type = "button";
cell4.setAttribute("onClick","del("+ '"' + childSnapshot.key+ '"'+","+i +");");
cell4.value = "Delete";
row.insertCell(3).appendChild(cell4);
cell1.innerHTML = "<a href='https://www.facebook.com/" +childSnapshot.key+ "'>" + childSnapshot.key + "</a>";
i++;

firebase.database().ref("Names/").once('value',function(snap)
{
snap.forEach(function(shot)
{
if(shot.key == email)
{
let cell3 = document.createTextNode(shot.val());
row.insertCell(2).appendChild(cell3);
let cell4 = document.createElement('input');
cell4.type = "button";
cell4.setAttribute("onClick","del("+ '"' + childSnapshot.key+ '"'+","+i +");");
cell4.value = "Delete";
row.insertCell(3).appendChild(cell4);
cell1.innerHTML = "<a href='https://www.facebook.com/" +childSnapshot.key+ "'>" + childSnapshot.key + "</a>";
i++;
}
});
});


}
});
});
Expand All @@ -87,19 +100,24 @@ let createTable = function()
{
let table = document.createElement("table");
table.id = "table";
document.body.appendChild(table);
table.style.width = "100%";
let div = document.createElement("div");
div.id = "table_div";
div.className = "table_div" ;
document.body.appendChild(div);
div.appendChild(table);
let row = table.insertRow(0);
row.id = "row0";
let cell1 = row.insertCell(0);
let cell2 = row.insertCell(1);
let cell3 = row.insertCell(2);
let cell4 = row.insertCell(3);
let cell5 = row.insertCell(4);
// let cell5 = row.insertCell(4);
cell1.innerHTML = "Facebook page name";
cell2.innerHTML = "Status"
cell3.innerHTML = "By";
cell4.innerHTML = "Delete";
cell5.innerHTML = "<input type='button' onclick='Add_new()' value='Add new Facebook page'/>";
cell4.innerHTML = "<input type='button' onclick='Add_new()' value='Add new Facebook page' style='width:100%'/>";

};

let Add_new = function()
Expand Down Expand Up @@ -215,6 +233,10 @@ let approve = function(key, i)

let buttons_insert = function()
{
let div = document.createElement("div");
div.id = "top_buttons_div";
div.className = "top_buttons_div";

let link = document.createElement("a");
//var txt= document.createTextNode("back to calendar");
let backpic = document.createElement("IMG");
Expand All @@ -223,7 +245,9 @@ let buttons_insert = function()
backpic.width = 40;
link.appendChild(backpic);
link.href = "../index.html";
document.body.appendChild(link);
div.appendChild(link);




let btn = document.createElement("button");
Expand All @@ -235,5 +259,17 @@ let buttons_insert = function()
log_out_pic.width = 40;
btn.appendChild(log_out_pic);
btn.addEventListener("click", function() { firebase.auth().signOut(); window.location = "../index.html"; });
document.body.appendChild(btn);

div.appendChild(btn);

let events_manage = document.createElement("a");
let events_pic = document.createElement("IMG");
events_pic.src = "../buttons/events_manage.png";
events_pic.height = 40;
events_pic.width = 40;
events_manage.appendChild(events_pic);
events_manage.href = "../events_manage_page/events.html"
div.appendChild(events_manage);

document.body.appendChild(div);
};
26 changes: 21 additions & 5 deletions src/admin_page/style.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
table, th, td {
border: 1px solid black;
}
table {
width: 100%;
td:hover {
background-color: yellow;
}

th {
height: 50px;
}
input
{
height:100%;
width:100%;
}
button.manage_users_btn
{
height:100%;
}

div.top_buttons_div
{
background-color: red;
}

div.table_div
{
background-color: orange;
}
Binary file added src/buttons/events_manage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/create_user/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<!--END of Google Firebase API loading files-->

<!--Loaded a personal script to combine API's as well as page design and logic initate-->
<script src="config.js"></script>
<script src="../config.js"></script>
<link rel='stylesheet' href='style.css' />
<script src="script.js"></script>
<!--END of Loaded a personal script to combine API's as well as page design and logic initate-->

Expand Down
16 changes: 14 additions & 2 deletions src/create_user/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ let send_data = function()

let build_HTML = function()
{
let btndiv = document.createElement("div");
btndiv.id = "top_buttons_div";
btndiv.className = "top_buttons_div";

let formdiv = document.createElement("div");
formdiv.id = "form_div";
formdiv.className = "form_div";

document.body.appendChild(btndiv);
document.body.appendChild(formdiv);


let back_button_build = function()
{
let link = document.createElement("a");
Expand All @@ -92,7 +104,7 @@ let build_HTML = function()
pic.width = 40;
link.appendChild(pic);
link.href = "../index.html";
document.body.appendChild(link);
btndiv.appendChild(link);
};

let login_form_build = function()
Expand Down Expand Up @@ -191,7 +203,7 @@ let build_HTML = function()
form_obj.appendChild(document.createTextNode(" "));
form_obj.appendChild(btn_reset);

document.body.appendChild(form_obj);
formdiv.appendChild(form_obj);
document.getElementById('email').onkeydown = function(e)
{
if(e.keyCode == 13){
Expand Down
9 changes: 9 additions & 0 deletions src/create_user/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
div.top_buttons_div
{
background-color: red;
}

div.form_div
{
background-color: green;
}
25 changes: 25 additions & 0 deletions src/events_manage_page/events.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<!--jquery loading file-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!--END of jquery loading file-->

<!--Google Firebase API loading files-->
<script src="https://www.gstatic.com/firebasejs/3.7.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/3.7.1/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/3.7.1/firebase-database.js"></script>
<!--END of Google Firebase API loading files-->

<!--Loaded a personal script to combine API's as well as page design and logic initate-->
<script src="../config.js"></script>
<script src="script.js"></script>
<link rel='stylesheet' href='style.css' />
<!--END of Loaded a personal script to combine API's as well as page design and logic initate-->

</head>

<body>

</body>
</html>
Loading

0 comments on commit f8bb026

Please sign in to comment.