-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathallusers.php
94 lines (81 loc) · 2.78 KB
/
allusers.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
include('adhead.php');
if(!isset($_SESSION['userdata']))
{
header('Location: index.php');
}
if($_SESSION['userdata']['is_admin']==1){
include('adsidebar.php');
if(isset($_GET['action']))
{
$id=$_GET['id'];
if($_GET['action']=='blk')
{
$ap=2;
$adm = new adminwrk();
$admc = new dbcon();
$sho = $adm->yesno($ap,$id,$admc->conn);
}
if($_GET['action']=='app')
{
$ap=1;
$adm = new adminwrk();
$admc = new dbcon();
$sho = $adm->yesno($ap,$id,$admc->conn);
}
elseif($_GET['action']=='no')
{
$ap=0;
$adm = new adminwrk();
$admc = new dbcon();
$sho = $adm->yesno($ap,$id,$admc->conn);
}
}
?>
<nav class="nav nav-pills nav-justified col-sm-10">
<a class="nav-link btn-light active" href="allusers.php">All Users</a>
<a class="nav-link btn-light" href="aprove.php">Pending/Blocked Users</a>
<a class="nav-link btn-light" href="aprovedusr.php">Approved Users</a>
</nav>
<div class="container-fluid">
<h3 class="text-center">All Users</h3>
<table id='tbl' class="container-fluid col-lg-10 mr-lg-2 table table-responsive table-hover table-bordered table-striped">
<thead>
<!-- <th>User id</th> -->
<th onclick='sortTable(1,tbl)'>Name ⇩</th>
<th onclick='sortTable(2,tbl)'>Email ⇩</th>
<th onclick='sortTable(3,tbl)'>Date of signup ⇩</th>
<th onclick='sortTablen(4,tbl)'>Mobile ⇩</th>
<th>Approve/Block</th>
<!-- <th>Delete</th>
<th>Details</th> -->
</thead>
<tbody>
<?php
$adm = new adminwrk();
$admc = new dbcon();
$show = $adm->newuser($admc->conn);
foreach($show as $key=>$val)
{
echo "<tr><td>".$val['name']."</td><td>".$val['user_name']."</td><td>".$val['dateofsignup']."</td><td>".$val['mobile']."</td></td>";
if($val['isblock']==1)
{
echo "<td><a class='btn btn-warning' href='allusers.php?action=blk&id=".$val['user_id']."'>Block</a></td>";
}
if($val['isblock']==0)
{
echo "<td><a class='btn btn-success' href='allusers.php?action=app&id=".$val['user_id']."'>Approve</a></td>";
}
// echo "<td><a class='btn btn-danger' href='allusers.php?action=no&id=".$val['user_id']."'>Delete</a></td>";
// echo "<td><a class='btn btn-danger' href='usrdetail.php?id=".$val['user_id']."'>Details</a></td></tr>";
}
?>
</tbody>
</table>
</div>
<?php
}
else{
echo '<h1 class="text-center text-weight-bold text-dark">You Are not Authorised</h1>';
}
include('adfoot.php'); ?>