🤩 File Manager - Mr.X
PHP:
8.2.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:contacts.php
<?php require_once 'header.php'; $messages = db_fetch_all($conn, "SELECT * FROM contacts ORDER BY created_at DESC"); // Mark as read if (isset($_GET['read'])) { $id = (int)$_GET['read']; db_query($conn, "UPDATE contacts SET is_read = 1 WHERE id = $id"); header("Location: contacts.php"); exit; } ?> <div class="admin-card bg-white p-4"> <h4 class="fw-bold mb-4">Contact Messages</h4> <div class="table-responsive"> <table class="table table-hover"> <thead> <tr> <th>Date</th> <th>Name</th> <th>Email / Phone</th> <th>Subject</th> <th>Action</th> </tr> </thead> <tbody> <?php foreach($messages as $m): ?> <tr class="<?= $m['is_read'] ? 'opacity-50' : 'fw-bold' ?>"> <td class="small"><?= date('d M Y', strtotime($m['created_at'])) ?></td> <td><?= e($m['name']) ?></td> <td> <small class="d-block"><?= e($m['email']) ?></small> <small class="text-muted"><?= e($m['phone']) ?></small> </td> <td><?= e($m['subject']) ?></td> <td> <button class="btn btn-sm btn-light" data-bs-toggle="modal" data-bs-target="#msgModal<?= $m['id'] ?>">Read</button> <?php if(!$m['is_read']): ?> <a href="contacts.php?read=<?= $m['id'] ?>" class="btn btn-sm btn-outline-success"><i class="fas fa-check"></i></a> <?php endif; ?> </td> </tr> <div class="modal fade" id="msgModal<?= $m['id'] ?>" tabindex="-1"> <div class="modal-dialog"> <div class="modal-content border-0 rounded-4"> <div class="modal-header border-0 bg-light"> <h5 class="modal-title">From: <?= e($m['name']) ?></h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body p-4"> <p class="small text-muted mb-4"><?= date('F d, Y h:i A', strtotime($m['created_at'])) ?></p> <h6 class="fw-bold"><?= e($m['subject']) ?></h6> <p class="mt-3"><?= nl2br(e($m['message'])) ?></p> <div class="mt-5 pt-3 border-top"> <a href="mailto:<?= e($m['email']) ?>" class="btn btn-primary btn-sm rounded-pill px-3">Reply via Email</a> <a href="tel:<?= e($m['phone']) ?>" class="btn btn-outline-dark btn-sm rounded-pill px-3 ms-2">Call Now</a> </div> </div> </div> </div> </div> <?php endforeach; ?> </tbody> </table> </div> </div> <?php require_once 'footer.php'; ?>
Save Changes
Cancel
Create New File
Create New Folder