local changes.
This commit is contained in:
@@ -1,7 +1,19 @@
|
||||
<?php include_once('header02.php');
|
||||
checkAdmin();
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST['accept_indemnity'])) {
|
||||
$user_id = intval($_POST['user_id']);
|
||||
$stmt = $conn->prepare("UPDATE membership_application SET accept_indemnity = 1 WHERE user_id = ?");
|
||||
if ($stmt) {
|
||||
$stmt->bind_param("i", $user_id);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
}
|
||||
}
|
||||
|
||||
// SQL query to fetch data
|
||||
$sql = "SELECT user_id, first_name, last_name, tel_cell, email, dob FROM membership_application";
|
||||
$sql = "SELECT user_id, first_name, last_name, tel_cell, email, dob, accept_indemnity FROM membership_application";
|
||||
|
||||
$result = $conn->query($sql);
|
||||
?>
|
||||
<style>
|
||||
@@ -171,8 +183,9 @@ if (!empty($bannerImages)) {
|
||||
<th>Cell Number</th>
|
||||
<th>Email</th>
|
||||
<th>Date of Birth</th>
|
||||
<th>Membership</th>
|
||||
<th>Membership</th>
|
||||
<th>View Info</th>
|
||||
<th>Indemnity</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -181,24 +194,32 @@ if (!empty($bannerImages)) {
|
||||
// Output data of each row
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
echo "<tr>
|
||||
<td>" . htmlspecialchars($row['first_name']) . "</td>
|
||||
<td>" . htmlspecialchars($row['last_name']) . "</td>
|
||||
<td>" . htmlspecialchars($row['tel_cell']) . "</td>
|
||||
<td>" . htmlspecialchars($row['email']) . "</td>
|
||||
<td>" . htmlspecialchars($row['dob']) . "</td>
|
||||
<td>";
|
||||
if (getUserMemberStatus($row['user_id'])) {
|
||||
echo 'ACTIVE';
|
||||
<td>" . htmlspecialchars($row['first_name']) . "</td>
|
||||
<td>" . htmlspecialchars($row['last_name']) . "</td>
|
||||
<td>" . htmlspecialchars($row['tel_cell']) . "</td>
|
||||
<td>" . htmlspecialchars($row['email']) . "</td>
|
||||
<td>" . htmlspecialchars($row['dob']) . "</td>
|
||||
<td>" . (getUserMemberStatus($row['user_id']) ? 'ACTIVE' : 'INACTIVE') . "</td>
|
||||
<td><a href='member_info.php?token=" . encryptData($row['user_id'], $salt) . "' class='theme-btn style-two style-three'><span data-hover='PAYMENT RECEIVED'>View Info</span></a></td>
|
||||
<td>";
|
||||
|
||||
if (!$row['accept_indemnity']) {
|
||||
echo "<form method='POST' style='display:inline;'>
|
||||
<input type='hidden' name='user_id' value='" . $row['user_id'] . "'>
|
||||
<button type='submit' name='accept_indemnity' class='theme-btn small'>Accept</button>
|
||||
</form>";
|
||||
} else {
|
||||
echo 'INACTIVE';
|
||||
};
|
||||
echo "</td>
|
||||
<td><a href='member_info.php?token=" . encryptData($row['user_id'], $salt) . "' class='theme-btn style-two style-three'><span data-hover='PAYMENT RECEIVED'>View Info</span></a></td>
|
||||
</tr>";
|
||||
echo "✅ Accepted";
|
||||
}
|
||||
|
||||
echo "</td>
|
||||
</tr>";
|
||||
}
|
||||
} else {
|
||||
echo '<tr><td colspan="5">No records found</td></tr>';
|
||||
} ?>
|
||||
echo '<tr><td colspan="8">No records found</td></tr>';
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user