47 lines
1.5 KiB
PHP
47 lines
1.5 KiB
PHP
<?php
|
|
if(!isset($_SESSION) && empty($_SESSION['user_id'])){
|
|
echo "<script>window.location.href = '/Agent/agent-login'</script>";
|
|
exit;
|
|
}
|
|
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
|
|
if ($conn->connect_error) {
|
|
die("Connection failed: " . $conn->connect_error);
|
|
}
|
|
|
|
$sql = "SELECT * FROM `" . $GLOBALS['arif_tran'] . "`WHERE `AT_ADMIN` = '" . $conn->real_escape_string($_SESSION['user_id']) . "'AND DATE(`AT_TIMESTAMP`) = CURDATE()";
|
|
|
|
$result = $conn->query($sql);
|
|
?>
|
|
|
|
<div class="container" style="margin-top:80px;">
|
|
<h3>Transaction Records</h3>
|
|
<?php if ($result && $result->num_rows > 0): ?>
|
|
<table class="table table-bordered table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Timestamp</th>
|
|
<th>ACID</th>
|
|
<th>Amount</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php while ($row = $result->fetch_assoc()): ?>
|
|
<tr>
|
|
<td><?= date("d M Y, h:i A", strtotime($row['AT_TIMESTAMP'])) ?></td>
|
|
<td><?= htmlspecialchars($row['AT_ACID']) ?></td>
|
|
<td><?= htmlspecialchars($row['AT_AMOUNT']) ?></td>
|
|
</tr>
|
|
<?php endwhile; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php else: ?>
|
|
<div class="alert alert-warning">No record found</div>
|
|
<?php endif; ?>
|
|
|
|
<!-- <a class="btn btn-primary" href="/Agent/Receive">Receive Payment</a> -->
|
|
</div>
|
|
|
|
<?php
|
|
$conn->close();
|
|
?>
|