hjkhjkjhkhjkgjghjhgjhgjghjhghjghjhgjjnbvnvbnvk
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
wjcvelqp
/
public_html
/
despiteloveday.com.ng
/
Upload FileeE
HOME
<?php session_start(); require_once 'config/database.php'; require_once 'includes/auth.php'; $ref = trim($_GET['ref'] ?? ''); $booking = null; $error = ''; $check_in_time = getSiteSetting('check_in_time', '1:00 PM'); $check_out_time = getSiteSetting('check_out_time', '12:00 PM'); $site_name = getSiteSetting('site_name', 'Despite Loveday Apartment Limited'); $phone = getSiteSetting('phone', '+234 906 826 1012'); $address = getSiteSetting('address', '12B Ranti Alabi Drive, Egbeda Akowonjo, Lagos'); $email = getSiteSetting('email', 'bookings@despiteloveday.com'); $maps = getSiteSetting('google_maps_url', ''); if ($ref === '') { $error = 'Missing booking reference.'; } else { $db = getDB(); if ($db) { try { $stmt = $db->prepare("SELECT b.*, r.name as room_name FROM bookings b LEFT JOIN rooms r ON b.room_id = r.id WHERE b.booking_ref = ?"); $stmt->execute([$ref]); $booking = $stmt->fetch(); if (!$booking) $error = 'Booking not found.'; } catch (Exception $e) { $error = 'Could not load booking.'; } } else { $error = 'Database unavailable.'; } } $methodLabel = ''; if ($booking) { $methodLabel = (($booking['payment_method'] ?? '') === 'pay_at_property') ? 'Pay at property (Cashier)' : 'Online (Paystack)'; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Booking Receipt <?php echo htmlspecialchars($ref); ?> | Despite Loveday</title> <style> * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f1f5f9; color: #0f172a; line-height: 1.5; padding: 24px; } .sheet { max-width: 640px; margin: 0 auto; background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.08); overflow: hidden; } .head { background: linear-gradient(135deg, #0B1C33, #1a3a5c); color: #fff; padding: 28px 32px; } .head h1 { font-size: 1.35rem; font-weight: 700; } .head p { opacity: 0.85; font-size: 0.9rem; margin-top: 4px; } .body { padding: 28px 32px; } .ref { font-size: 1.5rem; font-weight: 700; letter-spacing: 2px; color: #D4AF37; margin-bottom: 20px; } table { width: 100%; border-collapse: collapse; margin-bottom: 20px; } td { padding: 10px 0; border-bottom: 1px solid #e2e8f0; vertical-align: top; } td:first-child { color: #64748b; width: 38%; } td:last-child { font-weight: 500; } .total { font-size: 1.25rem; font-weight: 700; } .notes { background: #f8fafc; border-radius: 8px; padding: 14px 16px; font-size: 0.9rem; margin-top: 16px; } .notes strong { display: block; margin-bottom: 6px; } .actions { text-align: center; padding: 0 32px 28px; } .btn { display: inline-block; padding: 12px 22px; border-radius: 8px; background: #D4AF37; color: #0B1C33; font-weight: 600; text-decoration: none; border: none; cursor: pointer; font-size: 15px; margin: 4px; } .btn-outline { background: #fff; border: 1.5px solid #cbd5e1; color: #0f172a; } .error { max-width: 640px; margin: 40px auto; background: #fef2f2; color: #b91c1c; padding: 20px; border-radius: 10px; text-align: center; } @media print { body { background: #fff; padding: 0; } .actions, .no-print { display: none !important; } .sheet { box-shadow: none; border-radius: 0; } } </style> </head> <body> <?php if ($error || !$booking): ?> <div class="error"><?php echo htmlspecialchars($error ?: 'Booking not found.'); ?> <p style="margin-top:12px;"><a href="check-booking.php">Look up another booking</a></p> </div> <?php else: ?> <div class="sheet"> <div class="head"> <h1><?php echo htmlspecialchars($site_name); ?></h1> <p>Booking Receipt</p> </div> <div class="body"> <div class="ref"><?php echo htmlspecialchars($booking['booking_ref']); ?></div> <table> <tr><td>Guest name</td><td><?php echo htmlspecialchars($booking['guest_name']); ?></td></tr> <tr><td>Email</td><td><?php echo htmlspecialchars($booking['guest_email']); ?></td></tr> <tr><td>Phone</td><td><?php echo htmlspecialchars($booking['guest_phone']); ?></td></tr> <tr><td>Room / Space</td><td><?php echo htmlspecialchars($booking['room_name'] ?? 'N/A'); ?></td></tr> <tr><td>Check-in</td><td><?php echo date('l, d F Y', strtotime($booking['check_in'])); ?> from <?php echo htmlspecialchars($check_in_time); ?></td></tr> <tr><td>Check-out</td><td><?php echo date('l, d F Y', strtotime($booking['check_out'])); ?> by <?php echo htmlspecialchars($check_out_time); ?></td></tr> <tr><td>Guests</td><td><?php echo (int)$booking['guests']; ?></td></tr> <tr><td>Payment method</td><td><?php echo htmlspecialchars($methodLabel); ?></td></tr> <tr><td>Payment status</td><td><?php echo ucfirst($booking['payment_status']); ?></td></tr> <tr><td>Booking status</td><td><?php echo ucfirst($booking['status']); ?></td></tr> <tr><td>Total amount</td><td class="total">₦<?php echo number_format($booking['total_amount'] ?? 0); ?></td></tr> <tr><td>Booked on</td><td><?php echo date('d M Y, H:i', strtotime($booking['created_at'])); ?></td></tr> </table> <?php if (!empty($booking['special_requests'])): ?> <div class="notes"> <strong>Special requests</strong> <?php echo nl2br(htmlspecialchars($booking['special_requests'])); ?> </div> <?php endif; ?> <div class="notes"> <strong>Important</strong> <?php if (($booking['payment_method'] ?? '') === 'pay_at_property' && $booking['payment_status'] !== 'paid'): ?> Please present this receipt (or your reference number) at the cashier on arrival and complete payment. <?php elseif (($booking['payment_method'] ?? '') === 'online' && $booking['status'] === 'pending'): ?> This booking is awaiting admin approval. You will be able to pay online after approval via the Check Booking page. <?php elseif (($booking['payment_method'] ?? '') === 'online' && $booking['status'] === 'approved' && $booking['payment_status'] !== 'paid'): ?> Your booking is approved. Please complete online payment from the Check Booking page. <?php else: ?> Thank you for booking with us. We look forward to hosting you. <?php endif; ?> <br><br> Check-in: <?php echo htmlspecialchars($check_in_time); ?> · Check-out: <?php echo htmlspecialchars($check_out_time); ?><br> <?php echo htmlspecialchars($address); ?><br> <?php echo htmlspecialchars($phone); ?> · <?php echo htmlspecialchars($email); ?> <?php if ($maps): ?><br><a href="<?php echo htmlspecialchars($maps); ?>" target="_blank" rel="noopener">View location on Google Maps</a><?php endif; ?> </div> </div> <div class="actions no-print"> <button type="button" class="btn" onclick="window.print()"><i class="fas fa-print"></i> Print / Save as PDF</button> <a href="check-booking.php?ref=<?php echo urlencode($booking['booking_ref']); ?>" class="btn btn-outline">Back to booking</a> </div> </div> <?php endif; ?> </body> </html>