diff --git a/admin/donors.php b/admin/donors.php new file mode 100644 index 0000000..6704a54 --- /dev/null +++ b/admin/donors.php @@ -0,0 +1,76 @@ +query("SELECT id, name, age, blood_type, status, created_at FROM donors ORDER BY created_at DESC"); + $donors = $stmt->fetchAll(PDO::FETCH_ASSOC); +} catch (PDOException $e) { + // In a real app, you'd log this error and show a user-friendly message. + die("Error: Could not fetch donors. " . $e->getMessage()); +} +?> + +
| ID | +Name | +Age | +Blood Type | +Status | +Registered At | +Actions | +
|---|---|---|---|---|---|---|
| No donor registrations found. | +||||||
| + | + | + | + | + + + + | ++ | + + + + + N/A + + | +
| ID | +Name | +License Number | +Transplant Ready | +Status | +Registered At | +Actions | +|
|---|---|---|---|---|---|---|---|
| No hospital registrations found. | +|||||||
| = htmlspecialchars($hospital['id']); ?> | += htmlspecialchars($hospital['name']); ?> | += htmlspecialchars($hospital['license_number']); ?> | += htmlspecialchars($hospital['email']); ?> | += $hospital['has_transplant_capability'] ? 'Yes' : 'No'; ?> | ++ 'bg-warning text-dark', + 'Verified' => 'bg-success', + 'Rejected' => 'bg-danger', + ]; + $class = $status_classes[$hospital['status']] ?? 'bg-secondary'; + ?> + + = htmlspecialchars($hospital['status']); ?> + + | += htmlspecialchars($hospital['created_at']); ?> | ++ + + + + N/A + + | +
Welcome to the administration area. From here you can manage donors, hospitals, and system settings.
+ +Manage and verify donor registrations.
+ 0): ?> + + Manage Donors = $pending_donors_count ?> Pending + + + Manage Donors + +Manage and verify hospital registrations.
+ 0): ?> + + Manage Hospitals = $pending_hospitals_count ?> Pending + + + Manage Hospitals + +