From 3b6c2f6684d57c7413be36886ef270935cca4029 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 28 Jan 2025 10:11:09 +0530 Subject: [PATCH] CHANGE_CLAIM_MODULE : RV --- app/Config/Routes.php | 2 +- app/Controllers/ClientController.php | 26 ++- app/Controllers/TicketController.php | 96 ++++++++- app/Models/TicketMasterModel.php | 40 +++- app/Views/client_policy.php | 8 +- app/Views/layout/footer.php | 6 +- app/Views/layout/header.php | 2 +- app/Views/ticket_form_gmc.php | 127 ++++++----- app/Views/ticket_form_gpa.php | 37 +++- app/Views/ticket_form_handler.php | 304 +++++++++++++++++++++++++++ app/Views/ticket_list.php | 6 +- app/Views/ticket_type_modal.php | 47 +++++ 12 files changed, 612 insertions(+), 89 deletions(-) create mode 100644 app/Views/ticket_form_handler.php create mode 100644 app/Views/ticket_type_modal.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 0ac3773a..eb828452 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -495,7 +495,7 @@ $routes->group("/bdsReport", ["filter" => "authMVC"], function ($routes) { //New Tickets $routes->group("/ticket", ["filter" => "authMVC"], function ($routes) { $routes->match( ['get', 'post'], 'list','TicketController::ticketList'); - $routes->get('new','TicketController::ticket_form'); + $routes->get('new/(:any)','TicketController::ticket_form/$1'); $routes->post('create','TicketController::createTicket'); $routes->get('update','TicketController::updateTicket'); $routes->get('view/(:any)','TicketController::view_ticket/$1'); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 9c8e8d64..38192213 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -4047,18 +4047,38 @@ class ClientController extends AdminController // -----------BDS REPORT CONTROLLER--------------------------------------------------------------------------------- - $BDSReportController = new BDSReportController(); + // $BDSReportController = new BDSReportController(); // $data['data'] = $BDSReportController->getBAPInsurerData(); // return $this->loadLayout('irda_bap_insurer_report_list', $data); - $data['data'] = $BDSReportController->getBAPClientData(); - return $this->loadLayout('irda_bap_client_report_list', $data); + // $data['data'] = $BDSReportController->getBAPClientData(); + // return $this->loadLayout('irda_bap_client_report_list', $data); // $data['data'] = $BDSReportController->getClientData(1); // return $this->loadLayout('irda_client_report_list', $data); // $BDSReportController->getBAPClientData(); + + //-------------------------------------------------------------------------------------------------------- + + // $email_id = 'venkateshraman786@gmail.com'; + // $common = ['mail_type'=>'test_mail_cli']; + // $bcc = "vitvelz@gmail.com"; + + // $data = db_connect() + // ->table('jobs') + // ->where('id', 2264) + // ->get() + // ->getResultArray(); + + // $data = json_decode($data[0]['payload'], true); + + // // dd($data); + // // Send email and get response + // $result = MailHelper::send_email($data[0]); + // echo json_encode($result); + // log_message('error',json_encode($result)); } // ------------------------------------------------------------------------------------------------------- diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index f41e53b1..256d5118 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -10,6 +10,8 @@ use Kint\Kint; use CodeIgniter\API\ResponseTrait; +use App\Models\TicketMasterModel; + class TicketController extends BaseController { use ResponseTrait; @@ -18,10 +20,16 @@ class TicketController extends BaseController protected $ticketType; protected $priorityType; protected $relationshipType; + protected $modeOFIntimate; + protected $claimType; + protected $ticketMasterModel; public function __construct() { $this->myLogger = \Config\Services::mylogger(); + + $this->ticketMasterModel = new TicketMasterModel(); + $this->ticketType = [1 => "Claim-GMC", 2 => "Claim-GPA", 3 => "EDLI", 4 => "GTLI"]; $this->priorityType = [ 1 => "Low", @@ -41,6 +49,26 @@ class TicketController extends BaseController "father-in-law" => "Father-in-Law", "mother-in-law" => "Mother-in-Law" ]; + $this->modeOFIntimate = [ + 1 => "In Person", + 2 => "Courier", + 3 => "Online Mode - Email", + 4 => "Online Mode - To TPA" + ]; + $this->claimType = [ + 1 => [ + 1 => "Main", + 2 => "OPD", + 3 => "Pre ReOpen", + 4 => "Post ReOpen", + ], + 2 => [ + 1 => "TTD", + 2 => "PTD", + 3 => "PPD", + 4 => "Death", + ] + ]; } public function ticketList() @@ -102,10 +130,45 @@ class TicketController extends BaseController return $data; } - public function ticket_form() + public function ticket_form($ticket_type) { $data['ticket_form'] = 1; - return $this->loadLayout('ticket_form_gmc', $data); + $data['ticket_type'] = $this->ticketType; + $data['priorityType'] = $this->priorityType; + $data['relationshipType'] = $this->relationshipType; + $data['modeOFIntimate'] = $this->modeOFIntimate; + + $data['acms'] = db_connect()->table('user_profiles') + ->select('user_profiles.id, user_profiles.first_name') + ->where('user_profiles.is_active', 1) + ->where('user_profiles.role', 3) + ->get() + ->getResultArray(); + + $data['claim_status'] = db_connect()->table('ticket_claim_status') + ->select('ticket_claim_status.*') + ->where('ticket_claim_status.is_active', 1) + ->where('ticket_claim_status.ticket_type', $ticket_type) + ->get() + ->getResultArray(); + + if($ticket_type == 1){ + $data['modeOFIntimate'] = $this->claimType[1]; + return $this->loadLayout('ticket_form_handler', $data); + }else{ + + $data['modeOFIntimate'] = $this->claimType[2]; + + if($ticket_type == 2){ + $data['ticket_form'] = 'GPA'; + }else if($ticket_type = 3){ + $data['ticket_form'] == 'EDLI'; + }else if($ticket_type = 4){ + $data['ticket_form'] = 'GTLI'; + } + + return $this->loadLayout('ticket_form_handler', $data); + } } public function view_ticket($ticket_id) @@ -116,6 +179,33 @@ class TicketController extends BaseController public function createTicket() { + $ticket_data = $this->request->getPost(); + // print_rr($ticket_data); die; + + if(empty($ticket_data['doa'])){ + $ticket_data['doa'] = null; + }else{ + $ticket_data['doa'] = change_date_format($ticket_data['doa']); + } + + if(empty($ticket_data['dod'])){ + $ticket_data['dod'] = null; + }else{ + $ticket_data['dod'] = change_date_format($ticket_data['dod']); + } + + // print_rr($ticket_data); die; + + if($ticket_data){ + $return_value = $this->ticketMasterModel->insert($ticket_data); + if($cd_amount){ + return $this->respond(['status' => true, 'code' => 200, 'data' => $ticket_data, "message" => "Claim created successfully"], 200); + } else { + return $this->respond(['status' => false, 'code' => 404, 'message' => 'Failed to create claim'], 200); + } + }else{ + return $this->respond(['status' => false, 'code' => 404, 'message' => 'claim data not found'], 200); + } } public function updateTicket() @@ -129,4 +219,4 @@ class TicketController extends BaseController } -} +} \ No newline at end of file diff --git a/app/Models/TicketMasterModel.php b/app/Models/TicketMasterModel.php index 060f1594..51896dbc 100644 --- a/app/Models/TicketMasterModel.php +++ b/app/Models/TicketMasterModel.php @@ -12,7 +12,45 @@ 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', + 'is_active', + 'claim_number' + ]; + // Callbacks protected $allowCallbacks = true; diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index a4accd6b..cbe4f817 100755 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -755,7 +755,7 @@ dataType: 'json', success: function(res) { - console.log('client_policy_res', res); + console.log('client_policy_res by btnPolicyEdit', res); var gst = (res.data.gst == 0.00) ? 18 : res.data.gst; @@ -944,7 +944,7 @@ }, 1000); setTimeout(function(){ - appendCDACNO(res.cd_data, res.data.cd_ac_no) // append and select the current CD Account Number + appendCDACNO(res.cd_data, res.data.cd_ac_pk) // append and select the current CD Account Number appendBasePolicyList(res.client_policy_list, res.data.base_policy, res.data.client_branch_id); // append and select the Base palicy }, 2000) @@ -1660,7 +1660,7 @@ text: item.cd_ac_no }); - if (select === item.cd_ac_no) { + if (select === item.id) { //console.log('selected'); option.attr('selected', true); } @@ -1990,7 +1990,7 @@ }, 1000); setTimeout(function(){ - appendCDACNO(res.cd_data, res.data.cd_ac_no) // append and select the current CD Account Number + appendCDACNO(res.cd_data, res.data.cd_ac_pk) // append and select the current CD Account Number appendBasePolicyList(res.client_policy_list, res.data.base_policy, res.data.client_branch_id); // append and select the Base palicy }, 2000) diff --git a/app/Views/layout/footer.php b/app/Views/layout/footer.php index bef8a1fc..c63f59f6 100755 --- a/app/Views/layout/footer.php +++ b/app/Views/layout/footer.php @@ -2,6 +2,9 @@ + + +