diff --git a/app/Http/Controllers/Admin/ManageNotificationsController.php b/app/Http/Controllers/Admin/ManageNotificationsController.php
index 7c29cc6..f60bcfe 100644
--- a/app/Http/Controllers/Admin/ManageNotificationsController.php
+++ b/app/Http/Controllers/Admin/ManageNotificationsController.php
@@ -82,7 +82,6 @@ class ManageNotificationsController extends Controller
*/
public function store_notificaton_data(Request $request)
{
- dd($request);
try {
$request->validate([
'image' => 'required|image|mimes:jpeg,png,jpg,gif|max:2048',
diff --git a/database/migrations/2024_05_31_095128_create_notification_details.php b/database/migrations/2024_05_31_095128_create_notification_details.php
index 35b6eba..54468aa 100644
--- a/database/migrations/2024_05_31_095128_create_notification_details.php
+++ b/database/migrations/2024_05_31_095128_create_notification_details.php
@@ -18,6 +18,8 @@ return new class extends Migration
$table->string('type');
$table->longText('description');
$table->string('image')->nullable();
+ $table->boolean('is_schedule')->comment('1=specific time, 0=immediate');
+ $table->dateTime('delivery_schedule');
$table->timestamp('date_added')->useCurrent();
$table->boolean('is_active')->default(1)->comment('1=Active, 0=Expired');
$table->integer('created_by')->nullable();
diff --git a/resources/views/Admin/pages/manage_notification/manage_notifications_add.blade.php b/resources/views/Admin/pages/manage_notification/manage_notifications_add.blade.php
index aea8d0b..1117140 100644
--- a/resources/views/Admin/pages/manage_notification/manage_notifications_add.blade.php
+++ b/resources/views/Admin/pages/manage_notification/manage_notifications_add.blade.php
@@ -200,7 +200,10 @@
image: {
required: true
},
- recipients: {
+ user_type: {
+ required: true
+ },
+ schedule_radio1: {
required: true
}
},
@@ -214,14 +217,19 @@
image: {
required: 'Please upload an image file'
},
- recipients: {
+ user_type: {
required: 'Please select at least one category'
+ },
+ schedule_radio1: {
+ required: 'Please select a delivery schedule'
}
},
errorClass: 'error-message',
errorPlacement: function(error, element) {
if (element.attr("name") == "user_type") {
- error.insertAfter("#select-popular-ids").addClass('error-message');
+ error.insertAfter("#select-ids").addClass('error-message');
+ } else if (element.attr("name") == "schedule_radio1") {
+ error.insertAfter("#push_schedule_radi02").addClass('error-message');
} else {
error.insertAfter(element).addClass('error-message');
}
@@ -273,6 +281,26 @@
});
}
});
+
+
+ $('#push_user_radi01').click(function() {
+ $('.radio-btn-checkbox').hide();
+ $('.radio-btn-checkbox input[type="radio"]').prop('checked', false);
+ });
+
+ $('#push_user_radi02').click(function() {
+ $('.radio-btn-checkbox').show();
+ });
+
+ // Select specific time zone script
+ $('#push_schedule_radi01').click(function() {
+ $('.checkbox-btsss').hide();
+ $('#specificTime').val('');
+ });
+
+ $('#push_schedule_radi02').click(function() {
+ $('.checkbox-btsss').show();
+ });
});
-
@endsection