BLACKSITE
:
216.73.216.251
:
172.93.223.125 / geeteetravels.com
:
Linux ubuntu 5.15.0-179-generic #189-Ubuntu SMP Tue May 5 18:20:56 UTC 2026 x86_64
:
/
home
/
geeteetravels
/
public_html
/
admin
/
Upload File:
files >> /home/geeteetravels/public_html/admin/enquiries.php
<?php $pageTitle = 'Manage Enquiries'; $currentPage = 'enquiries'; require_once 'includes/header.php'; // Handle status updates if any if (isset($_GET['action']) && isset($_GET['id'])) { $id = $_GET['id']; $status = $_GET['status']; $stmt = $pdo->prepare("UPDATE enquiries SET status = ? WHERE id = ?"); $stmt->execute([$status, $id]); header("Location: enquiries.php?msg=Status updated successfully"); exit(); } // Handle Bulk Delete if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['bulk_delete'])) { if (!empty($_POST['enquiry_ids'])) { $ids = $_POST['enquiry_ids']; $placeholders = implode(',', array_fill(0, count($ids), '?')); $stmt = $pdo->prepare("DELETE FROM enquiries WHERE id IN ($placeholders)"); $stmt->execute($ids); header("Location: enquiries.php?msg=" . count($ids) . " enquiries deleted successfully"); exit(); } } // Fetch all enquiries $stmt = $pdo->query("SELECT * FROM enquiries ORDER BY created_at DESC"); $enquiries = $stmt->fetchAll(); ?> <div class="section-card"> <div class="section-header"> <h3>All Enquiries</h3> <div class="header-actions"> <?php if(isset($_GET['msg'])): ?> <div class="alert alert-success" style="margin: 0; padding: 5px 15px; display: inline-block; animation: fadeOut 3s forwards 2s;"><?php echo $_GET['msg']; ?></div> <?php endif; ?> <a href="export_enquiries.php" class="btn-primary" style="background: var(--success);"><i class="fa fa-file-excel-o"></i> Export to Excel</a> </div> </div> <form action="enquiries.php" method="POST" id="bulk-form"> <div class="table-responsive"> <div class="bulk-controls" style="margin-bottom: 15px; display: none;" id="bulk-controls"> <button type="submit" name="bulk_delete" class="btn-primary" style="background: var(--danger);" onclick="return confirm('Are you sure you want to delete selected enquiries?')"> <i class="fa fa-trash"></i> Delete Selected </button> </div> <table class="admin-table"> <thead> <tr> <th style="width: 40px;"><input type="checkbox" id="select-all"></th> <th style="width: 60px;">S.No</th> <th>ID</th> <th>Guest Name</th> <th>Mobile</th> <th>Car Type</th> <th>City</th> <th>Date</th> <th>Status</th> <th>Action</th> </tr> </thead> <tbody> <?php if (empty($enquiries)): ?> <tr> <td colspan="8" style="text-align: center;">No enquiries found.</td> </tr> <?php else: ?> <?php $sno = 1; foreach ($enquiries as $enq): ?> <tr> <td><input type="checkbox" name="enquiry_ids[]" value="<?php echo $enq['id']; ?>" class="enquiry-checkbox"></td> <td><?php echo $sno++; ?></td> <td>#<?php echo $enq['id']; ?></td> <td><strong><?php echo htmlspecialchars($enq['guest_name']); ?></strong><br> <small style="color: var(--text-muted);"><?php echo htmlspecialchars($enq['email']); ?></small> </td> <td><?php echo htmlspecialchars($enq['mobile']); ?></td> <td><?php echo htmlspecialchars($enq['car_type']); ?></td> <td><?php echo htmlspecialchars($enq['city']); ?></td> <td><?php echo date('d M, Y', strtotime($enq['created_at'])); ?></td> <td> <div class="dropdown"> <span class="badge badge-<?php echo strtolower($enq['status']); ?>"> <?php echo $enq['status']; ?> </span> </div> </td> <td> <div class="action-btns"> <a href="enquiry_details.php?id=<?php echo $enq['id']; ?>" class="btn-icon" title="View Details"> <i class="fa fa-eye"></i> </a> <div class="status-updater"> <button class="btn-icon status-btn" title="Change Status"><i class="fa fa-pencil"></i></button> <div class="status-dropdown"> <a href="enquiries.php?action=update&id=<?php echo $enq['id']; ?>&status=Pending">Pending</a> <a href="enquiries.php?action=update&id=<?php echo $enq['id']; ?>&status=Contacted">Contacted</a> <a href="enquiries.php?action=update&id=<?php echo $enq['id']; ?>&status=Resolved">Resolved</a> <a href="enquiries.php?action=update&id=<?php echo $enq['id']; ?>&status=Cancelled">Cancelled</a> </div> </div> </div> </td> </tr> <?php endforeach; ?> <?php endif; ?> </tbody> </table> </div> </form> </div> <script> document.getElementById('select-all').addEventListener('change', function() { const checkboxes = document.querySelectorAll('.enquiry-checkbox'); checkboxes.forEach(cb => cb.checked = this.checked); toggleBulkControls(); }); document.querySelectorAll('.enquiry-checkbox').forEach(cb => { cb.addEventListener('change', toggleBulkControls); }); function toggleBulkControls() { const checkedCount = document.querySelectorAll('.enquiry-checkbox:checked').length; document.getElementById('bulk-controls').style.display = checkedCount > 0 ? 'block' : 'none'; } </script> <?php require_once 'includes/footer.php'; ?>