FEAT_EMP_TABLE_VIA_AJAX, FIX_MAIL_TEMPLATE_IN_CLAIMS

This commit is contained in:
Srinivas-Saravanan 2025-01-31 18:08:24 +05:30
parent d537185d22
commit 491f3e0010
3 changed files with 30 additions and 19 deletions

View File

@ -97,7 +97,7 @@ class EmployeeController extends AdminController
// Convert the status field to an array if it exists in the request data // Convert the status field to an array if it exists in the request data
if (isset($filterData['status']) && !empty($filterData['status'])) { if (isset($filterData['status']) && !empty($filterData['status'])) {
$filterData['status'] = explode(",", $filterData['status']); // $filterData['status'] = explode(",", $filterData['status']);
}else{ }else{
$filterData['status'] = []; $filterData['status'] = [];
} }
@ -114,6 +114,11 @@ class EmployeeController extends AdminController
// log_message('error',json_encode($data['employees'])); // log_message('error',json_encode($data['employees']));
// Set getData in $data array with the processed $filterData // Set getData in $data array with the processed $filterData
$data['getData'] = $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()); // dd($this->employeeModel->getLastQuery());

View File

@ -135,8 +135,9 @@ table.dataTable tbody td {
<?php include('employee_data_list.php');?> <?php // include('employee_data_list.php');?>
<div id="employee_table_list"></div>
<!-- end row --> <!-- end row -->
<div id="loader" class="loader" style="display:none;">SPINNER</div> <div id="loader" class="loader" style="display:none;">SPINNER</div>
@ -502,24 +503,29 @@ function fetchEmpolyeeList(event) {
const queryString = objectToQueryString(queryParams); const queryString = objectToQueryString(queryParams);
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString; const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
// console.log(apiURL); // console.log(apiURL);
window.location.href = apiURL; // window.location.href = apiURL;
// var apiURL2 = $('#get-emp-list').attr('href'); // Get href attribute value // var apiURL2 = $('#get-emp-list').attr('href'); // Get href attribute value
// console.log(apiURL); console.log(apiURL);
// $.ajax({ $.ajax({
// url: apiURL, url: apiURL,
// method: 'GET', method: 'GET',
// data: queryParams, data: queryParams,
// success: function(response) { success: function(response) {
// // Assuming response is a JSON array if(response.status == true){
// // displayDataTables(response); $('.loader').fadeIn();
// console.log(response); $('.loader-mask').fadeIn();
// }, $('#employee_table_list').html(response.html);
// error: function(xhr, status, error) { $('.loader').fadeOut();
// console.error('Error:', error); $('.loader-mask').delay(350).fadeOut('slow');
// } }
// }); },
error: function(xhr, status, error) {
console.error('Error:', error);
toastr.error('Failed to fetch Data','Error');
}
});
} }

View File

@ -191,10 +191,10 @@ table.dataTable tbody td {
<select id="ticket_mail_customButton" class="form-control" <select id="ticket_mail_customButton" class="form-control"
style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;"> style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;">
<option value="">PlaceHolders</option> <option value="">PlaceHolders</option>
<?php foreach ($placeHolders as $value): ?> <?php foreach ($placeHolders as $key => $value): ?>
<?php // if($value == 'member_name' || $value == 'member_mobile' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name'){ ?>member_mobile <?php // if($value == 'member_name' || $value == 'member_mobile' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name'){ ?>member_mobile
<?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?> <?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?>
<option value="((<?php echo $value; ?>))"><?php echo $valueChange; ?> <option value="<?php echo $key; ?>"><?php echo $valueChange; ?></option>
</option> </option>
<?php //} ?> <?php //} ?>
<?php endforeach; ?> <?php endforeach; ?>