diff --git a/assets/css/dark-mode.css b/assets/css/dark-mode.css index 2ba1049..9714af7 100644 --- a/assets/css/dark-mode.css +++ b/assets/css/dark-mode.css @@ -1,6 +1,6 @@ body.dark-mode { - background-color: #121212; - color: #e0e0e0; + background-color: #2c2c2c; /* Dark grey background */ + color: #ffffff; /* White text */ } body.dark-mode .header { @@ -8,53 +8,47 @@ body.dark-mode .header { border-bottom: 1px solid #333; } -body.dark-mode .card { - background-color: #1e1e1e; - border: 1px solid #333; +/* Make header link white */ +body.dark-mode .header a, body.dark-mode .header a:hover, body.dark-mode a.text-dark, body.dark-mode a.text-dark:hover { + color: #ffffff !important; } -body.dark-mode .modal-content { - background-color: #1e1e1e; - border: 1px solid #333; -} +body.dark-mode .card, +body.dark-mode .modal-content, body.dark-mode .footer { - background-color: #1e1e1e; - border-top: 1px solid #333; + background-color: #3a3a3a; /* Lighter grey for cards */ + border: 1px solid #444; } body.dark-mode .table { - background-color: #1e1e1e; - color: #e0e0e0; + background-color: #3a3a3a; /* Lighter grey for tables */ + color: #ffffff; } body.dark-mode .table-light { - background-color: #333; - color: #e0e0e0; + background-color: #4a4a4a; /* Slightly lighter grey for table header */ + color: #ffffff; } body.dark-mode .nav-tabs .nav-link { - color: #e0e0e0; - border: 1px solid #333; + color: #ffffff; + border: 1px solid #444; } body.dark-mode .nav-tabs .nav-link.active { - background-color: #333; - border-color: #333; -} - -body.dark-mode .form-control { - background-color: #333; - color: #e0e0e0; - border: 1px solid #555; + background-color: #4a4a4a; + border-color: #4a4a4a; } +body.dark-mode .form-control, body.dark-mode .form-select { - background-color: #333; - color: #e0e0e0; - border: 1px solid #555; + background-color: #4a4a4a; + color: #ffffff; + border: 1px solid #666; } +/* Keep button colors for visibility */ body.dark-mode .btn-primary { background-color: #0d6efd; border-color: #0d6efd; @@ -71,8 +65,8 @@ body.dark-mode .btn-outline-primary:hover { } body.dark-mode .btn-outline-secondary { - color: #6c757d; - border-color: #6c757d; + color: #8e959c; + border-color: #8e959c; } body.dark-mode .btn-outline-secondary:hover { @@ -91,10 +85,15 @@ body.dark-mode .btn-outline-info:hover { } body.dark-mode .text-muted { - color: #aaa !important; + color: #ccc !important; } body.dark-mode .badge.bg-info { background-color: #0dcaf0 !important; color: #000 !important; } + +/* Override for table header links */ +body.dark-mode .table-light a { + color: #ffffff !important; +} \ No newline at end of file diff --git a/delete_grievance.php b/delete_grievance.php new file mode 100644 index 0000000..4dbd4a8 --- /dev/null +++ b/delete_grievance.php @@ -0,0 +1,31 @@ +prepare("DELETE FROM grievance_updates WHERE grievance_id = ?"); + $stmt->execute([$grievance_id]); + + $stmt = $pdo->prepare("DELETE FROM grievances WHERE id = ?"); + $stmt->execute([$grievance_id]); + + header("Location: index.php"); + exit(); + } catch (PDOException $e) { + // Handle database errors + error_log("Database error: " . $e->getMessage()); + // You might want to show an error message to the user + header("Location: index.php?error=deletion_failed"); + exit(); + } +} else { + // Redirect if accessed directly or without a grievance_id + header("Location: index.php"); + exit(); +} +?> \ No newline at end of file diff --git a/footer.php b/footer.php index fc6fb5e..d55957d 100644 --- a/footer.php +++ b/footer.php @@ -12,21 +12,29 @@ const darkModeToggle = document.getElementById('darkModeToggle'); const body = document.body; - // Check for saved dark mode preference - if (localStorage.getItem('darkMode') === 'enabled') { - body.classList.add('dark-mode'); - darkModeToggle.checked = true; - } - - darkModeToggle.addEventListener('change', function () { - if (this.checked) { + // Function to apply dark mode based on toggle state + function applyDarkMode() { + if (darkModeToggle.checked) { body.classList.add('dark-mode'); localStorage.setItem('darkMode', 'enabled'); } else { body.classList.remove('dark-mode'); localStorage.setItem('darkMode', 'disabled'); } - }); + } + + // Check for saved dark mode preference and set toggle accordingly + if (localStorage.getItem('darkMode') === 'enabled') { + darkModeToggle.checked = true; + } else if (localStorage.getItem('darkMode') === 'disabled') { + darkModeToggle.checked = false; + } + + // Apply dark mode on initial load + applyDarkMode(); + + // Listener for toggle changes + darkModeToggle.addEventListener('change', applyDarkMode); var editGrievanceModal = document.getElementById('editGrievanceModal'); if (editGrievanceModal) { @@ -61,6 +69,16 @@ } }); } + + var deleteGrievanceModal = document.getElementById('deleteGrievanceModal'); + if (deleteGrievanceModal) { + deleteGrievanceModal.addEventListener('show.bs.modal', function (event) { + var button = event.relatedTarget; + var id = button.getAttribute('data-id'); + var modal = this; + modal.querySelector('#delete_grievance_id').value = id; + }); + } }); diff --git a/header.php b/header.php index 26ee6dd..9ee4099 100644 --- a/header.php +++ b/header.php @@ -210,11 +210,11 @@
-

TWU Local 555 BNA Ramp Grievance Tracker

+

TWU Local 555 BNA Ramp Grievance Tracker

A simple tool to track and manage ramp grievances.

- +
diff --git a/index.php b/index.php index 09af6b9..510a650 100644 --- a/index.php +++ b/index.php @@ -7,144 +7,158 @@ function get_status_class($status) { ?> -
+
+
+ +
-
-
-

-
- - - - - - - - - - - - - - - - - - - - +
+
+

+
+
Grievant NameDisciplineSubjectCase NumberTimeframesStatusLast UpdatedUnion RepresentativeActions
+ - + + + + + + + + + + + + + - - + + + - - - - - - - - - - - - - + - - + + + + + + + + + + + + + - - - - -
No grievances found in this category.Grievant NameDisciplineSubjectCase NumberTimeframesStatusLast UpdatedUnion RepresentativeActions
-
- - - - -
- - -
No grievances found in this category.
-
-
Updates
- prepare("SELECT * FROM grievance_updates WHERE grievance_id = ? ORDER BY created_at DESC"); - $update_stmt->execute([$grievance['id']]); - $updates = $update_stmt->fetchAll(PDO::FETCH_ASSOC); - ?> - -

No updates for this grievance yet.

- -
    - -
  • -

    - By on -
  • - -
- - -
- + + +
+ + -
- - -
-
- - -
- + + - -
+ + + + + + + +
+
Updates
+ prepare("SELECT * FROM grievance_updates WHERE grievance_id = ? ORDER BY created_at DESC"); + $update_stmt->execute([$grievance['id']]); + $updates = $update_stmt->fetchAll(PDO::FETCH_ASSOC); + ?> + +

No updates for this grievance yet.

+ +
    + +
  • +

    + By on +
  • + +
+ + +
+ + +
+ + +
+
+ + +
+ +
+
+ + + + + + +
+ + + @@ -247,4 +261,26 @@ function get_status_class($status) { - + + + + \ No newline at end of file