🤩 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:newsletters.php
<?php $page = 'newsletters'; $page_title = 'Newsletter Subscribers'; require_once '../includes/header.php'; if (isset($_GET['delete'])) { $db->prepare("DELETE FROM newsletters WHERE id = ?")->execute([intval($_GET['delete'])]); admin_set_flash('success', 'Subscriber removed'); header('Location: ' . ADMIN_PATH . 'pages/newsletters.php'); exit; } $subscribers = $db->query("SELECT * FROM newsletters ORDER BY created_at DESC")->fetchAll(); $total = count($subscribers); ?> <div class="data-table-wrapper"> <div class="d-flex justify-content-between align-items-center mb-4 flex-wrap gap-2"> <h3 style="margin: 0; font-size: 1.2rem;">Subscribers (<?= $total ?>)</h3> <button class="btn-admin btn-primary-admin" data-bs-toggle="modal" data-bs-target="#exportModal"> <i class="fas fa-download"></i> Export CSV </button> </div> <div class="table-responsive"> <table class="admin-table"> <thead> <tr> <th>Email</th> <th>Status</th> <th>Subscribed On</th> <th>Actions</th> </tr> </thead> <tbody> <?php foreach ($subscribers as $s): ?> <tr> <td><strong><?= htmlspecialchars($s['email']) ?></strong></td> <td> <span class="status-badge status-<?= $s['status'] ? 'active' : 'inactive' ?>"> <?= $s['status'] ? 'Active' : 'Inactive' ?> </span> </td> <td><?= date('M d, Y h:i A', strtotime($s['created_at'])) ?></td> <td> <a href="?delete=<?= $s['id'] ?>" class="btn-icon btn-admin btn-danger-admin confirm-delete" data-bs-toggle="tooltip" title="Delete"> <i class="fas fa-trash"></i> </a> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> <?php require_once '../includes/footer.php'; ?>
Save Changes
Cancel
Create New File
Create New Folder