From 2cf9201337ad0b3901347e8419da1082c83e4433 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 31 Jul 2024 15:13:32 +0530 Subject: [PATCH] FIX_ENROLL_LIST : RV --- app/Views/enrollment_list.php | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/app/Views/enrollment_list.php b/app/Views/enrollment_list.php index 48104451..67d6e5bf 100644 --- a/app/Views/enrollment_list.php +++ b/app/Views/enrollment_list.php @@ -269,8 +269,12 @@ var client_id = $('#clients').val(); var branch_id = $('#branch_id').val(); if (client_id == '0' || branch_id == '0') { - alert('Please select values in both dropdowns.'); - return; + Swal.fire({ + title: "warning!", + text: 'Please select the Client and Client Branch.', + icon: "warning" + }); + return false; } $.ajax({ @@ -280,7 +284,15 @@ "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" }, + beforeSend: function() { + $('.loader').fadeIn(); + $('.loader-mask').fadeIn(); + }, success: function(response) { + + $('.loader').fadeOut(); + $('.loader-mask').delay(350).fadeOut('slow'); + var data = JSON.parse(response); console.log(data); var table = $('#tickets-table').DataTable(); @@ -340,7 +352,10 @@ }, error: function(xhr, status, error) { - console.error('Error fetching data from API:', error); + console.error(xhr.responseText); + console.error(status, error); + $('.loader').fadeOut(); + $('.loader-mask').delay(350).fadeOut('slow'); } }); } @@ -534,7 +549,12 @@ console.log('client_branch_id', client_branch_id); if(client_id == 0 && client_branch_id == 0){ - + + Swal.fire({ + title: "warning!", + text: 'Please select the Client and Client Branch.', + icon: "warning" + }); return false }