Booking not found'; require_once 'includes/footer.php'; exit; } $payments = getPayments($id); if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['update_status'])) { $new_status = cleanInput($_POST['status']); $admin_notes = cleanInput($_POST['admin_notes']); $assigned_team = cleanInput($_POST['assigned_team'] ?? ''); $stmt = $conn->prepare("UPDATE bookings SET status=?, admin_notes=?, assigned_team=? WHERE id=?"); $stmt->bind_param("sssi", $new_status, $admin_notes, $assigned_team, $id); if ($stmt->execute()) { $stmt2 = $conn->prepare("INSERT INTO booking_status (booking_id, status, notes, created_by) VALUES (?, ?, ?, ?)"); $stmt2->bind_param("issi", $id, $new_status, $admin_notes, $_SESSION['admin_id']); $stmt2->execute(); addNotification('Booking Updated', "Booking {$booking['booking_id']} updated to {$new_status}", SITE_URL."admin/booking-details.php?id={$id}", 'customer', $booking['customer_id']); addNotification('Booking Updated', "Booking {$booking['booking_id']} updated to {$new_status}", SITE_URL."admin/booking-details.php?id={$id}", 'admin'); $msg = '
= htmlspecialchars($booking['customer_name']) ?>
= $booking['customer_email'] ?>
= $booking['customer_phone'] ?>
= $booking['category_name'] ?>
= $booking['package_name'] ?>
= date('l, d F Y', strtotime($booking['event_date'])) ?>
= date('h:i A', strtotime($booking['start_time'])) ?>
= date('h:i A', strtotime($booking['end_time'])) ?>
= htmlspecialchars($booking['venue']) ?>
= htmlspecialchars($booking['address'] ?: 'N/A') ?>
= htmlspecialchars($booking['district']) ?>
= htmlspecialchars($booking['color_theme'] ?: 'N/A') ?>
= number_format($booking['distance'], 2) ?> km
= nl2br(htmlspecialchars($booking['special_notes'])) ?>
| Amount | Type | Method | Transaction | Date | Status |
|---|---|---|---|---|---|
| = formatPrice($p['amount']) ?> | = $p['payment_type'] ?> | = $p['payment_method'] ?: '-' ?> | = $p['transaction_id'] ?: '-' ?> | = date('d M Y', strtotime($p['created_at'])) ?> | = getStatusBadge($p['status']) ?> |