Final 1
This commit is contained in:
parent
f1dff12888
commit
b471fc9c7f
13
assets/css/status-colors.css
Normal file
13
assets/css/status-colors.css
Normal file
@ -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; }
|
||||
17
header.php
17
header.php
@ -15,6 +15,7 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="assets/css/status-colors.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="assets/css/dark-mode.css?v=<?php echo time(); ?>">
|
||||
</head>
|
||||
<body>
|
||||
@ -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) {
|
||||
|
||||
17
index.php
17
index.php
@ -1,4 +1,11 @@
|
||||
<?php require_once 'header.php'; ?>
|
||||
<?php require_once 'header.php';
|
||||
|
||||
function get_status_class($status) {
|
||||
$status_class = 'status-' . strtolower(str_replace(' ', '-', str_replace('/', '-', $status)));
|
||||
return $status_class;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<ul class="nav nav-tabs mb-3">
|
||||
<?php foreach ($categories as $category): ?>
|
||||
@ -31,10 +38,10 @@
|
||||
<th>Case Number</th>
|
||||
<?php endif; ?>
|
||||
<?php if ($page === 'Local Grievances'): ?>
|
||||
<th>Timeframes</th>
|
||||
<th><a href="index.php?page=<?php echo urlencode($page); ?>&sort=timeframes&order=<?php echo ($sort_column === 'timeframes' && $sort_order === 'asc') ? 'desc' : 'asc'; ?>">Timeframes</a></th>
|
||||
<?php endif; ?>
|
||||
<th>Status</th>
|
||||
<th>Last Updated</th>
|
||||
<th><a href="index.php?page=<?php echo urlencode($page); ?>&sort=status&order=<?php echo ($sort_column === 'status' && $sort_order === 'asc') ? 'desc' : 'asc'; ?>">Status</a></th>
|
||||
<th><a href="index.php?page=<?php echo urlencode($page); ?>&sort=last_updated&order=<?php echo ($sort_column === 'last_updated' && $sort_order === 'asc') ? 'desc' : 'asc'; ?>">Last Updated</a></th>
|
||||
<th>Union Representative</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
@ -56,7 +63,7 @@
|
||||
<?php if ($page === 'Local Grievances'): ?>
|
||||
<td><input type="date" class="form-control"></td>
|
||||
<?php endif; ?>
|
||||
<td><span class="badge bg-info text-dark"><?php echo htmlspecialchars($grievance['status']); ?></span></td>
|
||||
<td><span class="badge <?php echo get_status_class(htmlspecialchars($grievance['status'])); ?>"><?php echo htmlspecialchars($grievance['status']); ?></span></td>
|
||||
<td><?php echo date("m/d/Y h:i A", strtotime($grievance['last_updated'])); ?></td>
|
||||
<td><?php echo htmlspecialchars($grievance['union_representative']); ?></td>
|
||||
<td class="d-flex gap-2">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user