mirror of
https://github.com/xodivorce/infra-xodivorce-in.git
synced 2026-02-04 14:32:22 +05:30
fix: khown bugs, add Medical/Health Issue in reports category
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
#### A real-time map-based reporting system for campus infrastructure issues, built to improve visibility, accountability, and resolution efficiency.
|
#### 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/)
|
||||||
[](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!**
|
> **🥰 Like this project? Please consider giving it a Star (🌟) on GitHub to show us your appreciation. Thank you!**
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
date_default_timezone_set('Asia/Kolkata');
|
|
||||||
$conn->query("SET time_zone = '+05:30'");
|
|
||||||
|
|
||||||
$totalResult = $conn->query("SELECT COUNT(*) FROM reports");
|
$openedResult = $conn->query("SELECT COUNT(*) FROM reports WHERE status = 'Opened'");
|
||||||
$totalReports = $totalResult->fetch_row()[0];
|
$openedReports = $openedResult->fetch_row()[0];
|
||||||
|
|
||||||
$activeResult = $conn->query("SELECT COUNT(*) FROM reports WHERE status IN ('Opened', 'In Progress')");
|
$inProgressResult = $conn->query("SELECT COUNT(*) FROM reports WHERE status = 'In Progress'");
|
||||||
$activeReports = $activeResult->fetch_row()[0];
|
$inProgressReports = $inProgressResult->fetch_row()[0];
|
||||||
|
|
||||||
$resolvedResult = $conn->query("SELECT COUNT(*) FROM reports WHERE status = 'Resolved'");
|
$resolvedResult = $conn->query("SELECT COUNT(*) FROM reports WHERE status = 'Resolved'");
|
||||||
$resolvedReports = $resolvedResult->fetch_row()[0];
|
$resolvedReports = $resolvedResult->fetch_row()[0];
|
||||||
@@ -21,7 +19,8 @@ $recentResult = $conn->query($recentSql);
|
|||||||
$recentActivity = $recentResult->fetch_all(MYSQLI_ASSOC);
|
$recentActivity = $recentResult->fetch_all(MYSQLI_ASSOC);
|
||||||
|
|
||||||
if (!function_exists('time_elapsed_string')) {
|
if (!function_exists('time_elapsed_string')) {
|
||||||
function time_elapsed_string($datetime, $full = false) {
|
function time_elapsed_string($datetime, $full = false)
|
||||||
|
{
|
||||||
$now = new DateTime;
|
$now = new DateTime;
|
||||||
$ago = new DateTime($datetime);
|
$ago = new DateTime($datetime);
|
||||||
$diff = $now->diff($ago);
|
$diff = $now->diff($ago);
|
||||||
@@ -38,7 +37,8 @@ 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';
|
return $string ? implode(', ', $string) . ' ago' : 'just now';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,41 +48,55 @@ if (!function_exists('time_elapsed_string')) {
|
|||||||
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-4">
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-4">
|
||||||
|
|
||||||
<div class="group bg-neutral-800 rounded-lg border border-neutral-700/50 p-4 shadow-sm hover:border-blue-500/30 transition-all duration-300 flex items-center justify-between">
|
<div
|
||||||
|
class="group bg-neutral-800 rounded-lg border border-neutral-700/50 p-4 shadow-sm hover:border-blue-500/30 transition-all duration-300 flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h3 class="text-xs font-semibold text-neutral-400 uppercase tracking-wider group-hover:text-blue-400 transition-colors">Total Reports</h3>
|
<h3
|
||||||
<p class="text-2xl font-bold text-white mt-1"><?= $totalReports ?></p>
|
class="text-xs font-semibold text-neutral-400 uppercase tracking-wider group-hover:text-blue-400 transition-colors">
|
||||||
<p class="text-[10px] text-neutral-500 mt-1">All submissions overview</p>
|
Opened Reports
|
||||||
|
</h3>
|
||||||
|
<p class="text-2xl font-bold text-white mt-1"><?= $openedReports ?></p>
|
||||||
|
<p class="text-[10px] text-neutral-500 mt-1">Newly reported issues</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-3 bg-blue-500/10 rounded-lg group-hover:bg-blue-500/20 transition-colors">
|
|
||||||
<svg class="w-6 h-6 text-blue-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<div
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
class="w-10 h-10 rounded-full bg-blue-500/10 border border-blue-500/20 flex items-center justify-center">
|
||||||
|
<svg class="w-4 h-4 text-blue-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="group bg-neutral-800 rounded-lg border border-neutral-700/50 p-4 shadow-sm hover:border-yellow-500/30 transition-all duration-300 flex items-center justify-between">
|
<div
|
||||||
|
class="group bg-neutral-800 rounded-lg border border-neutral-700/50 p-4 shadow-sm hover:border-yellow-500/30 transition-all duration-300 flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h3 class="text-xs font-semibold text-neutral-400 uppercase tracking-wider group-hover:text-yellow-400 transition-colors">Reports In Progress</h3>
|
<h3
|
||||||
<p class="text-2xl font-bold text-white mt-1"><?= $activeReports ?></p>
|
class="text-xs font-semibold text-neutral-400 uppercase tracking-wider group-hover:text-yellow-400 transition-colors">
|
||||||
|
Reports In Progress</h3>
|
||||||
|
<p class="text-2xl font-bold text-white mt-1"><?= $inProgressReports ?></p>
|
||||||
<p class="text-[10px] text-neutral-500 mt-1">In progress / Open</p>
|
<p class="text-[10px] text-neutral-500 mt-1">In progress / Open</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-3 bg-yellow-500/10 rounded-lg group-hover:bg-yellow-500/20 transition-colors">
|
<div class="p-3 bg-yellow-500/10 rounded-lg group-hover:bg-yellow-500/20 transition-colors">
|
||||||
<svg class="w-6 h-6 text-yellow-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg class="w-6 h-6 text-yellow-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||||
|
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="group bg-neutral-800 rounded-lg border border-neutral-700/50 p-4 shadow-sm hover:border-green-500/30 transition-all duration-300 flex items-center justify-between">
|
<div
|
||||||
|
class="group bg-neutral-800 rounded-lg border border-neutral-700/50 p-4 shadow-sm hover:border-green-500/30 transition-all duration-300 flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h3 class="text-xs font-semibold text-neutral-400 uppercase tracking-wider group-hover:text-green-400 transition-colors">Resolved Reports</h3>
|
<h3
|
||||||
|
class="text-xs font-semibold text-neutral-400 uppercase tracking-wider group-hover:text-green-400 transition-colors">
|
||||||
|
Resolved Reports</h3>
|
||||||
<p class="text-2xl font-bold text-white mt-1"><?= $resolvedReports ?></p>
|
<p class="text-2xl font-bold text-white mt-1"><?= $resolvedReports ?></p>
|
||||||
<p class="text-[10px] text-neutral-500 mt-1">Successfully closed</p>
|
<p class="text-[10px] text-neutral-500 mt-1">Successfully closed</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-3 bg-green-500/10 rounded-lg group-hover:bg-green-500/20 transition-colors">
|
<div class="p-3 bg-green-500/10 rounded-lg group-hover:bg-green-500/20 transition-colors">
|
||||||
<svg class="w-6 h-6 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg class="w-6 h-6 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||||
|
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -113,8 +127,10 @@ if (!function_exists('time_elapsed_string')) {
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="px-4 py-3 hover:bg-neutral-700/30 transition-colors flex items-center gap-3">
|
<div class="px-4 py-3 hover:bg-neutral-700/30 transition-colors flex items-center gap-3">
|
||||||
<div class="flex-shrink-0 w-8 h-8 rounded-full bg-<?= $statusColor ?>-500/10 border border-<?= $statusColor ?>-500/20 flex items-center justify-center">
|
<div
|
||||||
<svg class="w-4 h-4 text-<?= $statusColor ?>-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
class="flex-shrink-0 w-8 h-8 rounded-full bg-<?= $statusColor ?>-500/10 border border-<?= $statusColor ?>-500/20 flex items-center justify-center">
|
||||||
|
<svg class="w-4 h-4 text-<?= $statusColor ?>-500" fill="none" stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="<?= $iconPath ?>" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="<?= $iconPath ?>" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
@@ -122,7 +138,8 @@ if (!function_exists('time_elapsed_string')) {
|
|||||||
<div class="flex-1 min-w-0 grid gap-0.5">
|
<div class="flex-1 min-w-0 grid gap-0.5">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<p class="text-sm font-medium text-neutral-200 truncate">
|
<p class="text-sm font-medium text-neutral-200 truncate">
|
||||||
Issue <span class="text-white">#<?= $row['id'] ?></span> <?= htmlspecialchars($row['status']) ?>
|
Issue <span class="text-white">#<?= $row['id'] ?></span>
|
||||||
|
<?= htmlspecialchars($row['status']) ?>
|
||||||
</p>
|
</p>
|
||||||
<span class="text-[10px] text-neutral-400 whitespace-nowrap">
|
<span class="text-[10px] text-neutral-400 whitespace-nowrap">
|
||||||
<?= time_elapsed_string($row['updated_at']) ?>
|
<?= time_elapsed_string($row['updated_at']) ?>
|
||||||
|
|||||||
@@ -404,6 +404,7 @@ $result = $conn->query($sql);
|
|||||||
<option value="Furniture & Fixtures Issue">Furniture & Fixtures Issue</option>
|
<option value="Furniture & Fixtures Issue">Furniture & Fixtures Issue</option>
|
||||||
<option value="Library & Study Issue">Library & Study Issue</option>
|
<option value="Library & Study Issue">Library & Study Issue</option>
|
||||||
<option value="Lost & Stolen Issue">Lost & Stolen Issue</option>
|
<option value="Lost & Stolen Issue">Lost & Stolen Issue</option>
|
||||||
|
<option value="Medical/Health Issue">Medical & Health Issue</option>
|
||||||
<option value="Other Issue">Other Issue</option>
|
<option value="Other Issue">Other Issue</option>
|
||||||
</select>
|
</select>
|
||||||
<svg class="absolute right-3 top-3 h-4 w-4 text-neutral-500 pointer-events-none"
|
<svg class="absolute right-3 top-3 h-4 w-4 text-neutral-500 pointer-events-none"
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ function getDepartmentEmail($category)
|
|||||||
case 'Library & Study Issue':
|
case 'Library & Study Issue':
|
||||||
return LIBRARY_EMAIL;
|
return LIBRARY_EMAIL;
|
||||||
|
|
||||||
|
case 'Medical/Health Issue':
|
||||||
|
return HEALTH_EMAIL;
|
||||||
|
|
||||||
case 'Other Issue':
|
case 'Other Issue':
|
||||||
default:
|
default:
|
||||||
return IT_HELPDESK_EMAIL;
|
return IT_HELPDESK_EMAIL;
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ if (isset($_GET['code'])) {
|
|||||||
Need Help? Checkout Github Docs</a>
|
Need Help? Checkout Github Docs</a>
|
||||||
<span class="w-px h-3 bg-slate-800"></span>
|
<span class="w-px h-3 bg-slate-800"></span>
|
||||||
<span
|
<span
|
||||||
class="text-xs font-bold text-blue-400 bg-blue-500/10 px-2 py-0.5 rounded-full border border-blue-500/20">v1.3.2</span>
|
class="text-xs font-bold text-blue-400 bg-blue-500/10 px-2 py-0.5 rounded-full border border-blue-500/20">v1.3.3</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
|
|||||||
Reference in New Issue
Block a user