BLACKSITE
:
216.73.216.140
:
199.188.200.160 / jeddahhousingltd.com
:
Linux server383.web-hosting.com 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
:
/
home
/
jeddveug
/
www
/
admin
/
Upload File:
files >> /home/jeddveug/www/admin/members.php
<?php require_once __DIR__ . '/../config/db.php'; // Check authentication if (!isset($_SESSION['admin_id'])) { header('Location: login.php'); exit; } if (isset($_GET['delete'])) { $id = (int)$_GET['delete']; $stmt = $pdo->prepare("SELECT image FROM members WHERE id = ?"); $stmt->execute([$id]); $m = $stmt->fetch(); if ($m && $m['image'] && file_exists('../uploads/members/' . $m['image'])) unlink('../uploads/members/' . $m['image']); $pdo->prepare("DELETE FROM members WHERE id = ?")->execute([$id]); header('Location: members.php?msg=deleted'); exit; } $admin_page_title = 'Manage Members'; require_once 'includes/header.php'; $members = $pdo->query("SELECT * FROM members ORDER BY display_order ASC, created_at DESC")->fetchAll(); ?> <?php if (isset($_GET['msg'])): ?> <div class="alert-dismiss mb-4 px-4 py-3 rounded-xl text-sm font-medium <?= $_GET['msg'] === 'deleted' ? 'bg-red-100 text-red-700' : 'bg-green-100 text-green-700' ?>"> <?= $_GET['msg'] === 'added' ? '✅ Member added!' : ($_GET['msg'] === 'updated' ? '✅ Member updated!' : '🗑️ Member deleted!') ?> </div> <?php endif; ?> <div class="flex items-center justify-between mb-6"> <p class="text-gray-500 text-sm"><?= count($members) ?> total members</p> <a href="member_add.php" class="bg-primary-700 hover:bg-primary-800 text-white px-5 py-2.5 rounded-xl text-sm font-medium transition-colors"><i class="fas fa-plus mr-2"></i>Add Member</a> </div> <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5"> <?php if (empty($members)): ?> <div class="col-span-full text-center py-12 text-gray-400 bg-white rounded-xl"><i class="fas fa-users text-3xl mb-2 block"></i>No members found</div> <?php else: ?> <?php foreach ($members as $member): ?> <div class="bg-white rounded-xl shadow-sm p-5 hover:shadow-md transition-shadow"> <div class="flex items-start space-x-4"> <?php if ($member['image']): ?> <img src="../uploads/members/<?= htmlspecialchars($member['image']) ?>" class="w-16 h-16 rounded-full object-cover"> <?php else: ?> <div class="w-16 h-16 rounded-full bg-primary-100 flex items-center justify-center"><i class="fas fa-user text-primary-600 text-xl"></i></div> <?php endif; ?> <div class="flex-1 min-w-0"> <h3 class="font-semibold text-gray-800"><?= htmlspecialchars($member['name']) ?></h3> <p class="text-sm text-primary-600"><?= htmlspecialchars($member['designation'] ?? '') ?></p> <?php if ($member['phone']): ?><p class="text-xs text-gray-500 mt-1"><i class="fas fa-phone mr-1"></i><?= htmlspecialchars($member['phone']) ?></p><?php endif; ?> <?php if ($member['email']): ?><p class="text-xs text-gray-500"><i class="fas fa-envelope mr-1"></i><?= htmlspecialchars($member['email']) ?></p><?php endif; ?> </div> </div> <div class="flex justify-end mt-4 space-x-2"> <a href="member_edit.php?id=<?= $member['id'] ?>" class="text-blue-600 hover:text-blue-800 text-sm"><i class="fas fa-edit"></i> Edit</a> <a href="members.php?delete=<?= $member['id'] ?>" onclick="return confirm('Delete this member?')" class="text-red-600 hover:text-red-800 text-sm"><i class="fas fa-trash"></i> Delete</a> </div> </div> <?php endforeach; ?> <?php endif; ?> </div> <?php require_once 'includes/footer.php'; ?>