-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_func.js
41 lines (39 loc) · 1.74 KB
/
admin_func.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function loadDoc(url,n, func)
{
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function()
{
if(this.readyState == 4 && this.status == 200)
{
func(this,n);
}
};
xhttp.open("POST",url, true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("task="+func.name);
}
function edit_blog(xhttp,n)
{
//alert(xhttp.responseText);
//document.getElementById("admin_portal").innerHTML=xhttp.responseText;
document.write(xhttp.responseText);
}
function approve_blog(xhttp,n)
{
//alert(xhttp.responseText);
document.getElementById("id"+n).innerHTML="Approved and added to website successfully<i style='font-size:15px; color:green' class='fas'></i>";
}
function delete_blog(xhttp,n)
{
//alert(xhttp.responseText);
document.getElementById("id"+n).innerHTML="Deleted successfully<i style='font-size:15px; color:green' class='fas'></i>";
}
function approve_all_blogs(xhttp,n)
{
alert(xhttp.responseText);
var x = document.getElementsByClassName("blog row");
for(var i=0;i<x.length;i++)
{
x[i].innerHTML="Approved and added to website successfully<i style='font-size:15px; color:green' class='fas'></i>";
}
}