diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 9e81f1a9..050437cd 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -97,7 +97,7 @@ class EmployeeController extends AdminController // Convert the status field to an array if it exists in the request data if (isset($filterData['status']) && !empty($filterData['status'])) { - $filterData['status'] = explode(",", $filterData['status']); + // $filterData['status'] = explode(",", $filterData['status']); }else{ $filterData['status'] = []; } @@ -114,6 +114,11 @@ class EmployeeController extends AdminController // log_message('error',json_encode($data['employees'])); // Set getData in $data array with the processed $filterData $data['getData'] = $filterData; + + // return view('employee_list',$data); + $html = view('employee_data_list', $data); + return $this->respond(['status' => true, 'html' => $html], 200); + } // dd($this->employeeModel->getLastQuery()); diff --git a/app/Views/employee_list.php b/app/Views/employee_list.php index 255d8278..7c35a42d 100755 --- a/app/Views/employee_list.php +++ b/app/Views/employee_list.php @@ -135,8 +135,9 @@ table.dataTable tbody td { - + +
@@ -502,24 +503,29 @@ function fetchEmpolyeeList(event) { const queryString = objectToQueryString(queryParams); const apiURL = $('#get-emp-list').attr('href') + "?" + queryString; // console.log(apiURL); - window.location.href = apiURL; + // window.location.href = apiURL; // var apiURL2 = $('#get-emp-list').attr('href'); // Get href attribute value - // console.log(apiURL); - // $.ajax({ - // url: apiURL, - // method: 'GET', - // data: queryParams, - // success: function(response) { - // // Assuming response is a JSON array - // // displayDataTables(response); - // console.log(response); - // }, - // error: function(xhr, status, error) { - // console.error('Error:', error); - // } - // }); + console.log(apiURL); + $.ajax({ + url: apiURL, + method: 'GET', + data: queryParams, + success: function(response) { + if(response.status == true){ + $('.loader').fadeIn(); + $('.loader-mask').fadeIn(); + $('#employee_table_list').html(response.html); + $('.loader').fadeOut(); + $('.loader-mask').delay(350).fadeOut('slow'); + } + }, + error: function(xhr, status, error) { + console.error('Error:', error); + toastr.error('Failed to fetch Data','Error'); + } + }); } diff --git a/app/Views/ticket_mail_template.php b/app/Views/ticket_mail_template.php index e36b2718..1100e26a 100644 --- a/app/Views/ticket_mail_template.php +++ b/app/Views/ticket_mail_template.php @@ -191,10 +191,10 @@ table.dataTable tbody td {