87 lines
4.8 KiB
PHP
87 lines
4.8 KiB
PHP
<?php
|
|
require_once 'auth.php';
|
|
require_login('identity_verification');
|
|
|
|
require_once 'db/config.php';
|
|
$pdo = db();
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Identity Verification Dashboard</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css">
|
|
</head>
|
|
<body class="bg-gray-100">
|
|
|
|
<nav class="bg-white shadow-md">
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div class="flex justify-between h-16">
|
|
<div class="flex">
|
|
<div class="flex-shrink-0 flex items-center">
|
|
<a href="#" class="text-2xl font-bold text-blue-600">SecurePort (Identity Vetting)</a>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-center">
|
|
<span class="mr-4">Welcome, <?php echo htmlspecialchars($_SESSION['username']); ?>!</span>
|
|
<a href="logout.php" class="px-3 py-2 rounded-md text-sm font-medium text-gray-700 hover:text-blue-600 hover:bg-gray-50">Logout</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<main class="container mx-auto px-6 py-8">
|
|
<h1 class="text-3xl font-bold text-gray-800 mb-6">Identity Verification Dashboard</h1>
|
|
|
|
<div class="bg-white shadow-md rounded-lg overflow-hidden">
|
|
<table class="min-w-full bg-white">
|
|
<thead class="bg-gray-800 text-white">
|
|
<tr>
|
|
<th class="w-1/6 text-left py-3 px-4 uppercase font-semibold text-sm">Submission ID</th>
|
|
<th class="w-1/4 text-left py-3 px-4 uppercase font-semibold text-sm">Applicant Name</th>
|
|
<th class="w-1/4 text-left py-3 px-4 uppercase font-semibold text-sm">ID/Passport #</th>
|
|
<th class="w-1/6 text-left py-3 px-4 uppercase font-semibold text-sm">ID Scan</th>
|
|
<th class="w-1/6 text-left py-3 px-4 uppercase font-semibold text-sm">Status</th>
|
|
<th class="text-left py-3 px-4 uppercase font-semibold text-sm">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="text-gray-700">
|
|
<?php
|
|
$stmt = $pdo->query("SELECT id, full_name, id_or_passport, id_scan, identity_status FROM submissions ORDER BY created_at DESC");
|
|
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
|
echo "<tr>";
|
|
echo "<td class='text-left py-3 px-4'>" . htmlspecialchars($row['id']) . "</td>";
|
|
echo "<td class='text-left py-3 px-4'>" . htmlspecialchars($row['full_name']) . "</td>";
|
|
echo "<td class='text-left py-3 px-4'>" . htmlspecialchars($row['id_or_passport']) . "</td>";
|
|
echo "<td class='text-left py-3 px-4'><a href='uploads/" . htmlspecialchars($row['id_scan']) . "' target='_blank' class='text-blue-500 hover:text-blue-700'>View Scan</a></td>";
|
|
|
|
$status_class = 'bg-yellow-200 text-yellow-800';
|
|
if ($row['identity_status'] === 'Approved') {
|
|
$status_class = 'bg-green-200 text-green-800';
|
|
} elseif ($row['identity_status'] === 'Rejected') {
|
|
$status_class = 'bg-red-200 text-red-800';
|
|
}
|
|
echo "<td class='text-left py-3 px-4'><span class='" . $status_class . " py-1 px-3 rounded-full text-xs'>" . htmlspecialchars($row['identity_status']) . "</span></td>";
|
|
|
|
echo "<td class='text-left py-3 px-4'>";
|
|
if ($row['identity_status'] === 'Pending') {
|
|
echo "<form action='update_vetting_status.php' method='POST' class='flex space-x-2'>";
|
|
echo "<input type='hidden' name='submission_id' value='" . $row['id'] . "'>";
|
|
echo "<input type='hidden' name='department' value='identity'>";
|
|
echo "<button type='submit' name='status' value='Approved' class='px-2 py-1 bg-green-500 text-white rounded-md text-xs hover:bg-green-600'>Approve</button>";
|
|
echo "<button type='submit' name='status' value='Rejected' class='px-2 py-1 bg-red-500 text-white rounded-md text-xs hover:bg-red-600'>Reject</button>";
|
|
echo "</form>";
|
|
}
|
|
echo "</td>";
|
|
echo "</tr>";
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</main>
|
|
|
|
</body>
|
|
</html>
|