-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewuser.php
64 lines (61 loc) · 1.66 KB
/
viewuser.php
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php include'connection.php';?>
<?php
session_start();
if(!($_SESSION['logged_in'])){
//$_SESSION['header_loc']="adminhome.php";
session_unset();
session_destroy();
header('Location: login.php');
}
$mod=$_REQUEST['module'];
$sql="SELECT Access FROM acccessmanager WHERE Module='$mod'";
$result=$conn->query($sql)->fetch_assoc();
$acc=$result['Access'];
if($acc[$_SESSION['Role_Index']+1]== 0){
header('Location: adminhome.php?msg=ACCESS DENIED');
}
?>
<script>
function sort(fltr_str){
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("show_table").innerHTML = this.responseText;
}
}
xmlhttp.open("GET", "viewuser_2.php?q=filter&id=0&fltr_str="+fltr_str,true);
xmlhttp.send();
}
</script>
<script>
function role_func(val,sno){
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("msg_table").innerHTML ="updated";
}
}
xmlhttp.open("GET", "viewuser_2.php?q=update&id="+sno+"&new_role="+val,true);
xmlhttp.send();
}
</script>
<html>
<head>
<title>View Form</title>
</head>
<body>
<h1> View Form</h1>
<form>
Filter by :<input type="text" name="fltr_str" value="" onkeyup="sort(this.value)">
</form>
<br>
<div id="show_table">
<script> sort("");</script>
</div>
<form method="GET">
<a id="ref" href="viewuser.php?q=all&id=1" target="_self"> Refresh </a>
<br>
<a href="adminhome.php" target="_self">Back To Admin Page</a>
</form>
</body>
</html>