🤩 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:messages.php
<?php define('PAGE_TITLE', 'Messages'); require_once 'includes/header.php'; if (isset($_GET['read']) && intval($_GET['read'])) { $conn->query("UPDATE contact_messages SET is_read=1 WHERE id=" . intval($_GET['read'])); $conn->query("UPDATE notifications SET is_read=1 WHERE link LIKE '%messages%'"); } $messages = $conn->query("SELECT * FROM contact_messages ORDER BY 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-envelope text-warning me-2"></i>Contact Messages</h4> </div> <div class="premium-card p-4"> <table class="table table-hover datatable"> <thead><tr><th>ID</th><th>Name</th><th>Email</th><th>Phone</th><th>Subject</th><th>Date</th><th>Read</th><th>Action</th></tr></thead> <tbody><?php foreach ($messages as $m): ?> <tr class="<?= !$m['is_read']?'fw-bold':'' ?>"><td><?= $m['id'] ?></td><td><?= htmlspecialchars($m['name']) ?></td><td><?= $m['email'] ?></td> <td><?= $m['phone'] ?: '-' ?></td><td><?= htmlspecialchars($m['subject'] ?: '-') ?></td><td><small><?= date('d M Y h:i A', strtotime($m['created_at'])) ?></small></td> <td><?= $m['is_read']?'<span class="badge bg-secondary">Read</span>':'<span class="badge bg-warning">New</span>' ?></td> <td><button class="btn btn-sm btn-outline-premium" onclick="Swal.fire({title:'<?= htmlspecialchars($m['name']) ?>',html:'<b>Email:</b> <?= $m['email'] ?><br><b>Phone:</b> <?= $m['phone']?:'-' ?><br><b>Subject:</b> <?= htmlspecialchars($m['subject']?:'-') ?><br><b>Message:</b><br><?= nl2br(htmlspecialchars($m['message'])) ?>'}).then(function(){window.location.href='?read=<?= $m['id'] ?>'})"><i class="bi bi-eye"></i></button></td></tr> <?php endforeach; ?></tbody> </table> </div> <?php require_once 'includes/footer.php'; ?>
Save Changes
Cancel
Create New File
Create New Folder