| Server IP : 173.209.174.21 / Your IP : 216.73.216.89 Web Server : Apache/2.4.58 (Ubuntu) System : Linux wcfs-server 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : nodor ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/thelittlebigshow/self-hosted/ |
Upload File : |
<?php include 'protect.php'; ?>
<?php
include 'db.php';
require_once __DIR__ . '/brand_header.php';
$date = $_GET['date'] ?? null;
if (!$date) {
echo "No date specified.";
exit;
}
// Enable error reporting for debugging
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Fetch transactions for the selected date
$stmt = $conn->prepare("
SELECT t.*, c.first_name, c.last_name, c.id AS customer_id
FROM transactions t
JOIN customers c ON t.customer_id = c.id
WHERE DATE(t.date) = ?
ORDER BY c.last_name, c.first_name, t.item_name
");
$stmt->bind_param("s", $date);
$stmt->execute();
$result = $stmt->get_result();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Daily Details - <?= htmlspecialchars($date) ?></title>
<style>
body {
font-family: 'Segoe UI', sans-serif;
background-color: #f4f4f4;
padding: 30px;
}
.container {
max-width: 900px;
margin: auto;
background: #fff;
padding: 30px;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
h2 {
text-align: center;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 25px;
}
th, td {
padding: 10px;
border: 1px solid #ddd;
}
th {
background-color: #eee;
}
a.back-link {
display: inline-block;
margin-top: 20px;
text-decoration: none;
color: #2196F3;
}
a.customer-link {
text-decoration: none;
color: #333;
}
a.customer-link:hover {
text-decoration: underline;
}
</style>
<?php echo appBrandStyles(); ?>
</head>
<body>
<div class="container">
<?php renderAppBrandHeader(); ?>
<h2>Transactions for <?= date('F j, Y', strtotime($date)) ?></h2>
<?php if ($result->num_rows > 0): ?>
<table>
<thead>
<tr>
<th>Customer</th>
<th>Item</th>
<th>Quantity</th>
<th>Price</th>
<th>Taxable</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<?php while ($row = $result->fetch_assoc()): ?>
<tr>
<td>
<a class="customer-link" href="view_account.php?customer_id=<?= $row['customer_id'] ?>">
<?= htmlspecialchars($row['last_name'] . ', ' . $row['first_name']) ?>
</a>
</td>
<td><?= htmlspecialchars($row['item_name']) ?></td>
<td><?= number_format($row['quantity'], 2) ?></td>
<td>$<?= number_format($row['price'], 2) ?></td>
<td><?= $row['taxable'] ? 'Yes' : 'No' ?></td>
<td><?= htmlspecialchars($row['notes']) ?></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
<?php else: ?>
<p><em>No transactions found for this date.</em></p>
<?php endif; ?>
<a class="back-link" href="daily_totals.php">← Back to Daily Totals</a>
</div>
</body>
</html>