prepare("UPDATE orders SET status = ? WHERE id = ?"); $stmt->execute([$new_status, $order_id]); header("Location: orders.php"); exit; } $orders = $pdo->query("SELECT o.*, (SELECT GROUP_CONCAT(CONCAT(p.name, ' x', oi.quantity) SEPARATOR ', ') FROM order_items oi JOIN products p ON oi.product_id = p.id WHERE oi.order_id = o.id) as items_summary FROM orders o ORDER BY o.created_at DESC")->fetchAll(); include 'includes/header.php'; ?>
| ID | Source | Items | Total | Status | Time | Action |
|---|---|---|---|---|---|---|
| #= $order['id'] ?> | Table = htmlspecialchars($order['table_number']) ?> = ucfirst($order['order_type']) ?> | = htmlspecialchars($order['items_summary']) ?> | = format_currency($order['total_amount']) ?> | = ucfirst($order['status']) ?> | = date('H:i', strtotime($order['created_at'])) ?> | |
| No active orders. | ||||||