-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_approve_user.php
114 lines (94 loc) · 3.12 KB
/
admin_approve_user.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
ob_start();
session_start();
include 'connection.php';
include 'header.php';
include 'css/style.css';
include('checklogin.php');
check_login();
if(isset($_GET['del']))
{
mysqli_query($conn,"delete from registration where id = '".$_GET['id']."'");
$_SESSION['msg']="Data deleted !!";
}
if(isset($_GET['appr']))
{
mysqli_query($conn,"update registration set approval='Approved' where id = '".$_GET['id']."'");
$_SESSION['msg']="Data Approved !!";
}
if(isset($_GET['rej']))
{
mysqli_query($conn,"update registration set approval='Rejected' where id = '".$_GET['id']."'");
$_SESSION['msg']="Data Rejected !!";
}
?>
<html>
<head>
<style>
a
{
color:Blue;
}
</style>
</head>
<title>Admin|Home</title>
<body>
<?php include 'back_btn.php'; ?>
<font color="#0000FF"><b><h4><span> Welcome : <?php
$name=$_SESSION['login'];
echo $name;
?>
</span></h4></b></font>
<div class="div-center"><font color="#0000FF"><b><h1>Approve Users</h1></b></font></div>
<div class="div-center">
<div class="div-center">
<div class="row">
<div class="col-md-12">
<table class="table table-hover" id="list">
<thead>
<tr>
<th class="center">#</th>
<th>User Name</th>
<th>Address</th>
<th>Phone Number</th>
<th>Email</th>
<th>Status</th>
<th>Approve</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$sql=mysqli_query($conn,"select * from registration");
$cnt=1;
while($row=mysqli_fetch_array($sql))
{
?>
<tr>
<td class="center"><?php echo $cnt;?>.</td>
<td class="hidden-xs"><?php echo $row['name'];?></td>
<td><?php echo $row['address'];?></td>
<td><?php echo $row['phone'];?></td>
<td><?php echo $row['email'];?></td>
<td><?php echo $row['approval'];?></td>
<td>
<a href="admin_approve_user.php?id=<?php echo $row['id']?>&appr=approve" onClick="return confirm('Are you sure you want to Approve?')">Approve</a>
<a href="admin_approve_user.php?id=<?php echo $row['id']?>&rej=rejected" onClick="return confirm('Are you sure you want to Reject?')">Reject</a></td>
<td >
<div class="center">
<a href="admin_approve_user.php?id=<?php echo $row['id']?>&del=delete" onClick="return confirm('Are you sure you want to delete?')">Delete</i></a>
</div>
</td>
</tr>
<?php
$cnt=$cnt+1;
}?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>