-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathusersawait.php
172 lines (89 loc) · 4.16 KB
/
usersawait.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php
error_reporting(0);
session_start();
include_once 'dbconnect.php';
$west = "west";
$east = "east";
$yes = "yes";
if (isset($_POST['delete'])) {
$approvename = mysqli_real_escape_string($con, $_POST['approvename']);
$result = mysqli_query($con, "SELECT * FROM valid WHERE name = '" . $approvename . "'");
$result = mysqli_query($con, "SELECT * FROM users WHERE name = '" . $approvename . "'");
if ($row = mysqli_fetch_array($result)) {
$result = mysqli_query($con, "DELETE FROM valid WHERE name = '" . $approvename . "'");
$result = mysqli_query($con, "UPDATE users SET valid = '" . $yes . "' where name = '" . $approvename . "'");
$delete_error = "account successfuly approved";
} else {
$delete_error = "failed, please make sure that you have all the casing and spelling correct";
}
}
?>
<!DOCTYPE html>
<embed src="test.mp3" autostart="true" loop="true"
width="2" height="0">
<html>
<head>
<title>approve user</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport" >
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" />
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="admindash.php"><span class="" aria-hidden="true"></span> Go back</a>
<h2>Ignore the warning(s) ^^ above if any<br></h2>
</div>
<div class="collapse navbar-collapse" id="navbar1">
<ul class="nav navbar-nav navbar-right">
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4 well">
<form role="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="signupform">
<fieldset>
<legend>approve user</legend>
<div class="form-group">
<label for="approvename">Username</label>
<input type="approvename" name="approvename" placeholder="enter the users name" required class="form-control" />
</div>
<div class="form-group">
<input type="submit" name="delete" value="approve" class="btn btn-primary" />
</div>
</fieldset>
</form>
<span class="text-success"><?php if (isset($successmsg)) { echo $successmsg; } ?></span>
<span class="text-danger"><?php if (isset($errormsg)) { echo $errormsg; } ?></span>
</div>
</div>
<div class="row">
<div class="col-md-4 col-md-offset-4 text-center">
<h1>BELOW ARE USERS REQUESTING ACCESS</h1>
<?php
$sql = "SELECT name, role FROM valid";
$result = mysqli_query($con, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
echo " User name: " . $row["name"]. " -user role: " . $row["role"]. "<br>";
}
} else {
echo "no users currently request access";
}
// output data of each row
?>
</div>
</div>
</div>
<script src="js/jquery-1.10.2.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>