/
requests.php
49 lines (37 loc) · 1.08 KB
/
requests.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
<?php
include("designtemplate.php");
include("database.php");
include("validation.php");
connect();
verify_authorization('admin');
?>
<?php
if (isset($_POST['accept_button'])){
remove_user_from_requests($_REQUEST['username']);
}
if (isset($_POST['reject_button'])){
remove_user_from_requests($_REQUEST['username']);
remove_user($_REQUEST['username']);
}
?>
<html>
<head>
<title>Requests</title>
</head>
<body>
<form name = "requests_form" method = "post">
<?php
$result = mysql_query("select * from requests");
$record = mysql_fetch_assoc($result);
if ($record){
echo "<h3> Accept ".$record['Username']."?<h3/><br/><br/>\n";
echo " <input type = 'submit' name = 'accept_button' value = 'Yes'><br/>\n";
echo " <input type = 'submit' name = 'reject_button' value = 'No'><br/>\n";
echo "<input type = 'hidden' name = 'username' value = '".$record['Username']."'>";
}
else echo "<h3>No Pending Requests<h3/><br/><br/>"
?>
</form>
</body>
</html>
<?php include("footer.php");?>