16235369cb
Highlights include configurable menus, specials, cart/checkout, taxes, customer accounts with email 2FA, newsletters, analytics, refunds, PDF/CSV exports, Square/Mailgun adapters, and optional MySQL migration. See README.md for setup and production configuration. Verified PHP/JavaScript syntax, responsive layouts, registration, 2FA, checkout, dashboard workflows, settings persistence, and PDF generation. Real Square, Mailgun, and MySQL connections require credentials/server access. Square implementation follows the official Payments API and Refunds API.
40 lines
2.3 KiB
PHP
40 lines
2.3 KiB
PHP
<section class="admin-panel">
|
|
<div class="admin-panel-heading admin-toolbar">
|
|
<form class="admin-filters" action="/admin/orders" method="get">
|
|
<input type="search" name="q" value="<?= e($query) ?>" placeholder="Order, customer, or email">
|
|
<select name="status">
|
|
<option value="">All statuses</option>
|
|
<?php foreach (['paid', 'preparing', 'ready', 'completed', 'cancelled'] as $status): ?>
|
|
<option value="<?= $status ?>" <?= selected($statusFilter, $status) ?>><?= e(ucfirst($status)) ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<button class="button button-small" type="submit">Filter</button>
|
|
</form>
|
|
<a class="button button-small button-ghost" href="/admin/export/orders.csv">Export CSV</a>
|
|
</div>
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead>
|
|
<tr><th>Order</th><th>Customer</th><th>Placed</th><th>Fulfillment</th><th>Payment</th><th>Total</th><th></th></tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if (!$orders): ?><tr><td colspan="7" class="empty-cell">No orders match those filters.</td></tr><?php endif; ?>
|
|
<?php foreach ($orders as $order): ?>
|
|
<tr>
|
|
<td><strong><?= e($order['order_number']) ?></strong></td>
|
|
<td><?= e($order['customer_name']) ?><small><?= e($order['customer_email']) ?></small></td>
|
|
<td><?= e(store_datetime((string) $order['placed_at'], 'M j, g:i A')) ?></td>
|
|
<td><span class="status-pill status-<?= e($order['status']) ?>"><?= e(ucfirst((string) $order['status'])) ?></span></td>
|
|
<td>
|
|
<span class="status-pill status-<?= e($order['payment_status']) ?>"><?= e(ucwords(str_replace('_', ' ', (string) $order['payment_status']))) ?></span>
|
|
<?php if ((int) $order['refunded_cents'] > 0): ?><small><?= money($order['refunded_cents']) ?> returned</small><?php endif; ?>
|
|
</td>
|
|
<td><?= money($order['total_cents']) ?></td>
|
|
<td><a class="button button-small button-ghost" href="/admin/order?id=<?= (int) $order['id'] ?>">Open</a></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|