BLACKSITE
:
216.73.216.62
:
147.93.18.13 / vinyasaweddings.com
:
Linux srv667811 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64
:
/
var
/
www
/
vkraft
/
views
/
admin
/
Upload File:
files >> /var/www/vkraft/views/admin/enquiry.php
<?php include 'views/admin/layout/header.php'; include 'views/admin/layout/Sidebar.php'; // Fetch enquiries from database require_once __DIR__ . '/../../db.php'; $stmt = $db->query("SELECT * FROM enquiry ORDER BY created_at DESC"); $enquiries = $stmt->fetchAll(PDO::FETCH_ASSOC); ?> <main class="main-content"> <div class="container-fluid px-4"> <div class="d-flex justify-content-between align-items-center mb-4"> <h1 class="mb-0">Enquiries</h1> </div> <div class="card shadow-sm"> <div class="card-body"> <div class="table-responsive"> <table class="table table-hover align-middle enquiry-table"> <thead> <tr> <th>#</th> <th>Name</th> <th>Phone</th> <th>Date</th> <th>Status</th> <th>Actions</th> </tr> </thead> <tbody> <?php if (count($enquiries) > 0): ?> <?php foreach ($enquiries as $index => $enquiry): ?> <tr> <td><?= $index + 1 ?></td> <td><?= htmlspecialchars($enquiry['name']) ?></td> <td><?= htmlspecialchars($enquiry['phone']) ?></td> <td><?= date('d-m-Y', strtotime($enquiry['created_at'])) ?></td> <td> <span class="badge bg-secondary">New</span> </td> <td> <button class="btn btn-sm btn-outline-primary me-1 view-enquiry" data-bs-toggle="modal" data-bs-target="#enquiryModal" data-name="<?= htmlspecialchars($enquiry['name']) ?>" data-email="<?= htmlspecialchars($enquiry['email']) ?>" data-phone="<?= htmlspecialchars($enquiry['phone']) ?>" data-requirements="<?= htmlspecialchars($enquiry['requirements']) ?>" data-date="<?= date('d-m-Y H:i', strtotime($enquiry['created_at'])) ?>"> <i class="fas fa-eye"></i> </button> </td> </tr> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="6" class="text-center py-4">No enquiries found</td> </tr> <?php endif; ?> </tbody> </table> </div> </div> </div> </div> </main> <!-- Enquiry Detail Modal --> <div class="modal fade" id="enquiryModal" tabindex="-1" aria-labelledby="enquiryModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-body"> <div class="row mb-3"> <div class="col-md-12"> <h6 class="text-muted">Name</h6> <p class="enquiry-name fs-5"></p> </div> </div> <div class="row mb-3"> <div class="col-md-12"> <h6 class="text-muted">Email</h6> <p class="enquiry-email fs-5"></p> </div> </div> <div class="row mb-3"> <div class="col-md-6"> <h6 class="text-muted">Phone</h6> <p class="enquiry-phone fs-5"></p> </div> <div class="col-md-6"> <h6 class="text-muted">Date</h6> <p class="enquiry-date fs-5"></p> </div> </div> <div class="mb-3"> <h6 class="text-muted">Requirements</h6> <p class="enquiry-requirements fs-5" style="white-space: pre-wrap;"></p> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <!-- <a href="#" class="btn btn-primary reply-email"><i class="fas fa-reply me-2"></i>Reply via Email</a> --> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { // Handle modal data population var enquiryModal = document.getElementById('enquiryModal'); enquiryModal.addEventListener('show.bs.modal', function (event) { var button = event.relatedTarget; // Extract data from button attributes var name = button.getAttribute('data-name'); var email = button.getAttribute('data-email'); var phone = button.getAttribute('data-phone'); var requirements = button.getAttribute('data-requirements'); var date = button.getAttribute('data-date'); // Update modal content enquiryModal.querySelector('.enquiry-name').textContent = name; enquiryModal.querySelector('.enquiry-email').textContent = email; enquiryModal.querySelector('.enquiry-phone').textContent = phone; enquiryModal.querySelector('.enquiry-requirements').textContent = requirements; enquiryModal.querySelector('.enquiry-date').textContent = date; // Set up reply email link enquiryModal.querySelector('.reply-email').href = 'mailto:' + email; }); }); </script> <?php include 'views/admin/layout/footer.php'; ?>