Files
canteenhub/app/Views/sessions/history.php
T

66 lines
2.8 KiB
PHP

<div class="page-header">
<div>
<h1 class="page-title">Lunch Sessions History</h1>
<p class="page-subtitle">Archive of past daily canteen lunch orders and billing</p>
</div>
<div>
<a href="/" class="btn btn-primary">&larr; Back to Today's Session</a>
</div>
</div>
<div class="card">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Session Title</th>
<th>Canteen</th>
<th>Orders</th>
<th>Menu Items</th>
<th>Total Billed</th>
<th>Status</th>
<th style="text-align: right;">Action</th>
</tr>
</thead>
<tbody>
<?php if (empty($sessions)): ?>
<tr>
<td colspan="8" style="text-align: center; color: var(--text-muted); padding: 3rem;">
No past sessions found.
</td>
</tr>
<?php else: ?>
<?php foreach ($sessions as $s): ?>
<tr>
<td style="font-weight: 600;"><?= date('M d, Y', strtotime($s['session_date'])) ?></td>
<td>
<a href="/sessions/<?= e($s['id']) ?>" style="font-weight: 600; color: var(--primary); text-decoration: none;">
<?= e($s['title']) ?>
</a>
</td>
<td><?= e($s['canteen_name']) ?></td>
<td><?= e($s['order_count']) ?> people</td>
<td><?= e($s['menu_count']) ?> items</td>
<td style="font-weight: 700; color: var(--primary);"><?= money($s['total_session_amount']) ?></td>
<td>
<span class="badge badge-<?= match($s['status']) {
'open' => 'completed',
'closed' => 'warning',
'arrived' => 'processing',
default => 'neutral'
} ?>">
<?= strtoupper(e($s['status'])) ?>
</span>
</td>
<td style="text-align: right;">
<a href="/sessions/<?= e($s['id']) ?>" class="btn btn-secondary btn-sm">View Board</a>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>