diff --git a/README.md b/README.md index a99267d7..14df7392 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ #### A real-time map-based reporting system for campus infrastructure issues, built to improve visibility, accountability, and resolution efficiency. [](https://github.com/xodivorce/infra-xodivorce-in/) -[](https://github.com/xodivorce/infra-xodivorce-in/) +[](https://github.com/xodivorce/infra-xodivorce-in/) [](https://github.com/xodivorce/infra-xodivorce-in/) > **🥰 Like this project? Please consider giving it a Star (🌟) on GitHub to show us your appreciation. Thank you!** diff --git a/src/assets/users/_overview.php b/src/assets/users/_overview.php index 7a0e11ea..053f4a52 100755 --- a/src/assets/users/_overview.php +++ b/src/assets/users/_overview.php @@ -1,12 +1,10 @@ query("SET time_zone = '+05:30'"); -$totalResult = $conn->query("SELECT COUNT(*) FROM reports"); -$totalReports = $totalResult->fetch_row()[0]; +$openedResult = $conn->query("SELECT COUNT(*) FROM reports WHERE status = 'Opened'"); +$openedReports = $openedResult->fetch_row()[0]; -$activeResult = $conn->query("SELECT COUNT(*) FROM reports WHERE status IN ('Opened', 'In Progress')"); -$activeReports = $activeResult->fetch_row()[0]; +$inProgressResult = $conn->query("SELECT COUNT(*) FROM reports WHERE status = 'In Progress'"); +$inProgressReports = $inProgressResult->fetch_row()[0]; $resolvedResult = $conn->query("SELECT COUNT(*) FROM reports WHERE status = 'Resolved'"); $resolvedReports = $resolvedResult->fetch_row()[0]; @@ -21,7 +19,8 @@ $recentResult = $conn->query($recentSql); $recentActivity = $recentResult->fetch_all(MYSQLI_ASSOC); if (!function_exists('time_elapsed_string')) { - function time_elapsed_string($datetime, $full = false) { + function time_elapsed_string($datetime, $full = false) + { $now = new DateTime; $ago = new DateTime($datetime); $diff = $now->diff($ago); @@ -38,51 +37,66 @@ if (!function_exists('time_elapsed_string')) { } } - if (!$full) $string = array_slice($string, 0, 1); + if (!$full) + $string = array_slice($string, 0, 1); return $string ? implode(', ', $string) . ' ago' : 'just now'; } } ?>
= $totalReports ?>
-All submissions overview
+= $openedReports ?>
+Newly reported issues
= $activeReports ?>
+= $inProgressReports ?>
In progress / Open
= $resolvedReports ?>
Successfully closed
- Issue #= $row['id'] ?> = htmlspecialchars($row['status']) ?> + Issue #= $row['id'] ?> + = htmlspecialchars($row['status']) ?>
= time_elapsed_string($row['updated_at']) ?> diff --git a/src/assets/users/_reports.php b/src/assets/users/_reports.php index defd8c3d..537e82d5 100755 --- a/src/assets/users/_reports.php +++ b/src/assets/users/_reports.php @@ -404,6 +404,7 @@ $result = $conn->query($sql); +