🤩 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:brands.php
<?php $page = 'brands'; $page_title = 'Brands'; require_once '../includes/header.php'; if (isset($_GET['delete'])) { $db->prepare("DELETE FROM brands WHERE id = ?")->execute([intval($_GET['delete'])]); admin_set_flash('success', 'Brand deleted'); header('Location: ' . ADMIN_PATH . 'pages/brands.php'); exit; } $brands = $db->query("SELECT * FROM brands ORDER BY name ASC")->fetchAll(); ?> <div class="data-table-wrapper"> <div class="d-flex justify-content-between align-items-center mb-4"> <h3 style="margin: 0; font-size: 1.2rem;">All Brands</h3> <a href="<?= ADMIN_PATH ?>pages/brand-add.php" class="btn-admin btn-primary-admin"> <i class="fas fa-plus"></i> Add Brand </a> </div> <div class="table-responsive"> <table class="admin-table"> <thead> <tr> <th>Logo</th> <th>Name</th> <th>Slug</th> <th>Featured</th> <th>Status</th> <th>Actions</th> </tr> </thead> <tbody> <?php foreach ($brands as $brand): ?> <tr> <td> <?php if ($brand['logo']): ?> <img src="<?= UPLOADS_URL ?>brands/<?= $brand['logo'] ?>" class="image-preview" style="width: 50px; height: 50px; background: white;"> <?php else: ?> <div style="width: 50px; height: 50px; background: var(--soft-pink); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--primary-rose-gold); font-weight: 600;"> <?= strtoupper(substr($brand['name'], 0, 1)) ?> </div> <?php endif; ?> </td> <td><strong><?= htmlspecialchars($brand['name']) ?></strong></td> <td><code><?= htmlspecialchars($brand['slug']) ?></code></td> <td> <?php if ($brand['featured']): ?> <span class="badge" style="background: #fff3cd; color: #856404; padding: 3px 10px; border-radius: 10px;">Featured</span> <?php else: ?> <span class="text-muted">-</span> <?php endif; ?> </td> <td> <span class="status-badge status-<?= $brand['status'] ? 'active' : 'inactive' ?>"> <?= $brand['status'] ? 'Active' : 'Inactive' ?> </span> </td> <td> <div class="action-buttons"> <a href="<?= ADMIN_PATH ?>pages/brand-add.php?id=<?= $brand['id'] ?>" class="btn-icon btn-admin btn-primary-admin" data-bs-toggle="tooltip" title="Edit"> <i class="fas fa-edit"></i> </a> <a href="?delete=<?= $brand['id'] ?>" class="btn-icon btn-admin btn-danger-admin confirm-delete" data-bs-toggle="tooltip" title="Delete"> <i class="fas fa-trash"></i> </a> </div> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> <?php require_once '../includes/footer.php'; ?>
Save Changes
Cancel
Create New File
Create New Folder