-
Notifications
You must be signed in to change notification settings - Fork 6
/
admin.php
57 lines (54 loc) · 1.56 KB
/
admin.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
<!DOCTYPE html>
<html>
<head>
<title>XCJ payment verification</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name='viewport' content='width=320'/>
<script type="text/javascript" language="javascript"><!--
function verify(e, ok, id, email) {
var xhr = new XMLHttpRequest();
xhr.open("GET", "verify.php?email="+encodeURIComponent(email)+"&ok="+ok+"&id="+id, true);
e.disabled = true;
xhr.onreadystatechange = function() {
if (this.readyState === 4) {
e.style.backgroundColor = ok ? "green" : "red";
}
};
xhr.send();
}
//-->
</script>
</head>
<body>
<h1>Unverified Payments</h1>
<table style="width:100%">
<thead>
<tr>
<th>E-mail</th>
<th>Submitted</th>
<th>Amount</th>
<th>Verified?</th>
</tr>
</thead>
<tbody><?php
require 'inc/mailer.php';
require 'inc/db.php';
$result = $link->query("SELECT id,email,CAST(submitted AS DATE) as submitted,amount FROM Payments WHERE verified IS NULL;")
or mail_and_die('link->query SELECT error', __FILE__);
while ($row = $result->fetchArray()) {?>
<tr>
<td><?php echo $row['email']; ?></td>
<td><?php echo $row['submitted']; ?></td>
<td><?php echo $row['amount']; ?></td>
<td>
<input onclick="javascript:verify(this, 1, '<?php echo $row['email']; ?>', <?php echo $row['id']; ?>)" type="button" value="OK"/>
<input onclick="javascript:verify(this, 0, '<?php echo $row['email']; ?>', <?php echo $row['id']; ?>)" type="button" value="Deny"/>
</td>
</tr><?php
}
$link->close();
unset($link);
?></tbody>
</table>
</body>
</html>