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/client-manage.php
<?php include 'views/admin/layout/header.php'; ?> <?php include 'views/admin/layout/Sidebar.php'; ?> <?php require_once __DIR__ . '/../../db.php'; // Handle status update $updated = false; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['id'], $_POST['status'])) { $id = $_POST['id']; $status = $_POST['status']; if (in_array($status, ['active', 'inactive'])) { $stmt = $db->prepare("UPDATE clients SET status = ? WHERE id = ?"); if ($stmt->execute([$status, $id])) { $_SESSION['banner_status_updated'] = true; echo "<script>location.href=window.location.href;</script>"; // JS redirect to clear POST exit; } } } // Fetch all banners $stmt = $db->query("SELECT * FROM clients ORDER BY id DESC"); $banners = $stmt->fetchAll(PDO::FETCH_ASSOC); ?> <main class="main-content"> <div class="container"> <div class="d-flex justify-content-between align-items-center mb-4"> <h1>Manage Clients</h1> <a href="client-add" class="btn btn-primary"> <i class="fas fa-plus me-2"></i> Add New Client </a> </div> <?php if ($updated): ?> <div class="alert alert-success fade-alert text-center mx-4"> Banner status updated successfully! </div> <?php endif; ?> <div class="card shadow-sm"> <div class="card-body"> <div class="table-responsive"> <table class="table table-hover align-middle"> <thead> <tr> <th width="50">#</th> <th>Client</th> <th>Title</th> <th>Status</th> <!-- <th width="150">Actions</th> --> </tr> </thead> <tbody> <?php if (count($banners) > 0): ?> <?php foreach ($banners as $index => $banner): ?> <tr> <td><?= $index + 1 ?></td> <td> <img src="<?= BASE_URL ?>/uploads/clients/<?= htmlspecialchars($banner['image']) ?>" alt="Banner Image" class="img-thumbnail" style="width: 150px; height: auto;"> </td> <td><?= htmlspecialchars($banner['title']) ?></td> <td> <form method="POST" action="" style="margin: 0;"> <input type="hidden" name="id" value="<?= $banner['id'] ?>"> <select name="status" class="form-select form-select-sm" style="width: 120px;" onchange="this.form.submit()"> <option value="active" <?= $banner['status'] === 'active' ? 'selected' : '' ?>> Active</option> <option value="inactive" <?= $banner['status'] === 'inactive' ? 'selected' : '' ?>>Inactive</option> </select> </form> </td> <!-- <td> <a href="banner-edit.php?id=<?= $banner['id'] ?>" class="btn btn-sm btn-outline-primary me-1"> <i class="fas fa-edit"></i> </a> <a href="delete-banner.php?id=<?= $banner['id'] ?>" onclick="return confirm('Are you sure?')" class="btn btn-sm btn-outline-danger"> <i class="fas fa-trash"></i> </a> </td> --> </tr> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="5" class="text-center">No banners found.</td> </tr> <?php endif; ?> </tbody> </table> </div> <!-- <nav aria-label="Page navigation" class="mt-4"> <ul class="pagination justify-content-center"> <li class="page-item disabled"> <a class="page-link" href="#" tabindex="-1">Previous</a> </li> <li class="page-item active"><a class="page-link" href="#">1</a></li> <li class="page-item"><a class="page-link" href="#">2</a></li> <li class="page-item"><a class="page-link" href="#">3</a></li> <li class="page-item"> <a class="page-link" href="#">Next</a> </li> </ul> </nav> --> </div> </div> </div> </main> <script> setTimeout(() => { const alert = document.querySelector('.fade-alert'); if (alert) { alert.style.transition = 'opacity 0.5s'; alert.style.opacity = 0; setTimeout(() => alert.remove(), 500); } }, 2000); </script> <?php include 'views/admin/layout/footer.php'; ?>