MERGE_TEST_BUG_FIXES
This commit is contained in:
commit
9599619962
@ -808,13 +808,17 @@ class EmployeeRestController extends AdminController
|
|||||||
$policyName = preg_replace('/[^A-Za-z0-9_\- ]/', '', (string) ($empData[0]['policy_name'] ?? 'Employees'));
|
$policyName = preg_replace('/[^A-Za-z0-9_\- ]/', '', (string) ($empData[0]['policy_name'] ?? 'Employees'));
|
||||||
$filename = trim($policyName) !== '' ? $policyName . '-Employees.xlsx' : 'Employees.xlsx';
|
$filename = trim($policyName) !== '' ? $policyName . '-Employees.xlsx' : 'Employees.xlsx';
|
||||||
|
|
||||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
// Return via CI Response (no header()/exit) so global Cors after-filter can attach ACAO headers.
|
||||||
header('Content-Disposition: attachment;filename="' . $filename . '"');
|
|
||||||
header('Cache-Control: max-age=0');
|
|
||||||
|
|
||||||
$writer = new Xlsx($spreadsheet);
|
$writer = new Xlsx($spreadsheet);
|
||||||
|
ob_start();
|
||||||
$writer->save('php://output');
|
$writer->save('php://output');
|
||||||
exit;
|
$content = ob_get_clean();
|
||||||
|
|
||||||
|
return $this->response
|
||||||
|
->setHeader('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
|
||||||
|
->setHeader('Content-Disposition', 'attachment;filename="' . $filename . '"')
|
||||||
|
->setHeader('Cache-Control', 'max-age=0')
|
||||||
|
->setBody($content);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->respond(['status' => 'failed', 'code' => 500, 'data' => $e->getMessage()], 500);
|
return $this->respond(['status' => 'failed', 'code' => 500, 'data' => $e->getMessage()], 500);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@
|
|||||||
margin-left: 8px !important;
|
margin-left: 8px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php foreach ($hr_access_data as $key => $value) {
|
<?php foreach ($hr_access_data ?? [] as $key => $value) {
|
||||||
$key = $key + 1;
|
$key = $key + 1;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@ -207,7 +207,7 @@
|
|||||||
<label>Select all In-Active policies</label>
|
<label>Select all In-Active policies</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php foreach ($pre_policy_data as $key1 => $policies) {
|
<?php foreach ($pre_policy_data ?? [] as $key1 => $policies) {
|
||||||
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
|
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
|
||||||
$statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive';
|
$statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive';
|
||||||
// if (
|
// if (
|
||||||
@ -272,7 +272,7 @@
|
|||||||
<label>Select all In-Active policies</label>
|
<label>Select all In-Active policies</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php foreach ($post_policy_data as $key2 => $policies) {
|
<?php foreach ($post_policy_data ?? [] as $key2 => $policies) {
|
||||||
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
|
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
|
||||||
$statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive';
|
$statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive';
|
||||||
// if(
|
// if(
|
||||||
@ -334,7 +334,7 @@
|
|||||||
<label>Select all</label>
|
<label>Select all</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php foreach ($post_cd_data as $key3 => $cd) { ?>
|
<?php foreach ($post_cd_data ?? [] as $key3 => $cd) { ?>
|
||||||
<div class="checkbox-item">
|
<div class="checkbox-item">
|
||||||
<input type="checkbox" class="policy-checkbox" data-user="<?= $key ?>" data-group="cd" id="<?= 'user' . $key ?>-icici1" name="<?= 'user' . $key ?>_cd" value="<?= $cd['cd_master_pk'] ?>" <?php if (in_array($cd['cd_master_pk'], $value['allowed_cd'])) {
|
<input type="checkbox" class="policy-checkbox" data-user="<?= $key ?>" data-group="cd" id="<?= 'user' . $key ?>-icici1" name="<?= 'user' . $key ?>_cd" value="<?= $cd['cd_master_pk'] ?>" <?php if (in_array($cd['cd_master_pk'], $value['allowed_cd'])) {
|
||||||
echo 'checked';
|
echo 'checked';
|
||||||
|
|||||||
@ -44,6 +44,21 @@ table.dataTable tbody td {
|
|||||||
box-shadow: 0px 2px 4px 0px #00000024 !important;
|
box-shadow: 0px 2px 4px 0px #00000024 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#scroll-horizontal-datatable_wrapper #hrActivityExcelBtn,
|
||||||
|
#scroll-horizontal-datatable_wrapper .hr-activity-excel-btn {
|
||||||
|
background-color: #217346 !important;
|
||||||
|
color: white !important;
|
||||||
|
border: 1px solid #217346 !important;
|
||||||
|
padding: 5px 10px !important;
|
||||||
|
border-radius: 10px !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
box-shadow: 0px 2px 4px 0px #00000024 !important;
|
||||||
|
margin-left: 8px !important;
|
||||||
|
display: inline-flex !important;
|
||||||
|
align-items: center !important;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
#hr_activity_history_append_area tbody tr {
|
#hr_activity_history_append_area tbody tr {
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
@ -151,6 +166,35 @@ $(document).ready(function () {
|
|||||||
action: function () {
|
action: function () {
|
||||||
appendHrActivityHistoryHtml(this, true);
|
appendHrActivityHistoryHtml(this, true);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'excelHtml5',
|
||||||
|
text: '<i class="mdi mdi-file-excel"></i><span class="btn-custom"> Excel</span>',
|
||||||
|
title: 'HR-Activity',
|
||||||
|
filename: function () {
|
||||||
|
return 'HR-Activity-' + (typeof moment !== 'undefined' ? moment().format('DD-MM-YYYY') : 'export');
|
||||||
|
},
|
||||||
|
sheetName: 'HR-Activity',
|
||||||
|
className: 'btn hr-activity-excel-btn',
|
||||||
|
attr: {
|
||||||
|
id: 'hrActivityExcelBtn',
|
||||||
|
title: 'Export HR Activity to Excel'
|
||||||
|
},
|
||||||
|
exportOptions: {
|
||||||
|
columns: [0, 1, 2, 3, 4]
|
||||||
|
},
|
||||||
|
action: function (e, dt, button, config) {
|
||||||
|
if (!dt.data().any()) {
|
||||||
|
if (typeof toastr !== 'undefined' && toastr.warning) {
|
||||||
|
toastr.warning('No data available to export.', 'Warning');
|
||||||
|
} else {
|
||||||
|
alert('No data available to export.');
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Use DataTables built-in excelHtml5 action
|
||||||
|
$.fn.dataTable.ext.buttons.excelHtml5.action.call(this, e, dt, button, config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user