From 30ceb226761ad5845be3cf7a4332df6eb6ec195b Mon Sep 17 00:00:00 2001 From: Venkatesh Date: Thu, 6 Aug 2026 11:57:26 +0530 Subject: [PATCH] CHANGE_ADD_EXCE_EXPORT_OPTION_FOR_HR_ACTIVITY_HISTORY --- app/Views/hr_access_controll.php | 8 +++--- app/Views/hr_activity_history.php | 44 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/app/Views/hr_access_controll.php b/app/Views/hr_access_controll.php index e86a03e3..c1e078fe 100644 --- a/app/Views/hr_access_controll.php +++ b/app/Views/hr_access_controll.php @@ -53,7 +53,7 @@ margin-left: 8px !important; } - $value) { + $value) { $key = $key + 1; ?> @@ -207,7 +207,7 @@ - $policies) { + $policies) { $statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active'; $statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive'; // if ( @@ -272,7 +272,7 @@ - $policies) { + $policies) { $statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active'; $statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive'; // if( @@ -334,7 +334,7 @@ - $cd) { ?> + $cd) { ?>
Excel', + 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); + } } ] });