-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdonors.inc.php
30 lines (29 loc) · 1.09 KB
/
donors.inc.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
<?php
require_once('/societies/srcf-web/paypal/donate-mysql.inc.php');
$conn = mysqli_connect($mysql_server, $mysql_username, $mysql_password);
mysqli_select_db($conn, $mysql_database);
do {
$result = mysqli_query($conn, "SELECT amount, name, url, DATE_FORMAT(ts, '%D %M %Y') AS date FROM donations ORDER BY ts DESC, amount DESC");
if (!$result) {
echo mysqli_error($conn);
break;
}
echo '<div class="table-responsive-sm">' . "\n";
echo '<table class="donors table">' . "\n";
echo '<thead><tr><th>Amount</th><th>Donor</th><th>Date</th></tr></thead><tbody>' . "\n";
while ($data = mysqli_fetch_assoc($result)) {
echo '<tr><td>£' . htmlspecialchars($data['amount']) . '</td><td>';
if ($data['name'] != '') {
if ($data['url'] != '')
echo '<a rel="nofollow" href="' . htmlspecialchars($data['url']) . '">';
echo htmlspecialchars($data['name']);
if ($data['url'] != '')
echo '</a>';
} else
echo '<i>Anonymous donation</i>';
echo '</td><td>' . htmlspecialchars($data['date']) . '</td></tr>' . "\n";
}
echo '</tbody></table>' . "\n";
echo '</div>' . "\n";
} while(0);
?>