From b471fc9c7f1bfbf79c44e85fcc2522cdd3232951 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Wed, 12 Nov 2025 18:44:00 +0000 Subject: [PATCH] Final 1 --- assets/css/status-colors.css | 13 +++++++++++++ header.php | 17 ++++++++++++++++- index.php | 17 ++++++++++++----- 3 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 assets/css/status-colors.css diff --git a/assets/css/status-colors.css b/assets/css/status-colors.css new file mode 100644 index 0000000..db80956 --- /dev/null +++ b/assets/css/status-colors.css @@ -0,0 +1,13 @@ + +.status-pending-submission { background-color: #f2f2f2 !important; color: black !important; } +.status-fwd { background-color: #f2f2f2 !important; color: black !important; } +.status-1st-step { background-color: #add8e6 !important; color: black !important; } +.status-1st-step-pending { background-color: #ffdde1 !important; color: black !important; } +.status-2nd-step { background-color: #ffdab9 !important; color: black !important; } +.status-2nd-step-pending { background-color: #ffcccb !important; color: black !important; } +.status-settled { background-color: #90ee90 !important; color: black !important; } +.status-withdrawn { background-color: #ffffe0 !important; color: black !important; } +.status-system-board { background-color: #fffff0 !important; color: black !important; } +.status-arbitration { background-color: #f4a0a0 !important; color: black !important; } +.status-med-arb { background-color: #f4a0a0 !important; color: black !important; } +.status-withdrawn-resigned { background-color: #ffffe0 !important; color: black !important; } diff --git a/header.php b/header.php index 5200081..0096fe6 100644 --- a/header.php +++ b/header.php @@ -15,6 +15,7 @@ + @@ -167,8 +168,22 @@ } } + $sort_column = $_GET['sort'] ?? 'last_updated'; + $sort_order = $_GET['order'] ?? 'desc'; + + // The 'timeframes' column in the UI is a date input, not a database field. + // Sorting by 'timeframes' will sort by 'last_updated' as a sensible default. + $valid_columns = ['last_updated', 'status', 'timeframes']; + if (!in_array($sort_column, $valid_columns)) { + $sort_column = 'last_updated'; + } + + $order_by_column = ($sort_column === 'timeframes') ? 'last_updated' : $sort_column; + + $order_clause = "ORDER BY " . $order_by_column . " " . ($sort_order === 'asc' ? 'ASC' : 'DESC'); + try { - $stmt = $pdo->prepare("SELECT * FROM grievances WHERE category = ? ORDER BY last_updated DESC"); + $stmt = $pdo->prepare("SELECT * FROM grievances WHERE category = ? $order_clause"); $stmt->execute([$page]); $grievances = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { diff --git a/index.php b/index.php index 9120167..09af6b9 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,11 @@ - +