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 636c6b54..c489e247 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -24,9 +24,12 @@ class TicketController extends BaseController protected $ticketType; protected $priorityType; protected $relationshipType; - protected $ticketMasterModel; + protected $modeOFIntimate; + protected $claimType; protected $claimStatus; + protected $clientModel; + protected $ticketMasterModel; protected $ticketHistoryModel; protected $ticketMailTemplateModel; protected $ticketMesageModel; @@ -35,6 +38,9 @@ class TicketController extends BaseController 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", @@ -54,6 +60,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", + ] + ]; $this->ticketMasterModel = new TicketMasterModel(); $this->claimStatus = new TicketClaimStatusModel(); $this->clientModel = new ClientModel(); @@ -107,11 +133,45 @@ class TicketController extends BaseController return $data; } - public function ticket_form() + public function ticket_form($ticket_type) { $data['ticket_form'] = 1; - $data['claim_status'] = ''; - 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) @@ -122,6 +182,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($return_value){ + 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() @@ -135,4 +222,4 @@ class TicketController extends BaseController } -} +} \ No newline at end of file diff --git a/app/Models/TicketMasterModel.php b/app/Models/TicketMasterModel.php index 01c7679e..ab41a1fe 100644 --- a/app/Models/TicketMasterModel.php +++ b/app/Models/TicketMasterModel.php @@ -12,6 +12,7 @@ class TicketMasterModel extends Model protected $returnType = 'array'; protected $useSoftDeletes = false; protected $protectFields = true; +<<<<<<< HEAD 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', @@ -19,6 +20,47 @@ class TicketMasterModel extends Model 'date_of_join', 'date_of_incep', 'dob', 'date_of_accident', 'date_of_death', 'date_of_intimat', 'si_amt','claim_number,is_active' ]; +======= + 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' + ]; + +>>>>>>> 3a4f7b1e836fc71f477cb6ad32a635dcae0192d0 // 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 @@ + + +