diff --git a/resources/views/components/table-component.blade.php b/resources/views/components/table-component.blade.php index 5e86b3b..3be0f05 100644 --- a/resources/views/components/table-component.blade.php +++ b/resources/views/components/table-component.blade.php @@ -11,7 +11,7 @@ 'showViewModal' => false ]) -
+
{{ $pageTitle }}
@@ -81,7 +81,7 @@
-
+ @if ($showEditModal) diff --git a/resources/views/pages/add-notification.blade.php b/resources/views/pages/add-notification.blade.php index 23ab921..f79fed7 100644 --- a/resources/views/pages/add-notification.blade.php +++ b/resources/views/pages/add-notification.blade.php @@ -3,60 +3,97 @@ @section('page_title', 'Add Notification') @section('content') -
-
-
Add Notification
+
+
Add Notification
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+
+ +
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
+ @@ -75,7 +112,7 @@ // Simulate adding notification (frontend-only) const newNotification = { - id: Date.now(), // Unique ID based on timestamp + id: Date.now(), subject: subject, content: content, isScheduled: isScheduled === 'Yes' ? 'Scheduled' : 'Not Scheduled', @@ -83,7 +120,7 @@ expiration: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString().slice(0, 16).replace('T', ' ') }; - // Store in sessionStorage to simulate adding + // Store in sessionStorage let notifications = JSON.parse(sessionStorage.getItem('notifications') || '[]'); notifications.push(newNotification); sessionStorage.setItem('notifications', JSON.stringify(notifications)); @@ -91,5 +128,10 @@ alert('Notification added successfully!'); window.location.href = '/notification'; }); + + // Cancel button click handler + document.querySelector('.btn-outline-secondary').addEventListener('click', function() { + window.location.href = '/notification'; + }); @endsection \ No newline at end of file diff --git a/resources/views/pages/notification.blade.php b/resources/views/pages/notification.blade.php index 85b5117..9fe23ac 100644 --- a/resources/views/pages/notification.blade.php +++ b/resources/views/pages/notification.blade.php @@ -5,38 +5,10 @@ @section('content') @php $notifications = [ - [ - 'id' => 1, - 'subject' => 'Welcome Message', - 'content' => 'Welcome to our platform! Get started today.', - 'isScheduled' => 'Scheduled', - 'schedule' => '2025-04-16 10:00', - 'expiration' => '2025-04-30 23:59' - ], - [ - 'id' => 2, - 'subject' => 'System Update', - 'content' => 'Scheduled maintenance on April 20th.', - 'isScheduled' => 'Scheduled', - 'schedule' => '2025-04-20 02:00', - 'expiration' => '2025-04-21 02:00' - ], - [ - 'id' => 3, - 'subject' => 'Promotion Offer', - 'content' => '50% off your next purchase this week!', - 'isScheduled' => 'Not Scheduled', - 'schedule' => '', - 'expiration' => '2025-04-22 23:59' - ], - [ - 'id' => 4, - 'subject' => 'Account Reminder', - 'content' => 'Please update your profile details.', - 'isScheduled' => 'Scheduled', - 'schedule' => '2025-04-18 09:00', - 'expiration' => '2025-04-25 23:59' - ] + ['id' => 1, 'subject' => 'Welcome Message', 'content' => 'Welcome to our platform! Get started today.', 'isScheduled' => 'Scheduled', 'schedule' => '2025-04-16 10:00', 'expiration' => '2025-04-30 23:59'], + ['id' => 2, 'subject' => 'System Update', 'content' => 'Scheduled maintenance on April 20th.', 'isScheduled' => 'Scheduled', 'schedule' => '2025-04-20 02:00', 'expiration' => '2025-04-21 02:00'], + ['id' => 3, 'subject' => 'Promotion Offer', 'content' => '50% off your next purchase this week!', 'isScheduled' => 'Not Scheduled', 'schedule' => '', 'expiration' => '2025-04-22 23:59'], + ['id' => 4, 'subject' => 'Account Reminder', 'content' => 'Please update your profile details.', 'isScheduled' => 'Scheduled', 'schedule' => '2025-04-18 09:00', 'expiration' => '2025-04-25 23:59'] ]; @endphp @@ -51,7 +23,7 @@ ['name' => 'Schedule', 'key' => 'schedule', 'sortable' => true], ['name' => 'Expiration', 'key' => 'expiration', 'sortable' => true] ], - + 'showAddButton' => true, 'addButtonUrl' => '/add-notification', 'showCheckboxes' => false, @@ -61,7 +33,6 @@ ])