From 4d0070d1105b1fa203d945bd7449b05f9e27e168 Mon Sep 17 00:00:00 2001 From: velz Date: Mon, 27 Jan 2025 17:31:38 +0530 Subject: [PATCH 1/2] FIX_BDS_STMT_UPLOAD_UNICODE_CHAR_HANDLED --- app/Controllers/PolicyTransactionController.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index ca4a1d66..ea4d3901 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -2204,16 +2204,19 @@ class PolicyTransactionController extends BaseController $is_row_empty = check_row_is_empty_or_null($excel_row); if(!$is_row_empty) { + // $excel_row = ExcelSanitizeHelper::sanitizeArrayData($excel_row); $is_source_found = 0; $policy_start_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[4]);//policy_start_date from excel $policy_end_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[5]);//policy_end_date from excel $policy_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[1]);//policy_end_date from excel + $policy_no = preg_replace('/[\x{200C}\x{200B}]/u', '', $excel_row[1]);//policy_end_date from excel $client_name = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[3]);//clientname from excel $endorsement_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[2]);//policy_end_date from excel - + // Kint::dump($policy_no); foreach ($source_data as $source_key => $source_row) { - $source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : ""; + $source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : null; + // Kint::dump($source_endorsement_no); if( ($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no && change_date_format($policy_start_date,'d-m-Y','Y-m-d') == $source_row['policy_start_date'] && change_date_format($policy_end_date,'d-m-Y','Y-m-d') == $source_row['policy_end_date'] && $client_name == $source_row['client_name']) { $is_source_found = 1; @@ -2295,9 +2298,9 @@ class PolicyTransactionController extends BaseController $line_items = count($excel_data); // get uploaded month transactions data $source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id:$file['insurer_id'],insurer_branch_id:$file['branch_id']); - // Kint::dump($source_data);die; + // Kint::dump($source_data);//die; // Kint::dump($excel_data); - + // die; // check policy no,insurer and etc in DB for this month // if all good return true, otherwise return false with messssage $data_to_update = []; @@ -2311,13 +2314,14 @@ class PolicyTransactionController extends BaseController $policy_start_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[4]);//policy_start_date from excel $policy_end_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[5]);//policy_end_date from excel $policy_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[1]);//policy_end_date from excel + $policy_no = preg_replace('/[\x{200C}\x{200B}]/u', '', $excel_row[1]);// $client_name = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[3]);//clientname from excel $endorsement_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[2]);//policy_end_date from excel foreach ($source_data as $source_key => $source_row) { // Kint::dump(change_date_format($excel_row[3],'d-m-Y','Y-m-d')); - $source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : ""; + $source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : null; if( ($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no && change_date_format($policy_start_date,'d-m-Y','Y-m-d') == $source_row['policy_start_date'] && change_date_format($policy_end_date,'d-m-Y','Y-m-d') == $source_row['policy_end_date'] && $client_name == $source_row['client_name']) { $is_source_found = 1; From b7154b17bc2ad96fb85b336d7d17987977a1874e Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Tue, 28 Jan 2025 09:59:42 +0530 Subject: [PATCH 2/2] FEAT_CLAIM_SEARCH_FILTER_SRINIVAS --- app/Controllers/LoginController.php | 8 ++- app/Controllers/TicketController.php | 72 +++++++++++++-------------- app/Models/TicketClaimStatusModel.php | 2 +- app/Models/TicketMasterModel.php | 8 ++- app/Views/ticket_search.php | 50 ++++++++++++++++--- 5 files changed, 90 insertions(+), 50 deletions(-) diff --git a/app/Controllers/LoginController.php b/app/Controllers/LoginController.php index b3ca2187..f5f31844 100755 --- a/app/Controllers/LoginController.php +++ b/app/Controllers/LoginController.php @@ -20,7 +20,7 @@ class LoginController extends BaseController // $isLoggedIn = check_session(); $isLoggedIn = check_session(); $hasCookie = check_cookie(); - if ($isLoggedIn || $hasCookie) { + if ($isLoggedIn && $hasCookie) { return redirect()->to(base_url('/dashboard/view')); } return view('login'); @@ -91,7 +91,11 @@ class LoginController extends BaseController { $path = getenv('cookie.Path'); session()->destroy(); - setcookie('session_data', '', time() - 3600, $path); + // setcookie('session_data', '', time() - 3600, $path); + $path = getenv('cookie.Path'); + $domain = getenv('cookie.Domain'); + $https = getenv('ccokie.secure'); + setcookie('session_data',null, time() -3600, $path, $domain, $https, true); return redirect()->to(base_url('login')); } diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index f41e53b1..e13e1c75 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -4,7 +4,9 @@ namespace App\Controllers; use App\Controllers\BaseController; use CodeIgniter\HTTP\ResponseInterface; - +use App\Models\TicketMasterModel; +use App\Models\TicketClaimStatusModel; +use App\Models\ClientModel; use Psr\Log\LoggerInterface; use Kint\Kint; @@ -18,6 +20,9 @@ class TicketController extends BaseController protected $ticketType; protected $priorityType; protected $relationshipType; + protected $ticketMasterModel; + protected $claimStatus; + protected $clientModel; public function __construct() { @@ -41,6 +46,9 @@ class TicketController extends BaseController "father-in-law" => "Father-in-Law", "mother-in-law" => "Mother-in-Law" ]; + $this->ticketMasterModel = new TicketMasterModel(); + $this->claimStatus = new TicketClaimStatusModel(); + $this->clientModel = new ClientModel(); } public function ticketList() @@ -48,8 +56,8 @@ class TicketController extends BaseController if ($this->request->is('get')) { $data['page_name'] = "Claims"; $data['ticket_type'] = $this->ticketType; - $data['claim_status'] = []; - $data['client_list'] = []; + $data['claim_status'] = $this->claimStatus->select('id,ticket_type,claim_status')->where('is_active',1)->findAll(); + $data['client_list'] = $this->clientModel->select('id,client_name')->where('is_active',1)->findAll(); return $this->loadLayout('ticket_search', $data); @@ -64,47 +72,35 @@ class TicketController extends BaseController public function ticketSearch() { $search_data = $this->request->getPost(); - // print_r($search_data); die; - - $data = [ - [ - 'id' => 1, - 'status' => 'Approved', - 'claim_no' => 'CL12345', - 'tpa_id' => 'TPA001', - 'emp_name' => 'John Doe', - 'insurer_name' => 'ABC Insurance', - 'client_name' => 'XYZ Corp', - 'tat' => '5 Days', - ], - [ - 'id' => 2, - 'status' => 'Pending', - 'claim_no' => 'CL12346', - 'tpa_id' => 'TPA002', - 'emp_name' => 'Jane Smith', - 'insurer_name' => 'DEF Insurance', - 'client_name' => 'LMN Ltd', - 'tat' => '3 Days', - ], - [ - 'id' => 3, - 'status' => 'Rejected', - 'claim_no' => 'CL12347', - 'tpa_id' => 'TPA003', - 'emp_name' => 'Alice Johnson', - 'insurer_name' => 'GHI Insurance', - 'client_name' => 'PQR Co', - 'tat' => '7 Days', - ], - ]; - + // print_r($search_data); + $where = []; + foreach ($search_data as $search_objects => $key){ + if ($key != null && $key != '' && $key!= 0 ){ + $where[$search_objects] = $key; + } + } + // print_rr($where); + $data = $this->ticketMasterModel + ->select('ticket_master.id, ticket_claim_status.claim_status as status, + ticket_master.claim_number as claim_no,ticket_master.tpa_id,ticket_master.emp_name, + insurers.name as insurer_name, clients.client_name, + DATE_FORMAT(ticket_master.created_at, "%d-%m-%Y") as tat') + ->join('insurers','insurers.id = ticket_master.insurer_id and insurers.is_active = 1','left') + ->join('clients','clients.id = ticket_master.client_id and clients.is_active = 1','left') + ->join('ticket_claim_status','ticket_claim_status.id = ticket_master.claim_status_id and ticket_claim_status.is_active = 1','left') + ->where('ticket_master.is_active',1) + ->where($where) + ->findAll(); + // print_rr($data); + // log_message('error',' Claims Master Data '.json_encode($data));die(); + // print_rr($data);die(); return $data; } public function ticket_form() { $data['ticket_form'] = 1; + $data['claim_status'] = ''; return $this->loadLayout('ticket_form_gmc', $data); } diff --git a/app/Models/TicketClaimStatusModel.php b/app/Models/TicketClaimStatusModel.php index d0e959e7..bc40b394 100644 --- a/app/Models/TicketClaimStatusModel.php +++ b/app/Models/TicketClaimStatusModel.php @@ -12,7 +12,7 @@ class TicketClaimStatusModel extends Model protected $returnType = 'array'; protected $useSoftDeletes = false; protected $protectFields = true; - protected $allowedFields = []; + protected $allowedFields = ["id", "ticket_type", "claim_status", "created_by", "updated_by", "is_active"]; // Callbacks protected $allowCallbacks = true; diff --git a/app/Models/TicketMasterModel.php b/app/Models/TicketMasterModel.php index 060f1594..87e918a4 100644 --- a/app/Models/TicketMasterModel.php +++ b/app/Models/TicketMasterModel.php @@ -12,7 +12,13 @@ class TicketMasterModel extends Model protected $returnType = 'array'; protected $useSoftDeletes = false; protected $protectFields = true; - protected $allowedFields = []; + protected $allowedFields = ['id', 'ticket_type_id', 'claim_status_id', 'acm_id', 'insurer_id', + 'tpa_id', 'client_id', 'priority', 'policy_no', 'emp_code', 'tpa_no', 'emp_name', 'insured_name', + 'relationship', 'emp_mobile', 'emp_mail', 'mode_of_intimation', 'claim_type', 'hospital_name', + 'doa', 'dod', 'claim_amount', 'pod_no', 'created_by', 'updated_by', 'created_at', 'updated_at', + 'date_of_join', 'date_of_incep', 'dob', 'date_of_accident', 'date_of_death', 'date_of_intimat', + 'si_amt','claim_number' + ]; // Callbacks protected $allowCallbacks = true; diff --git a/app/Views/ticket_search.php b/app/Views/ticket_search.php index 24317d79..2e332cd7 100644 --- a/app/Views/ticket_search.php +++ b/app/Views/ticket_search.php @@ -10,10 +10,16 @@
@@ -51,7 +57,7 @@ $value) { + foreach ($client_list as $key => $value) { echo ""; } } @@ -79,13 +85,13 @@
@@ -113,6 +119,34 @@