198 lines
9.6 KiB
PHP
198 lines
9.6 KiB
PHP
<?php
|
|
require_once __DIR__ . '/db/config.php';
|
|
|
|
// Fetch clergy data
|
|
$stmt = db()->query("SELECT * FROM clergy ORDER BY created_at DESC");
|
|
$clergyList = $stmt->fetchAll();
|
|
|
|
// Stats
|
|
$totalClergy = count($clergyList);
|
|
$activeAssignments = $totalClergy; // Simplified for MVP
|
|
|
|
$title = $_SERVER['PROJECT_NAME'] ?? 'Clergy Registry';
|
|
$description = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Digital Registry and Payroll System for Clergy in Greece';
|
|
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?php echo htmlspecialchars($title); ?></title>
|
|
|
|
<!-- SEO and Dynamic Meta Tags -->
|
|
<?php if ($description): ?>
|
|
<meta name="description" content="<?php echo htmlspecialchars($description); ?>">
|
|
<meta property="og:description" content="<?php echo htmlspecialchars($description); ?>">
|
|
<meta property="twitter:description" content="<?php echo htmlspecialchars($description); ?>">
|
|
<?php endif; ?>
|
|
<?php if ($projectImageUrl): ?>
|
|
<meta property="og:image" content="<?php echo htmlspecialchars($projectImageUrl); ?>">
|
|
<meta property="twitter:image" content="<?php echo htmlspecialchars($projectImageUrl); ?>">
|
|
<?php endif; ?>
|
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
|
|
<link href="assets/css/custom.css?v=<?php echo time(); ?>" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<!-- Sidebar -->
|
|
<nav class="col-md-2 d-none d-md-block sidebar py-4">
|
|
<div class="px-3 mb-4">
|
|
<h5 class="fw-bold mb-0 text-dark">Registry Admin</h5>
|
|
<small class="text-muted">Greece Clergy System</small>
|
|
</div>
|
|
<div class="nav flex-column px-2">
|
|
<a class="nav-link active" href="index.php">Dashboard</a>
|
|
<a class="nav-link" href="#">Clergy Directory</a>
|
|
<a class="nav-link" href="#">Payroll Runs</a>
|
|
<a class="nav-link" href="#">Organizations</a>
|
|
<a class="nav-link" href="#">Reports</a>
|
|
<div class="mt-auto pt-4">
|
|
<a class="nav-link text-danger" href="#">Logout</a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Main Content -->
|
|
<main class="col-md-10 ms-sm-auto px-md-4 py-4">
|
|
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center mb-4">
|
|
<h1 class="h4 fw-bold mb-0">Registry Dashboard</h1>
|
|
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#registerModal">
|
|
Register New Clergy
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Stats -->
|
|
<div class="row g-4 mb-5">
|
|
<div class="col-md-3">
|
|
<div class="card stat-card shadow-sm border-0">
|
|
<div class="stat-label">Total Clergy</div>
|
|
<div class="stat-value"><?php echo $totalClergy; ?></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="card stat-card shadow-sm border-0">
|
|
<div class="stat-label">Active Assignments</div>
|
|
<div class="stat-value"><?php echo $activeAssignments; ?></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="card stat-card shadow-sm border-0">
|
|
<div class="stat-label">Metropolises</div>
|
|
<div class="stat-value">2</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="card stat-card shadow-sm border-0">
|
|
<div class="stat-label">Pending Payroll</div>
|
|
<div class="stat-value">€0.00</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Clergy Directory -->
|
|
<div class="card mb-4 border-0 shadow-sm overflow-hidden">
|
|
<div class="px-3 py-3 border-bottom d-flex align-items-center justify-content-between">
|
|
<h6 class="mb-0 fw-bold">Recent Registrations</h6>
|
|
<small class="text-muted">Viewing latest entries</small>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table align-middle mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Rank</th>
|
|
<th>Metropolis</th>
|
|
<th>Email</th>
|
|
<th>Status</th>
|
|
<th>Registered</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($clergyList as $row): ?>
|
|
<tr>
|
|
<td>
|
|
<div class="fw-semibold text-dark"><?php echo htmlspecialchars($row['first_name'] . ' ' . $row['last_name']); ?></div>
|
|
</td>
|
|
<td><span class="text-secondary"><?php echo htmlspecialchars($row['clergy_rank']); ?></span></td>
|
|
<td><?php echo htmlspecialchars($row['metropolis_name']); ?></td>
|
|
<td><?php echo htmlspecialchars($row['email']); ?></td>
|
|
<td><span class="badge-active">Active</span></td>
|
|
<td class="text-muted"><?php echo date('M d, Y', strtotime($row['created_at'])); ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php if (empty($clergyList)): ?>
|
|
<tr>
|
|
<td colspan="6" class="text-center py-4 text-muted">No records found.</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Register Modal -->
|
|
<div class="modal fade" id="registerModal" tabindex="-1" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
<div class="modal-content border-0 shadow-lg">
|
|
<div class="modal-header border-0 pb-0">
|
|
<h5 class="modal-title fw-bold">Register New Clergy</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body pt-3">
|
|
<form id="registerClergyForm">
|
|
<div class="row g-3">
|
|
<div class="col-md-6">
|
|
<label class="form-label small fw-semibold">First Name</label>
|
|
<input type="text" name="first_name" class="form-control" placeholder="e.g. Ioannis" required>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label class="form-label small fw-semibold">Last Name</label>
|
|
<input type="text" name="last_name" class="form-control" placeholder="e.g. Papadopoulos" required>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label class="form-label small fw-semibold">Clergy Rank</label>
|
|
<select name="clergy_rank" class="form-control" required>
|
|
<option value="">Select Rank...</option>
|
|
<option value="Archbishop">Archbishop</option>
|
|
<option value="Metropolitan">Metropolitan</option>
|
|
<option value="Bishop">Bishop</option>
|
|
<option value="Archimandrite">Archimandrite</option>
|
|
<option value="Priest">Priest</option>
|
|
<option value="Deacon">Deacon</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label class="form-label small fw-semibold">Metropolis / Diocese</label>
|
|
<input type="text" name="metropolis_name" class="form-control" placeholder="e.g. Metropolis of Athens" required>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label class="form-label small fw-semibold">Email Address</label>
|
|
<input type="email" name="email" class="form-control" placeholder="name@diocese.gr">
|
|
</div>
|
|
</div>
|
|
<div class="mt-4 text-end">
|
|
<button type="button" class="btn text-muted me-2" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="submit" class="btn btn-primary">Register Clergy</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Toast Container -->
|
|
<div id="toastContainer" class="toast-container position-fixed bottom-0 end-0 p-3"></div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
|
</body>
|
|
</html>
|