From a4cf69362a597cf4bc43939f57f3755cb836ecf7 Mon Sep 17 00:00:00 2001 From: velz Date: Mon, 27 May 2024 17:38:12 +0530 Subject: [PATCH] FEAT_RACK_RATE_EXCEL_UPLOAD --- app/Controllers/EmployeeServiceController.php | 5 +- app/Views/policy_grid.php | 27 +- app/Views/policy_grid_excel.php | 241 ++++++++++++++++++ 3 files changed, 269 insertions(+), 4 deletions(-) create mode 100644 app/Views/policy_grid_excel.php diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php index b90790d4..63a240d1 100644 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -1119,10 +1119,11 @@ class EmployeeServiceController extends AdminController public function getFileMetaDataByFileId($file_id, $status = 'success'){ $data = $this->fileModel - ->select('files.*, clients.client_name, clients.short_name, policies.name as policy_name') + ->select('files.*, clients.client_name, clients.short_name, policies.name as policy_name,client_branch.branch_code') ->join('clients', 'clients.id = files.client_id') ->join('client_policy', 'client_policy.id = files.policy_id') ->join('policies', 'policies.id = client_policy.policy_id') + ->join('client_branch', 'client_branch.id = files.client_branch_id') ->where('files.id', $file_id) ->first(); @@ -1135,7 +1136,7 @@ class EmployeeServiceController extends AdminController $msg_title = 'File Upload Failure'; } - $msg_txt = $data['client_name'] . ' - ' . $data['policy_name'] . ' - ' . ucfirst($data['action']); + $msg_txt = $data['client_name'] . ' ('.$data['branch_code'].') - ' . $data['policy_name'] . ' - ' . ucfirst($data['action']); $user_id = $data['created_by']; $url = 'employee/upload'; diff --git a/app/Views/policy_grid.php b/app/Views/policy_grid.php index 9482c63b..bee2b626 100644 --- a/app/Views/policy_grid.php +++ b/app/Views/policy_grid.php @@ -38,10 +38,13 @@ - + Copy from excel
-
+
+
+
@@ -71,6 +74,26 @@ $('.close').click(function() { } }); +$('#copyfromexcel').click(function(){ + // alert('called'); + // $('#copyfromexcel').toggle(); + // $("#copied_excel_data").val(result.exampleMessage); + $('#copied_excel_data').val(""); + if ($(this).text() == "Copy from excel") + { + $(this).text("Manual entry") + + } + else{ + $(this).text("Copy from excel"); + } + + $('#grid_content_input').toggle(); + $('#grid_content_from_excel').toggle(); + + + +}); function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = false) { diff --git a/app/Views/policy_grid_excel.php b/app/Views/policy_grid_excel.php new file mode 100644 index 00000000..50487a0a --- /dev/null +++ b/app/Views/policy_grid_excel.php @@ -0,0 +1,241 @@ + + +
+ + +

Paste excel data here: Copy Excel Headers

+
+ + +
+
+ +
+
+ +

+

JSON output:

+
+
+ + +