From 8bd25eba00fcf99833230319040ae287ed047133 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sat, 4 Oct 2025 17:29:49 +0000 Subject: [PATCH] v01.3 --- dashboard.php | 6 ++- my_reports.php | 124 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 my_reports.php diff --git a/dashboard.php b/dashboard.php index 680f690..57e0a53 100644 --- a/dashboard.php +++ b/dashboard.php @@ -110,7 +110,11 @@ function getStatusBadgeClass($status) { - + + + + + $ diff --git a/my_reports.php b/my_reports.php new file mode 100644 index 0000000..d0858c4 --- /dev/null +++ b/my_reports.php @@ -0,0 +1,124 @@ +prepare("SELECT id, agent_name, amount, description, status, created_at FROM expense_reports WHERE agent_name = ? ORDER BY created_at DESC"); + $stmt->execute([$agent_name]); + $reports = $stmt->fetchAll(PDO::FETCH_ASSOC); + } catch (PDOException $e) { + // For a real app, log this error instead of displaying it + die("Database error: " . $e->getMessage()); + } +} + +function getStatusClass($status) { + switch ($status) { + case 'Approved': + return 'bg-green-100 text-green-800'; + case 'Rejected': + return 'bg-red-100 text-red-800'; + case 'Pending': + default: + return 'bg-yellow-100 text-yellow-800'; + } +} +?> + + + + + + <?php echo $page_title; ?> - Expense Tracker + + + + + + + +
+ +
+ +
+
+

+
+ + +
+

No Agent Selected

+

Please go to the main dashboard and click on an agent's name to see their reports.

+
+ +
+

No Reports Found

+

This agent has not submitted any expense reports yet.

+ Submit First Report +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
AgentDateAmountDescriptionStatus
+

+
+

+
+

$

+
+

+
+ + + + +
+
+ +
+ + + +