diff --git a/app/Config/Routes.php b/app/Config/Routes.php index b6cfa39..4a21b1c 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -70,6 +70,7 @@ $routes->group("/client", ["filter" => "authMVC"], function ($routes) { $routes->get('deposit/(:num)', 'ClientController::deposit/$1'); $routes->get('remove/(:num)', 'ClientController::removeClient/$1'); $routes->get("list/(:any)", "ClientController::editClientOnboarding/$1"); + $routes->post('wipe', 'ClientController::wipeDemoClient'); // application/config/routes.php // Add a route for the view_Deposit method @@ -157,6 +158,8 @@ $routes->group("/employee", ["filter" => "authMVC"], function ($routes) { $routes->post("test-rack-rate", "EmployeeController::testRackRate"); $routes->get('test_members_list', 'EmployeeController::test_members_list'); $routes->post('get_emp_history','EmployeeController::getEmpHistory'); + $routes->post('download_inception','EmployeeController::download_inception'); + $routes->get('download_file','EmployeeController::download_file'); }); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index e1523c0..678100a 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -4880,4 +4880,246 @@ class ClientController extends AdminController return $this->respond(['status'=> false,'code'=>404,'message'=>'Mapping Deletion Failed'],200); } } + + // -------------------- DEMO CLIENT FUNCTION -------------------------------------------------------------------------------------------- + + public function wipeDemoClient() + { + $this->myLogger->logme('error', "========================================"); + $this->myLogger->logme('error', "WIPE DEMO CLIENT FUNCTION STARTED"); + $this->myLogger->logme('error', "========================================"); + + $this->myLogger->logme('error', "Request Payload: " . json_encode($this->request->getPost() ?? [])); + $client_id = $this->request->getPost('client_id'); + + if (empty($client_id)) { + $this->myLogger->logme('error', "ERROR: Client ID is required"); + return $this->respond(['status' => false, 'message' => 'Client id required'], 404); + } + + $this->myLogger->logme('error', "Client ID to wipe: " . $client_id); + $this->myLogger->logme('error', "----------------------------------------"); + + // ======================================== + // 1. CLIENT MODEL DELETION + // ======================================== + $this->myLogger->logme('error', "1. PROCESSING CLIENT MODEL"); + $client_data = $this->clientModel->where('id', $client_id)->where('is_active', 1)->first(); + $this->myLogger->logme('error', " Found Client Data: " . json_encode($client_data ?? [])); + + if (!empty($client_data)) { + $is_deleted = $this->clientModel->where('id', $client_id)->delete(); + if ($is_deleted) { + $this->myLogger->logme('error', " ✓ Client data removed successfully"); + } else { + $this->myLogger->logme('error', " ✗ Failed to delete client record"); + } + } else { + $this->myLogger->logme('error', " ✗ Client not found or inactive"); + return $this->respond(['status' => false, 'message' => 'Client not found'], 404); + } + $this->myLogger->logme('error', "----------------------------------------"); + + // ======================================== + // 2. CLIENT RM MODEL DELETION + // ======================================== + $this->myLogger->logme('error', "2. PROCESSING CLIENT RM MODEL"); + $client_rm_data = $this->clientRMModel->where('client_id', $client_id)->first(); + $this->myLogger->logme('error', " Found Client RM Data: " . json_encode($client_rm_data ?? [])); + + if (!empty($client_rm_data)) { + $is_deleted = $this->clientRMModel->where('client_id', $client_id)->delete(); + if ($is_deleted) { + $this->myLogger->logme('error', " ✓ Client RM data removed successfully"); + } else { + $this->myLogger->logme('error', " ✗ Failed to delete Client RM record"); + } + } else { + $this->myLogger->logme('error', " ℹ No Client RM data found"); + } + $this->myLogger->logme('error', "----------------------------------------"); + + // ======================================== + // 3. CLIENT KYC DOCS MODEL DELETION + // ======================================== + $this->myLogger->logme('error', "3. PROCESSING CLIENT KYC DOCS MODEL"); + $client_kyc_data = $this->clientKYCDocsModel->where('client_id', $client_id)->findAll(); + $this->myLogger->logme('error', " Found Client KYC Records: " . count($client_kyc_data ?? [])); + $this->myLogger->logme('error', " Client KYC Data: " . json_encode($client_kyc_data ?? [])); + + if (!empty($client_kyc_data)) { + $is_deleted = $this->clientKYCDocsModel->where('client_id', $client_id)->delete(); + if ($is_deleted) { + $this->myLogger->logme('error', " ✓ Client KYC Docs data removed successfully"); + } else { + $this->myLogger->logme('error', " ✗ Failed to delete Client KYC Docs records"); + } + } else { + $this->myLogger->logme('error', " ℹ No Client KYC Docs data found"); + } + $this->myLogger->logme('error', "----------------------------------------"); + + // ======================================== + // 4. CLIENT BRANCH MODEL DELETION + // ======================================== + $this->myLogger->logme('error', "4. PROCESSING CLIENT BRANCH MODEL"); + $client_branch_data = $this->clientBranchModel->where('client_id', $client_id)->findAll(); + $branch_ids = array_column($client_branch_data, 'id') ?? []; + $this->myLogger->logme('error', " Found Client Branch Records: " . count($client_branch_data ?? [])); + $this->myLogger->logme('error', " Branch IDs: " . json_encode($branch_ids)); + $this->myLogger->logme('error', " Client Branch Data: " . json_encode($client_branch_data ?? [])); + + if (!empty($client_branch_data)) { + $is_deleted = $this->clientBranchModel->where('client_id', $client_id)->delete(); + if ($is_deleted) { + $this->myLogger->logme('error', " ✓ Client Branch data removed successfully"); + + // Delete related Level Contact data + if (!empty($branch_ids)) { + $this->myLogger->logme('error', " 4a. PROCESSING RELATED LEVEL CONTACT DATA"); + $level_contact_data = $this->levelContactModel->where('contact_type', 'client')->whereIn('ref_id', $branch_ids)->findAll(); + $this->myLogger->logme('error', " Found Level Contact Records: " . count($level_contact_data ?? [])); + $this->myLogger->logme('error', " Level Contact Data: " . json_encode($level_contact_data ?? [])); + + $is_deleted = $this->levelContactModel->where('contact_type', 'client')->whereIn('ref_id', $branch_ids)->delete(); + if ($is_deleted) { + $this->myLogger->logme('error', " ✓ Level Contact data removed successfully"); + } else { + $this->myLogger->logme('error', " ✗ Failed to delete Level Contact records"); + } + } else { + $this->myLogger->logme('error', " ℹ No Branch IDs available for Level Contact deletion"); + } + } else { + $this->myLogger->logme('error', " ✗ Failed to delete Client Branch records"); + } + } else { + $this->myLogger->logme('error', " ℹ No Client Branch data found"); + } + $this->myLogger->logme('error', "----------------------------------------"); + + // ======================================== + // 5. CLIENT POLICY MODEL DELETION + // ======================================== + $this->myLogger->logme('error', "5. PROCESSING CLIENT POLICY MODEL"); + $client_policy_data = $this->clientPolicyModel->where('client_id', $client_id)->findAll(); + $policy_ids = array_column($client_policy_data, 'id') ?? []; + $this->myLogger->logme('error', " Found Client Policy Records: " . count($client_policy_data ?? [])); + $this->myLogger->logme('error', " Policy IDs: " . json_encode($policy_ids)); + $this->myLogger->logme('error', " Client Policy Data: " . json_encode($client_policy_data ?? [])); + + if (!empty($client_policy_data)) { + $is_deleted = $this->clientPolicyModel->where('client_id', $client_id)->delete(); + if ($is_deleted) { + $this->myLogger->logme('error', " ✓ Client Policy data removed successfully"); + + // Delete related Employee Policy data + if (!empty($policy_ids)) { + $this->myLogger->logme('error', " 5a. PROCESSING RELATED EMPLOYEE POLICY DATA"); + $employee_policy_data = $this->employeePolicyModel->whereIn('client_policy_id', $policy_ids)->findAll(); + $this->myLogger->logme('error', " Found Employee Policy Records: " . count($employee_policy_data ?? [])); + + $is_deleted = $this->employeePolicyModel->whereIn('client_policy_id', $policy_ids)->delete(); + if ($is_deleted) { + $this->myLogger->logme('error', " ✓ Employee Policy data removed successfully"); + } else { + $this->myLogger->logme('error', " ✗ Failed to delete Employee Policy records"); + } + } else { + $this->myLogger->logme('error', " ℹ No Policy IDs available for Employee Policy deletion"); + } + } else { + $this->myLogger->logme('error', " ✗ Failed to delete Client Policy records"); + } + } else { + $this->myLogger->logme('error', " ℹ No Client Policy data found"); + } + $this->myLogger->logme('error', "----------------------------------------"); + + // ======================================== + // 6. EMPLOYEE MODEL DELETION + // ======================================== + $this->myLogger->logme('error', "6. PROCESSING EMPLOYEE MODEL"); + $employee_data = $this->employeeModel->where('client_id', $client_id)->findAll(); + $this->myLogger->logme('error', " Found Employee Records: " . count($employee_data ?? [])); + + if (!empty($employee_data)) { + $is_deleted = $this->employeeModel->where('client_id', $client_id)->delete(); + if ($is_deleted) { + $this->myLogger->logme('error', " ✓ Employee data removed successfully"); + } else { + $this->myLogger->logme('error', " ✗ Failed to delete Employee records"); + } + } else { + $this->myLogger->logme('error', " ℹ No Employee data found"); + } + $this->myLogger->logme('error', "----------------------------------------"); + + + // ======================================== + // 7. POLICY PREMIUM 1 MODEL DELETION + // ======================================== + $this->myLogger->logme('error', "8. PROCESSING POLICY PREMIUM 1 MODEL"); + $policy_premium1_data = $this->policyPremium1Model->where('client_id', $client_id)->findAll(); + $this->myLogger->logme('error', " Found Policy Premium 1 Records: " . count($policy_premium1_data ?? [])); + + if (!empty($policy_premium1_data)) { + $is_deleted = $this->policyPremium1Model->where('client_id', $client_id)->delete(); + if ($is_deleted) { + $this->myLogger->logme('error', " ✓ Policy Premium 1 data removed successfully"); + } else { + $this->myLogger->logme('error', " ✗ Failed to delete Policy Premium 1 records"); + } + } else { + $this->myLogger->logme('error', " ℹ No Policy Premium 1 data found"); + } + $this->myLogger->logme('error', "----------------------------------------"); + + // ======================================== + // 8. POLICY PREMIUM 2 MODEL DELETION + // ======================================== + $this->myLogger->logme('error', "9. PROCESSING POLICY PREMIUM 2 MODEL"); + $policy_premium2_data = $this->policyPremium2Model->where('client_id', $client_id)->findAll(); + $this->myLogger->logme('error', " Found Policy Premium 2 Records: " . count($policy_premium2_data ?? [])); + + if (!empty($policy_premium2_data)) { + $is_deleted = $this->policyPremium2Model->where('client_id', $client_id)->delete(); + if ($is_deleted) { + $this->myLogger->logme('error', " ✓ Policy Premium 2 data removed successfully"); + } else { + $this->myLogger->logme('error', " ✗ Failed to delete Policy Premium 2 records"); + } + } else { + $this->myLogger->logme('error', " ℹ No Policy Premium 2 data found"); + } + $this->myLogger->logme('error', "----------------------------------------"); + + // ======================================== + // 9. NOTIFICATION MODEL DELETION + // ======================================== + $this->myLogger->logme('error', "10. PROCESSING NOTIFICATION MODEL"); + $notification_data = $this->notificationModel->where('client_id', $client_id)->findAll(); + $this->myLogger->logme('error', " Found Notification Records: " . count($notification_data ?? [])); + $this->myLogger->logme('error', " Notification Data: " . json_encode($notification_data ?? [])); + + if (!empty($notification_data)) { + $is_deleted = $this->notificationModel->where('client_id', $client_id)->delete(); + if ($is_deleted) { + $this->myLogger->logme('error', " ✓ Notification data removed successfully"); + } else { + $this->myLogger->logme('error', " ✗ Failed to delete Notification records"); + } + } else { + $this->myLogger->logme('error', " ℹ No Notification data found"); + } + $this->myLogger->logme('error', "----------------------------------------"); + + + $this->myLogger->logme('error', "========================================"); + $this->myLogger->logme('error', "WIPE DEMO CLIENT FUNCTION COMPLETED"); + $this->myLogger->logme('error', "Client ID: " . $client_id . " - Successfully processed"); + $this->myLogger->logme('error', "========================================"); + + return $this->respond(['status' => true, 'message' => 'Demo client data wiped successfully'], 200); + } } diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 489ef96..28a76c4 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -41,6 +41,10 @@ use CodeIgniter\API\ResponseTrait; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; +use PhpOffice\PhpSpreadsheet\Style\Alignment; +use PhpOffice\PhpSpreadsheet\Style\Fill; +use PhpOffice\PhpSpreadsheet\Style\Border; +use PhpOffice\PhpSpreadsheet\Cell\Coordinate; use Dompdf\Dompdf; use Dompdf\Options; @@ -2473,7 +2477,8 @@ class EmployeeController extends AdminController //------------------------------------------------------------------------------------------------------ - public function test_members_list(){ + public function test_members_list() + { // $model = new EmployeeModel(); // $list = [ // ['relationship' => 'spouse','emp_code' => 'TEST002', 'name' => 'Lakshmi','email_personal' => 'lakshmi@gmail.com','mobile'=>'6382156701','gender'=>'female','dob'=>'1996-05-19','doj'=>'2022-02-01','basic_pay'=>'100000','emp_status'=>'enrolled'], @@ -2496,7 +2501,8 @@ class EmployeeController extends AdminController return $this->loadLayout('test_members_list',$data); } - public function mapEmployees(){ + public function mapEmployees() + { $client_id = $this->request->getPost('client_id'); $branch_id = $this->request->getPost('branch_id'); $policy_id = $this->request->getPost('client_policy_id'); @@ -2530,7 +2536,8 @@ class EmployeeController extends AdminController } } - public function getDataForMapping(){ + public function getDataForMapping() + { $policy_id = $this->request->getPost('policy_id');log_message('error',$policy_id); $data['policy_start_date'] = $this->clientPolicyModel->select('policy_start_date')->where('id',$policy_id)->first()['policy_start_date']; $data['si_amt'] = $this->PolicyPremium2Model->select('si')->where('client_policy_id', $policy_id)->groupBy('si')->findAll(); @@ -2538,7 +2545,8 @@ class EmployeeController extends AdminController return $this->respond(['status' => true, 'code' => 200, 'data' => $data], 200); } - public function unmapEmployees($actionType){ + public function unmapEmployees($actionType) + { $selected_employees = (array)$this->request->getPost('selected'); if($actionType == 0){ for($i = 0;$irequest->getPost('emp_id'); @@ -2708,7 +2714,8 @@ class EmployeeController extends AdminController } - public function formatFieldName($unformattedString){ + public function formatFieldName($unformattedString) + { if (str_contains($unformattedString, '_')) { $data = str_replace('_', ' ', $unformattedString); @@ -2722,4 +2729,100 @@ class EmployeeController extends AdminController } + //------------------------------------------------------------------------------------------------------ + + public function download_inception() + { + $client = $this->request->getPost('client'); + $branch = $this->request->getPost('branch'); + $policies = $this->request->getPost('policies'); + $status = $this->request->getPost('status'); + $empCode = $this->request->getPost('empCode'); + $empName = $this->request->getPost('empName'); + + $result = $this->employeePolicyModel->download_inception( + $client, $branch, $policies, $status, $empCode, $empName + ); + + if (empty($result)) { + return $this->response->setStatusCode(204)->setBody('No data found'); + } + + $formatted = []; + foreach ($result as $index => $row) { + $rowWithSerial = ['S.NO' => $index + 1] + $row; + $formatted[] = $rowWithSerial; + } + $result = $formatted; + + $spreadsheet = new Spreadsheet(); + $sheet = $spreadsheet->getActiveSheet(); + + $headers = array_keys($result[0]); + $columnWidth = 20; // standard column width + + $colIndex = 1; + foreach ($headers as $header) { + $columnLetter = Coordinate::stringFromColumnIndex($colIndex); + $cellCoordinate = $columnLetter . '1'; + + $sheet->setCellValue($cellCoordinate, ucfirst(str_replace('_', ' ', $header))); + + $sheet->getColumnDimension($columnLetter)->setWidth($columnWidth); + + $style = $sheet->getStyle($cellCoordinate); + $style->getFont()->setBold(true); + $style->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER); + $style->getBorders()->getAllBorders()->setBorderStyle(Border::BORDER_THIN); + + $colIndex++; + } + + $rowNum = 2; + foreach ($result as $row) { + $colIndex = 1; + foreach ($row as $cell) { + $columnLetter = Coordinate::stringFromColumnIndex($colIndex); + $cellCoordinate = $columnLetter . $rowNum; + $sheet->setCellValue($cellCoordinate, $cell); + $colIndex++; + } + $rowNum++; + } + + + $exportDir = WRITEPATH . 'exports'; + if (!is_dir($exportDir)) { + mkdir($exportDir, 0777, true); + } else { + chmod($exportDir, 0777); + } + + $filename = 'inception_export_' . date('Ymd_His') . '.xlsx'; + $filepath = $exportDir . '/' . $filename; + + $writer = new Xlsx($spreadsheet); + $writer->save($filepath); + + return $this->response->setJSON([ + 'status' => 'success', + 'downloadUrl' => base_url('employee/download_file?file=' . urlencode($filename)) + ]); + } + + + public function download_file() + { + $filename = $this->request->getGet('file'); + $filepath = WRITEPATH . 'exports/' . $filename; + + if (!file_exists($filepath)) { + return $this->response->setStatusCode(404)->setBody('File not found.'); + } + + return $this->response->download($filepath, null)->setFileName($filename); + } + + + } diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 976a35f..04902bc 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -425,6 +425,7 @@ class RestAuthenticationController extends AdminController // print_r($employeeData); die; unset($employeeData['employee_id']); + $employeeData['token_type'] = "pre"; $result = JWTToken::encode($employeeData); if(isset($this->request->getJSON()->otp)){ @@ -959,6 +960,7 @@ class RestAuthenticationController extends AdminController } unset($employeeData['employee_id']); + $employeeData['token_type'] = "pre"; $result = JWTToken::encode($employeeData); $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyMpin: Calling third-party API - verifyMpin to get the POST employee data"); diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index ff80bc7..d29c75f 100755 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -1849,4 +1849,99 @@ class EmployeePolicyModel extends Model return $result[0]; } + + public function download_inception($client_id = 0, $branch_id = 0, $policy_id = 0, $status = [], $emp_code = "", $emp_name = ""){ + + $result = $this->select([ + + 'emp.emp_code AS `Emp ID`', + 'emp.name AS `Name of Emp/Dep`', + "DATE_FORMAT(emp.dob, '%d-%b-%Y') AS `DOB`", + 'emp.gender As `Gender`', + 'emp.relationship As `Relationship`', + + 'employee_polices.basic_cover_si As `Basic cover SI`', + + "DATE_FORMAT(employee_polices.date_coverage, '%d-%b-%Y') AS `Date of Coverage`", + "DATE_FORMAT(emp.doj, '%d-%b-%Y') AS `DOJ`", + 'emp.basic_pay As `Basic Pay`', + 'emp.band As `Band/Grade`', + 'emp.designation As `Designation`', + + 'emp.mobile as Phone', + 'emp.email_corporate As Email', + + 'COALESCE(employee_polices.pre_existing_alignments, 0) as `PRE EXISTING AILMENTS`', + + 'emp.change_event', + 'employee_polices.date_of_exit', + 'employee_polices.reason_for_exit', + + 'emp.unit' + + ]) + ->join('employees emp', 'employee_polices.employee_id = emp.id') + ->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy + ->join('policies pm', 'cp.policy_id = pm.id', 'left') //pm - policy master + ->join('policy_type', 'policy_type.id = cp.policy_type_id') + ->join('insurers im', 'cp.insurer_id = im.id', 'left') //im - insurer master + ->join('insurer_branch ib', 'cp.insurer_branch_id = ib.id', 'left') //ib - insurer branch + ->join('tpa tpam', 'cp.tpa_id = tpam.id', 'left') //tpam - tpa master + ->join('tpa_branch tpab', 'cp.tpa_branch_id = tpab.id', 'left') //tpab - tpa branch + ->join('clients cm', 'cp.client_id = cm.id') //cm - client master + ->join('client_branch', 'emp.client_branch_id = client_branch.id') //cm - client master + ->orderBy('emp.emp_code', 'ASC') + ->orderBy('employee_polices.employee_id', 'ASC'); + + + // Conditionally add where clauses + if ($client_id != 0 && !empty(trim($client_id))) { + $result->where('emp.client_id', $client_id); + } + if ($branch_id != 0 && !empty(trim($branch_id))) { + $result->where('emp.client_branch_id', $branch_id); + } + if ($policy_id != 0 && !empty(trim($policy_id))) { + $result->where('employee_polices.client_policy_id', $policy_id); + } + + // if (is_array($status) && count($status) > 0) { + + // $result->where('employee_polices.status !=', 'expired'); + + // if (in_array("active", $status)) { + + // $result->where('employee_polices.tpa_id IS NOT NULL'); + // $result->where('employee_polices.uhid IS NOT NULL'); + // $result->whereIn('employee_polices.status', $status); + // } elseif (in_array("pending", $status)) { + + // $result->where('employee_polices.tpa_id IS NULL'); + // $result->where('employee_polices.uhid IS NULL'); + // $result->whereIn('employee_polices.status', array_merge($status, ['active'])); + // } else { + + // $result->whereIn('employee_polices.status', $status); + // } + // } + + $result->where('employee_polices.status =', 'enrolled'); + + if (!empty(trim($emp_code))) { + $result->where('emp.emp_code', $emp_code); + } + if (!empty(trim($emp_name))) { + $result->like('emp.name', $emp_name); + } + + // Always check these conditions + $result->where('employee_polices.is_active', 1) + ->where('emp.is_active', 1); + + $res = $result->findAll(); + + return $res; + } + + } \ No newline at end of file diff --git a/app/Views/client_list.php b/app/Views/client_list.php index f7f8296..6ecfc2c 100755 --- a/app/Views/client_list.php +++ b/app/Views/client_list.php @@ -1,48 +1,48 @@
@@ -71,33 +71,31 @@ table.dataTable thead th { - - - client_name; ?> ( short_name; ?> ) - - - - client_id == $row->id): ?> - account_manager . ', '; ?> - - - - - - -
@@ -142,111 +139,302 @@ table.dataTable thead th {
+ + + function featchClient(){ - \ No newline at end of file diff --git a/app/Views/employee_data_list.php b/app/Views/employee_data_list.php index b01fd75..292827e 100755 --- a/app/Views/employee_data_list.php +++ b/app/Views/employee_data_list.php @@ -75,6 +75,19 @@ border-radius: 5px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); } +.btn-inception { + background-color: #02a8b5; /* Bootstrap primary blue */ + color: white; + border: none; + padding: 6px 12px; + font-weight: 500; + border-radius: 4px; +} + +.btn-inception:hover { + background-color: #05676eff; +} + @@ -88,6 +101,7 @@

Employees

+ @@ -105,6 +119,8 @@ + + @@ -144,6 +160,8 @@ + + @@ -394,7 +412,8 @@ $(document).ready(function() { extend: 'csv', text: 'CSV', title: 'Member-List', - }, + } + , { extend: 'excelHtml5', text: 'Excel', @@ -428,6 +447,15 @@ $(document).ready(function() { }); } } + , + { + + text: 'Export As Inception', + className: 'btn-inception', + action: function (e, dt, node, config) { + downloadInception(); + } + } ], language: { search: "_INPUT_", @@ -779,4 +807,56 @@ function get_emp_history(input, emp_id) { // modalInstance.hide(); // } // } + +function downloadInception(){ + + let client = $('#clients').val(); + let branch = $('#branch_id').val(); + let policies = $('#policies').val(); + let status = $('#status2').val(); + let empCode = $('#emp_code').val(); + let empName = $('#emp_name').val(); + + $('.loader').fadeIn(); + $('.loader-mask').fadeIn(); + + $.ajax({ + type: 'POST', + url: "", + data: { + client: client, + branch: branch, + policies: policies, + status: status, + empCode: empCode, + empName: empName + }, + success: function(response) { + if (response.status === 'success') { + $('', { + href: response.downloadUrl, + download: '', + style: 'display:none' + }).appendTo('body')[0].click(); + } else { + alert(response.message || 'Download failed'); + } + }, + error: function(xhr, status, error) { + console.error('Error:', error); + }, + complete: function() { + $('.loader').fadeOut(); + $('.loader-mask').delay(350).fadeOut('slow'); + console.log('AJAX request finished.'); + } + }); + + + + + + +} + \ No newline at end of file diff --git a/app/Views/enrollment_dash.php b/app/Views/enrollment_dash.php index c6aa284..21469aa 100755 --- a/app/Views/enrollment_dash.php +++ b/app/Views/enrollment_dash.php @@ -1,4 +1,4 @@ -
+
@@ -6,20 +6,20 @@ style="padding: 0.5rem !important;background-color: white;">
-
-
-
-

Enrolled + style="color: black;font-size: 15px;">Enrolled
diff --git a/app/Views/login.php b/app/Views/login.php index 4434f46..0f13348 100755 --- a/app/Views/login.php +++ b/app/Views/login.php @@ -8,86 +8,157 @@ - + - /assets/images/Nhance_Favi.svg"> + /assets/images/Nhance_Favi.svg"> - /assets/css/bootstrap-material.min.css" rel="stylesheet" type="text/css" + /assets/css/bootstrap-material.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" /> - /assets/css/app-material.min.css" rel="stylesheet" type="text/css" + /assets/css/app-material.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" /> - /assets/css/bootstrap-material-dark.min.css" rel="stylesheet" type="text/css" + /assets/css/bootstrap-material-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" /> - /assets/css/app-material-dark.min.css" rel="stylesheet" type="text/css" + /assets/css/app-material-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" /> + + + + + + + + + - /assets/css/icons.min.css" rel="stylesheet" type="text/css" /> + /assets/css/icons.min.css" rel="stylesheet" type="text/css" /> - + +
+
-
- + + + + - + - + diff --git a/app/Views/login_old.php b/app/Views/login_old.php new file mode 100644 index 0000000..4434f46 --- /dev/null +++ b/app/Views/login_old.php @@ -0,0 +1,94 @@ + + + + + + NHANCE + + + + + + + /assets/images/Nhance_Favi.svg"> + + + /assets/css/bootstrap-material.min.css" rel="stylesheet" type="text/css" + id="bs-default-stylesheet" /> + /assets/css/app-material.min.css" rel="stylesheet" type="text/css" + id="app-default-stylesheet" /> + + /assets/css/bootstrap-material-dark.min.css" rel="stylesheet" type="text/css" + id="bs-dark-stylesheet" /> + /assets/css/app-material-dark.min.css" rel="stylesheet" type="text/css" + id="app-dark-stylesheet" /> + + + /assets/css/icons.min.css" rel="stylesheet" type="text/css" /> + + + + + + + +
+
+ +
+ /assets/images/Nhance-Logo-Final.png" width="200"> +
+ +
+
+ + +
+
+
+ + + getFlashdata('error')) : ?> + +
+

+
+
+ + +
+
+
+ +
+
+ + + + + + + + + + \ No newline at end of file diff --git a/app/Views/policy_gmc_terms.php b/app/Views/policy_gmc_terms.php index 0d9b2bd..fdb3ae5 100755 --- a/app/Views/policy_gmc_terms.php +++ b/app/Views/policy_gmc_terms.php @@ -1223,13 +1223,9 @@ $('body').on('click', '.btnPolicyMaster', function() { if (jsonObject[key]['either-parents-pil'] == 1) { $('#family_floaters').val('EPORPIL'); - } else if (jsonObject[key].parents == 1 && jsonObject[key][ - 'parents-in-law' - ] == 1) { + } else if (jsonObject[key].parents == 1 && jsonObject[key]['parents-in-law'] == 1) { $('#family_floaters').val('2EPORPIL'); - } else if (jsonObject[key].parents == 2 && jsonObject[key][ - 'parents-in-law' - ] == 2) { + } else if (jsonObject[key].parents == 2 && jsonObject[key]['parents-in-law'] == 2) { $('#family_floaters').val('4EPORPIL'); } else if (jsonObject[key].parents == 1) { $('#family_floaters').val('1P'); @@ -1240,7 +1236,7 @@ $('body').on('click', '.btnPolicyMaster', function() { } else if (jsonObject[key]['parents-in-law'] == 2) { $('#family_floaters').val('2PIL'); } else if (jsonObject[key]['either-parents-pil'] == 2) { - $('#family_floaters').val('4EPORPIL'); + $('#family_floaters').val('2EPORPIL'); } } diff --git a/public/assets/images/action_on_policies_sb.png b/public/assets/images/action_on_policies_sb.png new file mode 100644 index 0000000..aa07ba5 Binary files /dev/null and b/public/assets/images/action_on_policies_sb.png differ diff --git a/public/assets/images/app_content_mng_sb.png b/public/assets/images/app_content_mng_sb.png new file mode 100644 index 0000000..d2b1372 Binary files /dev/null and b/public/assets/images/app_content_mng_sb.png differ diff --git a/public/assets/images/background_theme.jpg b/public/assets/images/background_theme.jpg new file mode 100644 index 0000000..b225b4b Binary files /dev/null and b/public/assets/images/background_theme.jpg differ diff --git a/public/assets/images/bg_image.png b/public/assets/images/bg_image.png new file mode 100644 index 0000000..0588d07 Binary files /dev/null and b/public/assets/images/bg_image.png differ diff --git a/public/assets/images/claims_sb.png b/public/assets/images/claims_sb.png new file mode 100644 index 0000000..e27eeaf Binary files /dev/null and b/public/assets/images/claims_sb.png differ diff --git a/public/assets/images/clients_sb.png b/public/assets/images/clients_sb.png new file mode 100644 index 0000000..1c1983e Binary files /dev/null and b/public/assets/images/clients_sb.png differ diff --git a/public/assets/images/leads_sb.png b/public/assets/images/leads_sb.png new file mode 100644 index 0000000..84c6d6f Binary files /dev/null and b/public/assets/images/leads_sb.png differ diff --git a/public/assets/images/masters_sb.png b/public/assets/images/masters_sb.png new file mode 100644 index 0000000..63e786f Binary files /dev/null and b/public/assets/images/masters_sb.png differ diff --git a/public/assets/images/policy_transactions_sb.png b/public/assets/images/policy_transactions_sb.png new file mode 100644 index 0000000..af24033 Binary files /dev/null and b/public/assets/images/policy_transactions_sb.png differ diff --git a/public/assets/images/user_manual_sb.png b/public/assets/images/user_manual_sb.png new file mode 100644 index 0000000..f36c9f4 Binary files /dev/null and b/public/assets/images/user_manual_sb.png differ
EMP Code Relationship GenderEmailMobile Date of Birth Policy name Insurer name -