diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 79579835..baece64e 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -731,7 +731,7 @@ class TicketController extends BaseController $data['claim_type'] = $this->claimType[2]; } - $data['client_for_motor'] = $this->clientModel->select('id,client_name')->where('client_type', 2)->where('is_active', 1)->findAll(); + $data['client_for_motor'] = $this->clientModel->select('id,client_name,phone')->where('client_type', 2)->where('is_active', 1)->findAll(); $this->myLogger->logme('error', "Ticket form data fetched successfully for Ticket Type: $ticket_type"); @@ -875,15 +875,7 @@ class TicketController extends BaseController { // $ticket_data = $this->ticketMasterModel->where('id', $ticket_id)->where('is_active', 1)->first(); $ticket_data = $this->ticketMasterModel->getTicketDataByTicketID($ticket_id); - if($ticket_data['ticket_type_id'] == 8){ - $this->motor_claim($ticket_data,$ticket_id); - }else{ - $this->other_claim($ticket_data,$ticket_id); - } - } - - public function other_claim($ticket_data,$ticket_id) - { + $ticket_data = $this->formatDateForClaim($ticket_data, 'd/m/Y'); if (in_array($ticket_data['claim_status_id'], [15, 25, 35])) { @@ -942,22 +934,15 @@ class TicketController extends BaseController // print_rr($data); die; } - return $this->loadLayout('ticket_edit_onbording', $data); - } + // 8TH TYPE is Motor - so do not remove it.... + if($ticket_data['ticket_type_id'] == 8){ + $claim_status_id = $ticket_data['claim_status_id']; + $ticket_type = $ticket_data['ticket_type_id']; + $data['claim_status'] = $this->transFormClaimStatus($claim_status_id, $ticket_type); + $data['client_for_motor'] = $this->clientModel->select('id,client_name,phone')->where('client_type', 2)->where('is_active', 1)->findAll(); + } - public function motor_claim($ticket_data,$ticket_id) - { - $claim_status_id = $ticket_data['claim_status_id']; - $ticket_type = $ticket_data['ticket_type_id']; - - $data['selected_ticket_type'] = $ticket_type; - $data['ticket_type'] = [ 8 => 'Motor' ]; - $data['ticket_data'] = $ticket_data; - // print_r($ticket_data);die; - $data['claim_status'] = $this->transFormClaimStatus($claim_status_id, $ticket_type); - $data['client_for_motor'] = $this->clientModel->select('id,client_name')->where('client_type', 2)->where('is_active', 1)->findAll(); - // print_r($data);die; - return $this->loadLayout('ticket_form_motor', $data); + return $this->loadLayout('ticket_edit_onbording', $data); } public function formatDateForClaim($ticket_data, $out_put_format = 'Y-m-d') diff --git a/app/Views/ticket_edit_onbording.php b/app/Views/ticket_edit_onbording.php index dab23823..cfa9e718 100644 --- a/app/Views/ticket_edit_onbording.php +++ b/app/Views/ticket_edit_onbording.php @@ -54,6 +54,7 @@ History +