-
Notifications
You must be signed in to change notification settings - Fork 1
/
approve.php
64 lines (58 loc) · 1.33 KB
/
approve.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 "db_connect.php";
$requires = "admin";
include "menu.php";
?>
<html>
<head>
<title>Approve Accounts</title>
</head>
<body>
<?php
$gdd = "<option name='blank'>-</option>";
$query = "SELECT girlId, firstName, lastName FROM girls;";
$result = mysqli_query($db,$query);
while($row = mysqli_fetch_array($result))
{
$name = $row["firstName"] . " " . $row["lastName"];
$id = $row["girlId"];
$gdd .= "<option name='$id'>$name</option>";
#echo $name;
}
$gdd .= "<option name='$id'>(Delete)</option>";
$query = "SELECT email,daughter FROM requests;";
$result = mysqli_query($db,$query);
//echo $query;
?>
<div class = "content">
<h2>Approve Requests</h2>
<form action="approveController.php" method="POST">
<table cellpadding="5">
<?php
$num = 1;
while($row = mysqli_fetch_array($result))
{
if($num == 1) {
echo "<tr><th>User</th><th>Claims...</th><th>Matches...</th></tr>";
}
$email = $row["email"];
$name = $row["daughter"];
echo "<tr><td>$email</td><td>$name</td><td><select name=\"girl".$num."\">$gdd</select></td></tr>";
echo "<input type=\"hidden\" name=\"user".$num."\" value=\"".$email."\" />";
$num++;
}
if($num == 1) {
echo "There are no new account requests.";
}
?>
</table>
<br/>
<?php
if($num != 1) {
echo "<input type=submit value=\"Approve\"/>";
}
?>
</form>
</div>
</body>
</html>