final 2
This commit is contained in:
parent
b471fc9c7f
commit
b3895068d2
16
header.php
16
header.php
@ -179,8 +179,22 @@
|
||||
}
|
||||
|
||||
$order_by_column = ($sort_column === 'timeframes') ? 'last_updated' : $sort_column;
|
||||
$direction = ($sort_order === 'asc' ? 'ASC' : 'DESC');
|
||||
|
||||
$order_clause = "ORDER BY " . $order_by_column . " " . ($sort_order === 'asc' ? 'ASC' : 'DESC');
|
||||
if ($order_by_column === 'status') {
|
||||
$order_clause = "ORDER BY CASE status
|
||||
WHEN 'Pending Submission' THEN 1
|
||||
WHEN '1st Step' THEN 2
|
||||
WHEN '1st Step Pending' THEN 3
|
||||
WHEN '2nd Step' THEN 4
|
||||
WHEN '2nd Step Pending' THEN 5
|
||||
WHEN 'Settled' THEN 6
|
||||
WHEN 'Withdrawn' THEN 7
|
||||
ELSE 8
|
||||
END " . $direction;
|
||||
} else {
|
||||
$order_clause = "ORDER BY " . $order_by_column . " " . $direction;
|
||||
}
|
||||
|
||||
try {
|
||||
$stmt = $pdo->prepare("SELECT * FROM grievances WHERE category = ? $order_clause");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user