FEAT_CLAIM_MAIL_EDITOR_SRI
This commit is contained in:
commit
55e4b9ec17
@ -337,6 +337,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
|
|||||||
$routes->post('unmap_employees/(:num)', 'EmployeeController::unmapEmployees/$1');
|
$routes->post('unmap_employees/(:num)', 'EmployeeController::unmapEmployees/$1');
|
||||||
$routes->get('transformMailContent', 'LeadsController::transformMailContent');
|
$routes->get('transformMailContent', 'LeadsController::transformMailContent');
|
||||||
$routes->get('getCDAmount', 'ClientController::getCDAmount');
|
$routes->get('getCDAmount', 'ClientController::getCDAmount');
|
||||||
|
$routes->get('getTheEmpDataForClaim/(:any)', 'ClientController::getTheEmpDataForClaim/$1');
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group("policy_tranction", ["filter" => "authMVC"], function ($routes) {
|
$routes->group("policy_tranction", ["filter" => "authMVC"], function ($routes) {
|
||||||
@ -497,7 +498,7 @@ $routes->group("/ticket", ["filter" => "authMVC"], function ($routes) {
|
|||||||
$routes->match( ['get', 'post'], 'list','TicketController::ticketList');
|
$routes->match( ['get', 'post'], 'list','TicketController::ticketList');
|
||||||
$routes->get('new/(:any)','TicketController::ticket_form/$1');
|
$routes->get('new/(:any)','TicketController::ticket_form/$1');
|
||||||
$routes->post('create','TicketController::createTicket');
|
$routes->post('create','TicketController::createTicket');
|
||||||
$routes->get('update','TicketController::updateTicket');
|
$routes->post('update','TicketController::updateTicket');
|
||||||
$routes->get('view/(:any)','TicketController::view_ticket/$1');
|
$routes->get('view/(:any)','TicketController::view_ticket/$1');
|
||||||
$routes->get('mail_template','TicketController::mailTemplate');
|
$routes->get('mail_template','TicketController::mailTemplate');
|
||||||
$routes->post('crud_mail_template/(:any)','TicketController::crudTemplate/$1');
|
$routes->post('crud_mail_template/(:any)','TicketController::crudTemplate/$1');
|
||||||
|
|||||||
@ -4138,6 +4138,46 @@ class ClientController extends AdminController
|
|||||||
} else {
|
} else {
|
||||||
return $this->respond(['status' => false, 'code' => 404, 'message' => 'no data found'], 200);
|
return $this->respond(['status' => false, 'code' => 404, 'message' => 'no data found'], 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getTheEmpDataForClaim($client_policy_id)
|
||||||
|
{
|
||||||
|
$data = $this->clientPolicyModel->select("
|
||||||
|
|
||||||
|
clients.id as client_id,
|
||||||
|
clients.client_name,
|
||||||
|
insurers.id as insurer_id,
|
||||||
|
insurers.name as insurer_name,
|
||||||
|
tpa.id as tpa_id,
|
||||||
|
tpa.name as tpa_name,
|
||||||
|
|
||||||
|
employees.id as emp_id,
|
||||||
|
employees.name as emp_name,
|
||||||
|
employees.emp_code,
|
||||||
|
employees.mobile as emp_mobile,
|
||||||
|
employees.email_corporate as emp_email,
|
||||||
|
|
||||||
|
employee_polices.uhid as policy_no,
|
||||||
|
")
|
||||||
|
->join('clients', 'client_policy.client_id = clients.id', 'left')
|
||||||
|
->join('insurers', 'client_policy.insurer_id = insurers.id', 'left')
|
||||||
|
->join('tpa', 'client_policy.tpa_id = tpa.id', 'left')
|
||||||
|
->join('employees', 'clients.id = employees.client_id', 'left')
|
||||||
|
->join('employee_polices', 'employees.id = employee_polices.employee_id', 'left')
|
||||||
|
->where('client_policy.id',)
|
||||||
|
->where('client_policy.is_active', 1)
|
||||||
|
->where('insurers.is_active', 1)
|
||||||
|
->where('tpa.is_active', 1)
|
||||||
|
->where('employees.is_active', 1)
|
||||||
|
->where('employee_polices.is_active', 1)
|
||||||
|
->where('client_policy.id', $client_policy_id)
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
if($data){
|
||||||
|
return $this->respond(['status' => true, 'code' => 200, 'data' => $data], 200);
|
||||||
|
} else {
|
||||||
|
return $this->respond(['status' => false, 'code' => 404, 'message' => 'no data found', "client_policy_id" =>$client_policy_id], 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,6 +152,12 @@ class TicketController extends BaseController
|
|||||||
|
|
||||||
public function ticket_form($ticket_type)
|
public function ticket_form($ticket_type)
|
||||||
{
|
{
|
||||||
|
$data = $this->ticket_form_data($ticket_type);
|
||||||
|
return $this->loadLayout('ticket_form_handler', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ticket_form_data($ticket_type)
|
||||||
|
{
|
||||||
$data['ticket_form'] = 1;
|
$data['ticket_form'] = 1;
|
||||||
$data['ticket_type'] = $this->ticketType;
|
$data['ticket_type'] = $this->ticketType;
|
||||||
$data['priorityType'] = $this->priorityType;
|
$data['priorityType'] = $this->priorityType;
|
||||||
@ -173,12 +179,9 @@ class TicketController extends BaseController
|
|||||||
->getResultArray();
|
->getResultArray();
|
||||||
|
|
||||||
if($ticket_type == 1){
|
if($ticket_type == 1){
|
||||||
$data['modeOFIntimate'] = $this->claimType[1];
|
$data['claim_type'] = $this->claimType[1];
|
||||||
return $this->loadLayout('ticket_form_handler', $data);
|
|
||||||
}else{
|
}else{
|
||||||
|
$data['claim_type'] = $this->claimType[2];
|
||||||
$data['modeOFIntimate'] = $this->claimType[2];
|
|
||||||
|
|
||||||
if($ticket_type == 2){
|
if($ticket_type == 2){
|
||||||
$data['ticket_form'] = 'GPA';
|
$data['ticket_form'] = 'GPA';
|
||||||
}else if($ticket_type = 3){
|
}else if($ticket_type = 3){
|
||||||
@ -186,35 +189,80 @@ class TicketController extends BaseController
|
|||||||
}else if($ticket_type = 4){
|
}else if($ticket_type = 4){
|
||||||
$data['ticket_form'] = 'GTLI';
|
$data['ticket_form'] = 'GTLI';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->loadLayout('ticket_form_handler', $data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function view_ticket($ticket_id)
|
public function view_ticket($ticket_id)
|
||||||
{
|
{
|
||||||
$data = [];
|
$ticket_data = $this->ticketMasterModel->where('id', $ticket_id)->where('is_active', 1)->first();
|
||||||
|
$ticket_data = $this->formatDateForClaim($ticket_data, 'd/m/Y');
|
||||||
|
// dd($ticket_data);
|
||||||
|
$data = $this->ticket_form_data($ticket_data['ticket_type_id']);
|
||||||
|
$data['ticket_data'] = $ticket_data;
|
||||||
$data['ticket_note'] = $this->ticketNoteModel->where('is_active', 1)->findAll();
|
$data['ticket_note'] = $this->ticketNoteModel->where('is_active', 1)->findAll();
|
||||||
return $this->loadLayout('ticket_edit_onbording', $data);
|
return $this->loadLayout('ticket_edit_onbording', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createTicket()
|
public function formatDateForClaim($ticket_data, $out_put_format = 'Y-m-d')
|
||||||
{
|
{
|
||||||
$ticket_data = $this->request->getPost();
|
|
||||||
// print_rr($ticket_data); die;
|
|
||||||
|
|
||||||
if(empty($ticket_data['doa'])){
|
if(empty($ticket_data['doa'])){
|
||||||
$ticket_data['doa'] = null;
|
$ticket_data['doa'] = null;
|
||||||
}else{
|
}else{
|
||||||
$ticket_data['doa'] = change_date_format($ticket_data['doa']);
|
$ticket_data['doa'] = change_date_format($ticket_data['doa'], null, $out_put_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($ticket_data['dod'])){
|
if(empty($ticket_data['dod'])){
|
||||||
$ticket_data['dod'] = null;
|
$ticket_data['dod'] = null;
|
||||||
}else{
|
}else{
|
||||||
$ticket_data['dod'] = change_date_format($ticket_data['dod']);
|
$ticket_data['dod'] = change_date_format($ticket_data['dod'], null, $out_put_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(empty($ticket_data['dob'])){
|
||||||
|
$ticket_data['dob'] = null;
|
||||||
|
}else{
|
||||||
|
$ticket_data['dob'] = change_date_format($ticket_data['dob'], null, $out_put_format);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($ticket_data['date_of_join'])){
|
||||||
|
$ticket_data['date_of_join'] = null;
|
||||||
|
}else{
|
||||||
|
$ticket_data['date_of_join'] = change_date_format($ticket_data['date_of_join'], null, $out_put_format);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($ticket_data['date_of_incep'])){
|
||||||
|
$ticket_data['date_of_incep'] = null;
|
||||||
|
}else{
|
||||||
|
$ticket_data['date_of_incep'] = change_date_format($ticket_data['date_of_incep'], null, $out_put_format);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($ticket_data['date_of_accident'])){
|
||||||
|
$ticket_data['date_of_accident'] = null;
|
||||||
|
}else{
|
||||||
|
$ticket_data['date_of_accident'] = change_date_format($ticket_data['date_of_accident'], null, $out_put_format);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($ticket_data['date_of_death'])){
|
||||||
|
$ticket_data['date_of_death'] = null;
|
||||||
|
}else{
|
||||||
|
$ticket_data['date_of_death'] = change_date_format($ticket_data['date_of_death'], null, $out_put_format);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($ticket_data['date_of_intimat'])){
|
||||||
|
$ticket_data['date_of_intimat'] = null;
|
||||||
|
}else{
|
||||||
|
$ticket_data['date_of_intimat'] = change_date_format($ticket_data['date_of_intimat'], null, $out_put_format);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ticket_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createTicket()
|
||||||
|
{
|
||||||
|
$ticket_data = $this->request->getPost();
|
||||||
|
$ticket_data = $this->formatDateForClaim($ticket_data);
|
||||||
// print_rr($ticket_data); die;
|
// print_rr($ticket_data); die;
|
||||||
|
|
||||||
if($ticket_data){
|
if($ticket_data){
|
||||||
@ -230,7 +278,22 @@ class TicketController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function updateTicket()
|
public function updateTicket()
|
||||||
{
|
{
|
||||||
|
$ticket_id = $this->request->getPost('ticket_master_id');
|
||||||
|
$ticket_data = $this->request->getPost();
|
||||||
|
$ticket_data = $this->formatDateForClaim($ticket_data);
|
||||||
|
// print_rr($ticket_data); die;
|
||||||
|
|
||||||
|
if($ticket_data){
|
||||||
|
$return_value = $this->ticketMasterModel->where('id', $ticket_id)->set($ticket_data)->update();
|
||||||
|
if($return_value){
|
||||||
|
return $this->respond(['status' => true, 'code' => 200, 'data' => $ticket_data, "message" => "Claim updated successfully"], 200);
|
||||||
|
} else {
|
||||||
|
return $this->respond(['status' => false, 'code' => 404, 'message' => 'Failed to update claim'], 200);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return $this->respond(['status' => false, 'code' => 404, 'message' => 'claim data not found'], 200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function mailTemplate()
|
public function mailTemplate()
|
||||||
|
|||||||
@ -758,7 +758,7 @@ class PolicyTransactionModel extends Model
|
|||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
(
|
(
|
||||||
SUM(co_share_stmt_details.actual_bp_amt) + SUM(co_share_stmt_details.actual_tp_amt) + SUM(co_share_stmt_details.actual_bp_per)
|
SUM(co_share_stmt_details.actual_bp_amt) + SUM(co_share_stmt_details.actual_tp_amt) + SUM(co_share_stmt_details.actual_tep_amt)
|
||||||
) AS total_stmt_amt
|
) AS total_stmt_amt
|
||||||
FROM
|
FROM
|
||||||
co_share_stmt_details
|
co_share_stmt_details
|
||||||
@ -778,7 +778,7 @@ class PolicyTransactionModel extends Model
|
|||||||
SELECT
|
SELECT
|
||||||
SUM(co_share_stmt_details.actual_bp_amt) +
|
SUM(co_share_stmt_details.actual_bp_amt) +
|
||||||
SUM(co_share_stmt_details.actual_tp_amt) +
|
SUM(co_share_stmt_details.actual_tp_amt) +
|
||||||
SUM(co_share_stmt_details.actual_bp_per)
|
SUM(co_share_stmt_details.actual_tep_amt)
|
||||||
FROM
|
FROM
|
||||||
co_share_stmt_details
|
co_share_stmt_details
|
||||||
JOIN
|
JOIN
|
||||||
|
|||||||
@ -48,7 +48,9 @@ class TicketMasterModel extends Model
|
|||||||
'date_of_intimat',
|
'date_of_intimat',
|
||||||
'si_amt',
|
'si_amt',
|
||||||
'is_active',
|
'is_active',
|
||||||
'claim_number'
|
'claim_number',
|
||||||
|
'emp_id',
|
||||||
|
'insured_emp_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -22,25 +22,29 @@
|
|||||||
<!-- Navigation Tabs -->
|
<!-- Navigation Tabs -->
|
||||||
<ul class="nav nav-pills navtab-bg">
|
<ul class="nav nav-pills navtab-bg">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#general-tab" data-toggle="tab" class="nav-link px-2 py-1 active" id="general_tab" aria-expanded="true">
|
<a href="#general-tab" data-toggle="tab" class="nav-link px-2 py-1 active" id="general_tab"
|
||||||
|
aria-expanded="true">
|
||||||
<i class="mdi mdi-contacts mr-1"></i>
|
<i class="mdi mdi-contacts mr-1"></i>
|
||||||
<span class="d-none d-sm-inline-block">General</span>
|
<span class="d-none d-sm-inline-block">General</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#reply-tab" data-toggle="tab" class="nav-link px-2 py-1" id="reply_tab" aria-expanded="false">
|
<a href="#reply-tab" data-toggle="tab" class="nav-link px-2 py-1" id="reply_tab"
|
||||||
|
aria-expanded="false">
|
||||||
<i class="fa fa-file mr-1"></i>
|
<i class="fa fa-file mr-1"></i>
|
||||||
<span class="d-none d-sm-inline-block">Reply</span>
|
<span class="d-none d-sm-inline-block">Reply</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#note-tab" data-toggle="tab" class="nav-link px-2 py-1" id="note_tab" aria-expanded="false">
|
<a href="#note-tab" data-toggle="tab" class="nav-link px-2 py-1" id="note_tab"
|
||||||
|
aria-expanded="false">
|
||||||
<i class="mdi mdi-account-switch mr-1"></i>
|
<i class="mdi mdi-account-switch mr-1"></i>
|
||||||
<span class="d-none d-sm-inline-block">Note</span>
|
<span class="d-none d-sm-inline-block">Note</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#history-tab" data-toggle="tab" class="nav-link px-2 py-1" id="history_tab" aria-expanded="false">
|
<a href="#history-tab" data-toggle="tab" class="nav-link px-2 py-1" id="history_tab"
|
||||||
|
aria-expanded="false">
|
||||||
<i class="mdi mdi-source-branch mr-1"></i>
|
<i class="mdi mdi-source-branch mr-1"></i>
|
||||||
<span class="d-none d-sm-inline-block">History</span>
|
<span class="d-none d-sm-inline-block">History</span>
|
||||||
</a>
|
</a>
|
||||||
@ -50,7 +54,14 @@
|
|||||||
<!-- Tab Content -->
|
<!-- Tab Content -->
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane fade show active" id="general-tab">
|
<div class="tab-pane fade show active" id="general-tab">
|
||||||
<?php include('ticket_form_gpa.php'); ?>
|
<?php
|
||||||
|
|
||||||
|
if ($ticket_data['ticket_type_id'] == 1) {
|
||||||
|
include('ticket_form_gmc.php');
|
||||||
|
} else {
|
||||||
|
include('ticket_form_gpa.php');
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" id="reply-tab">
|
<div class="tab-pane fade" id="reply-tab">
|
||||||
<?php include('ticket_reply.php'); ?>
|
<?php include('ticket_reply.php'); ?>
|
||||||
@ -69,4 +80,51 @@
|
|||||||
|
|
||||||
<div id="ticket_conversation_div">
|
<div id="ticket_conversation_div">
|
||||||
<?php include("ticket_conversation.php") ?>
|
<?php include("ticket_conversation.php") ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function submitClaimForm(event, form) {
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
const formAction = '<?= base_url("ticket/update"); ?>';
|
||||||
|
|
||||||
|
// Show loader
|
||||||
|
$('.loader').fadeIn();
|
||||||
|
$('.loader-mask').fadeIn();
|
||||||
|
|
||||||
|
// Collect IDs and form data
|
||||||
|
const formData = new FormData(form);
|
||||||
|
|
||||||
|
// AJAX request
|
||||||
|
$.ajax({
|
||||||
|
data: formData,
|
||||||
|
url: formAction,
|
||||||
|
type: "POST",
|
||||||
|
dataType: 'json',
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
success: function(response) {
|
||||||
|
// Hide loader
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
|
||||||
|
console.log('Form submitted response:', response);
|
||||||
|
|
||||||
|
if (response.status === true) {
|
||||||
|
toastr.success(response.message, 'SUCCESS');
|
||||||
|
} else {
|
||||||
|
toastr.error(response.message, 'ERROR');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
console.error(status, error);
|
||||||
|
|
||||||
|
// Hide loader
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -1,8 +1,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="<?= isset($ticket_form) ? "card" : "" ?>" style="margin-right: 23px;">
|
<div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?php if(isset($ticket_form)){ ?>
|
<?php if(!isset($ticket_data)){ ?>
|
||||||
<!-- Header Section -->
|
<!-- Header Section -->
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-6 d-flex align-items-center">
|
<div class="col-6 d-flex align-items-center">
|
||||||
@ -15,9 +15,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<form role="form" class="parsley-examples" method="post" id="ticket_form_gmc" enctype="multipart/form-data">
|
<form role="form" class="parsley-examples" method="post" id="ticket_form_gmc" onsubmit="submitClaimForm(event, this)" enctype="multipart/form-data">
|
||||||
|
|
||||||
<input type="hidden" id="ticket_type_id" name="ticket_type_id" value="1">
|
<input type="hidden" id="ticket_type_id" name="ticket_type_id" value="1">
|
||||||
|
<input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
@ -29,7 +30,8 @@
|
|||||||
<?php
|
<?php
|
||||||
if (isset($claim_status) && count($claim_status)) {
|
if (isset($claim_status) && count($claim_status)) {
|
||||||
foreach ($claim_status as $key => $value) {
|
foreach ($claim_status as $key => $value) {
|
||||||
echo "<option value=" . $value['id'] . ">" . $value['claim_status'] . "</option>";
|
$selected = (isset($ticket_data) && $ticket_data['claim_status_id'] == $value['id']) ? 'selected' : '';
|
||||||
|
echo "<option value=" . $value['id'] . " $selected>" . $value['claim_status'] . "</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -43,7 +45,8 @@
|
|||||||
<?php
|
<?php
|
||||||
if (isset($priorityType) && count($priorityType)) {
|
if (isset($priorityType) && count($priorityType)) {
|
||||||
foreach ($priorityType as $key => $value) {
|
foreach ($priorityType as $key => $value) {
|
||||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
$selected = (isset($ticket_data) && $ticket_data['priority'] == $key) ? 'selected' : '';
|
||||||
|
echo "<option value=" . $key . " $selected>" . $value . "</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -57,7 +60,8 @@
|
|||||||
<?php
|
<?php
|
||||||
if (isset($acms) && count($acms)) {
|
if (isset($acms) && count($acms)) {
|
||||||
foreach ($acms as $key => $value) {
|
foreach ($acms as $key => $value) {
|
||||||
echo "<option value=" . $value['id'] . ">" . $value['first_name'] . "</option>";
|
$selected = (isset($ticket_data) && $ticket_data['acm_id'] == $value['id']) ? 'selected' : '';
|
||||||
|
echo "<option value=" . $value['id'] . " $selected >" . $value['first_name'] . "</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -67,26 +71,26 @@
|
|||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="policy_no">Policy No<span class="text-danger"></span></label>
|
<label for="policy_no">Policy No<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="policy_no"
|
<input type="text" class="form-control" id="policy_no"
|
||||||
value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>"
|
value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>"
|
||||||
name="policy_no" placeholder="Policy Number" readonly>
|
name="policy_no" placeholder="Policy Number" >
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="insurer_id">Insurer<span class="text-danger"></span></label>
|
<label for="insurer_id">Insurer<span class="text-danger"></span></label>
|
||||||
<input type=hidden id="insurer_id" name="insurer_id">
|
<input type=hidden id="insurer_id" name="insurer_id" value="<?= isset($ticket_data['insurer_id']) ? $ticket_data['insurer_id'] : '' ?>">
|
||||||
<input type=text class="form-control" id="insurer_name" placeholder="Insurer" readonly>
|
<input type=text class="form-control" id="insurer_name" placeholder="Insurer" value="<?= isset($ticket_data['insurer_name']) ? $ticket_data['insurer_name'] : '' ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="tpa_id">TPA<span class="text-danger"></span></label>
|
<label for="tpa_id">TPA<span class="text-danger"></span></label>
|
||||||
<input type=hidden id="tpa_id" name="tpa_id">
|
<input type=hidden id="tpa_id" name="tpa_id" value="<?= isset($ticket_data['tpa_id']) ? $ticket_data['tpa_id'] : '' ?>">
|
||||||
<input type=text class="form-control" id="tpa_name" placeholder="TPA" readonly>
|
<input type=text class="form-control" id="tpa_name" placeholder="TPA" value="<?= isset($ticket_data['tpa_name']) ? $ticket_data['tpa_name'] : '' ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="client_name">Corporate Name<span class="text-danger"></span></label>
|
<label for="client_name">Corporate Name<span class="text-danger"></span></label>
|
||||||
<input type="hidden" id="client_id" name="client_id">
|
<input type="hidden" id="client_id" name="client_id" value="<?= isset($ticket_data['client_id']) ? $ticket_data['client_id'] : '' ?>">
|
||||||
<input type="text" class="form-control" id="client_name" placeholder="Client" readonly>
|
<input type="text" class="form-control" id="client_name" placeholder="Client" value="<?= isset($ticket_data['client_name']) ? $ticket_data['client_name'] : '' ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
@ -94,29 +98,29 @@
|
|||||||
aria-hidden="true" onclick="openFetchEmpDataodal(this)"></i> <span
|
aria-hidden="true" onclick="openFetchEmpDataodal(this)"></i> <span
|
||||||
class="text-danger"></span></label>
|
class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="emp_code" placeholder="Enter Employee ID"
|
<input type="text" class="form-control" id="emp_code" placeholder="Enter Employee ID"
|
||||||
value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>"
|
value="<?= isset($ticket_data['emp_code']) ? $ticket_data['emp_code'] : '' ?>"
|
||||||
name="emp_code">
|
name="emp_code">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="tpa_id">TPA ID<span class="text-danger"></span></label>
|
<label for="tpa_id">TPA ID<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="tpa_no" placeholder="Enter TPA ID"
|
<input type="text" class="form-control" id="tpa_no" placeholder="Enter TPA ID"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
|
value="<?= isset($ticket_data['tpa_no']) ? $ticket_data['tpa_no'] : '' ?>"
|
||||||
name="tpa_no">
|
name="tpa_no">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="emp_name">Employee Name<span class="text-danger"></span></label>
|
<label for="emp_name">Employee Name<span class="text-danger"></span></label>
|
||||||
<input type=hidden id="emp_id" name="emp_id">
|
<input type=hidden id="emp_id" name="emp_id" value="<?= isset($ticket_data['emp_id']) ? $ticket_data['emp_id'] : '' ?>">
|
||||||
<input type="text" class="form-control" id="emp_name" placeholder="Enter Employee Name"
|
<input type="text" class="form-control" id="emp_name" placeholder="Enter Employee Name"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
|
value="<?= isset($ticket_data['emp_name']) ? $ticket_data['emp_name'] : '' ?>"
|
||||||
name="emp_name">
|
name="emp_name">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="insured_name"> Insured Name <span class="text-danger"></span></label>
|
<label for="insured_name"> Insured Name <span class="text-danger"></span></label>
|
||||||
<input type=hidden id="insured_emp_id" name="insured_emp_id">
|
<input type=hidden id="insured_emp_id" name="insured_emp_id" value="<?= isset($ticket_data['insured_emp_id']) ? $ticket_data['insured_emp_id'] : '' ?>">
|
||||||
<input class="form-control" id="insured_name" name="insured_name">
|
<input class="form-control" id="insured_name" name="insured_name" value="<?= isset($ticket_data['insured_name']) ? $ticket_data['insured_name'] : '' ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
@ -126,7 +130,8 @@
|
|||||||
<?php
|
<?php
|
||||||
if (isset($relationshipType) && count($relationshipType)) {
|
if (isset($relationshipType) && count($relationshipType)) {
|
||||||
foreach ($relationshipType as $key => $value) {
|
foreach ($relationshipType as $key => $value) {
|
||||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
$selected = (isset($ticket_data) && $ticket_data['relationship'] == $key) ? 'selected' : '';
|
||||||
|
echo "<option value='$key' $selected>$value</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -134,16 +139,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="client_name">Employee Mobile No<span class="text-danger"></span></label>
|
<label for="emp_mobile">Employee Mobile No<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="emp_mobile" placeholder="Enter EMP Mobile"
|
<input type="text" class="form-control" id="emp_mobile" placeholder="Enter EMP Mobile"
|
||||||
value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>"
|
value="<?= isset($ticket_data['emp_mobile']) ? $ticket_data['emp_mobile'] : '' ?>"
|
||||||
name="emp_mobile">
|
name="emp_mobile">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="emp_mail">Employee Mail ID<span class="text-danger"></span></label>
|
<label for="emp_mail">Employee Mail ID<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="emp_mail" placeholder="Enter EMP Mail"
|
<input type="text" class="form-control" id="emp_mail" placeholder="Enter EMP Mail"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
|
value="<?= isset($ticket_data['emp_mail']) ? $ticket_data['emp_mail'] : '' ?>"
|
||||||
name="emp_mail">
|
name="emp_mail">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -155,7 +160,8 @@
|
|||||||
<?php
|
<?php
|
||||||
if (isset($modeOFIntimate) && count($modeOFIntimate)) {
|
if (isset($modeOFIntimate) && count($modeOFIntimate)) {
|
||||||
foreach ($modeOFIntimate as $key => $value) {
|
foreach ($modeOFIntimate as $key => $value) {
|
||||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
$selected = (isset($ticket_data) && $ticket_data['mode_of_intimation'] == $key) ? 'selected' : '';
|
||||||
|
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -167,8 +173,9 @@
|
|||||||
<select class="form-control" id="claim_type" name="claim_type">
|
<select class="form-control" id="claim_type" name="claim_type">
|
||||||
<option value="0">Select claim Type</option>
|
<option value="0">Select claim Type</option>
|
||||||
<?php
|
<?php
|
||||||
if (isset($modeOFIntimate) && count($modeOFIntimate)) {
|
if (isset($claim_type) && count($claim_type)) {
|
||||||
foreach ($modeOFIntimate as $key => $value) {
|
foreach ($claim_type as $key => $value) {
|
||||||
|
$selected = (isset($ticket_data) && $ticket_data['claim_type'] == $key) ? 'selected' : '';
|
||||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,42 +187,42 @@
|
|||||||
<label for="hospital_name">Hospital Name<span class="text-danger"></span></label>
|
<label for="hospital_name">Hospital Name<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="hospital_name"
|
<input type="text" class="form-control" id="hospital_name"
|
||||||
placeholder="Enter Hospital Name"
|
placeholder="Enter Hospital Name"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
|
value="<?= isset($ticket_data['hospital_name']) ? $ticket_data['hospital_name'] : '' ?>"
|
||||||
name="hospital_name">
|
name="hospital_name">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="doa">DOA<span class="text-danger"></span></label>
|
<label for="doa">DOA<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="doa" placeholder="Enter DOA"
|
<input type="text" class="form-control" id="doa" placeholder="Enter DOA"
|
||||||
value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>"
|
value="<?= isset($ticket_data['doa']) ? $ticket_data['doa'] : '' ?>"
|
||||||
name="doa">
|
name="doa">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="dod">DOD<span class="text-danger"></span></label>
|
<label for="dod">DOD<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="dod" placeholder="Enter DOD"
|
<input type="text" class="form-control" id="dod" placeholder="Enter DOD"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>" name="dod">
|
value="<?= isset($ticket_data['dod']) ? $ticket_data['dod'] : '' ?>" name="dod">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="claim_amount">Claim Amount<span class="text-danger"></span></label>
|
<label for="claim_amount">Claim Amount<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="claim_amount"
|
<input type="text" class="form-control" id="claim_amount"
|
||||||
placeholder="Enter Claim Amount"
|
placeholder="Enter Claim Amount"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
|
value="<?= isset($ticket_data['claim_amount']) ? $ticket_data['claim_amount'] : '' ?>"
|
||||||
name="claim_amount">
|
name="claim_amount">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="pod_no">POD No<span class="text-danger"></span></label>
|
<label for="pod_no">POD No<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="pod_no" placeholder="Enter POD NO"
|
<input type="text" class="form-control" id="pod_no" placeholder="Enter POD NO"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
|
value="<?= isset($ticket_data['pod_no']) ? $ticket_data['pod_no'] : '' ?>"
|
||||||
name="pod_no">
|
name="pod_no">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-12 text-right m-b-0" style="margin-top: 29px;">
|
<div class="form-group col-md-12 text-right m-b-0" style="margin-top: 29px;">
|
||||||
<a href="#" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit" onclick="claimFormSubmit('ticket_form_gmc')">Submit</a>
|
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit" >Submit</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -8,9 +8,9 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="<?= isset($ticket_form) ? "card" : "" ?>" style="margin-right: 23px;">
|
<div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?php if(isset($ticket_form)){ ?>
|
<?php if(!isset($ticket_data)){ ?>
|
||||||
<!-- Header Section -->
|
<!-- Header Section -->
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-6 d-flex align-items-center">
|
<div class="col-6 d-flex align-items-center">
|
||||||
@ -23,19 +23,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<form role="form" class="parsley-examples" method="post" id="ticket_form_gmc"
|
<form role="form" class="parsley-examples" method="post" id="ticket_form_gmc" onsubmit="submitClaimForm(event, this)"
|
||||||
enctype="multipart/form-data">
|
enctype="multipart/form-data">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>">
|
||||||
|
|
||||||
|
<div class="form-group col-md-3">
|
||||||
<label for="claim_status">Status<span class="text-danger"></span></label>
|
<label for="claim_status">Status<span class="text-danger"></span></label>
|
||||||
<select class="form-control" id="claim_status" name="claim_status">
|
<select class="form-control" id="claim_status_id" name="claim_status_id">
|
||||||
<option value="0">Select status</option>
|
<option value="0">Select status</option>
|
||||||
<?php
|
<?php
|
||||||
if (isset($claim_status) && count($claim_status)) {
|
if (isset($claim_status) && count($claim_status)) {
|
||||||
foreach ($claim_status as $key => $value) {
|
foreach ($claim_status as $key => $value) {
|
||||||
echo "<option value=" . $value['id'] . ">" . $value['status'] . "</option>";
|
$selected = (isset($ticket_data) && $ticket_data['claim_status_id'] == $value['id']) ? 'selected' : '';
|
||||||
|
echo "<option value=" . $value['id'] . " $selected>" . $value['claim_status'] . "</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -47,9 +50,10 @@
|
|||||||
<select class="form-control" id="acm_id" name="acm_id">
|
<select class="form-control" id="acm_id" name="acm_id">
|
||||||
<option value="0">Select Account Manager</option>
|
<option value="0">Select Account Manager</option>
|
||||||
<?php
|
<?php
|
||||||
if (isset($claim_status) && count($claim_status)) {
|
if (isset($acms) && count($acms)) {
|
||||||
foreach ($claim_status as $key => $value) {
|
foreach ($acms as $key => $value) {
|
||||||
echo "<option value=" . $value['id'] . ">" . $value['status'] . "</option>";
|
$selected = (isset($ticket_data) && $ticket_data['acm_id'] == $value['id']) ? 'selected' : '';
|
||||||
|
echo "<option value=" . $value['id'] . " $selected>" . $value['first_name'] . "</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -58,37 +62,21 @@
|
|||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="client_name">Corporate Name<span class="text-danger"></span></label>
|
<label for="client_name">Corporate Name<span class="text-danger"></span></label>
|
||||||
<select class="form-control" id="client_id" name="client_id">
|
<input type="hidden" id="client_id" name="client_id" value="<?= isset($ticket_data['client_id']) ? $ticket_data['client_id'] : '' ?>">
|
||||||
<option value="0">Select Corporate</option>
|
<input type="text" class="form-control" id="client_name" placeholder="Client" value="<?= isset($ticket_data['client_name']) ? $ticket_data['client_name'] : '' ?>">
|
||||||
<?php
|
|
||||||
if (isset($claim_status) && count($claim_status)) {
|
|
||||||
foreach ($claim_status as $key => $value) {
|
|
||||||
echo "<option value=" . $value['id'] . ">" . $value['client_name'] . "</option>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="acm_id">Insurer<span class="text-danger"></span></label>
|
<label for="insurer_id">Insurer<span class="text-danger"></span></label>
|
||||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
<input type=hidden id="insurer_id" name="insurer_id" value="<?= isset($ticket_data['insurer_id']) ? $ticket_data['insurer_id'] : '' ?>">
|
||||||
<option value="0">Select insurer</option>
|
<input type=text class="form-control" id="insurer_name" placeholder="Insurer" value="<?= isset($ticket_data['insurer_name']) ? $ticket_data['insurer_name'] : '' ?>">
|
||||||
<?php
|
|
||||||
if (isset($claim_status) && count($claim_status)) {
|
|
||||||
foreach ($claim_status as $key => $value) {
|
|
||||||
echo "<option value=" . $value['id'] . ">" . $value['status'] . "</option>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="policy_no">Policy No<span class="text-danger"></span></label>
|
<label for="policy_no">Policy No<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="policy_no"
|
<input type="text" class="form-control" id="policy_no"
|
||||||
value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>"
|
value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>"
|
||||||
name="policy_no">
|
name="policy_no" readonly>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
@ -98,7 +86,8 @@
|
|||||||
if (isset($ticket_type) && count($ticket_type)) {
|
if (isset($ticket_type) && count($ticket_type)) {
|
||||||
foreach ($ticket_type as $key => $value) {
|
foreach ($ticket_type as $key => $value) {
|
||||||
if($key != 1){
|
if($key != 1){
|
||||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
$selected = (isset($ticket_data) && $ticket_data['ticket_type_id'] == $key) ? 'selected' : '';
|
||||||
|
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,13 +96,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="ticket_type"> Claim Type <span class="text-danger"></span></label>
|
<label for="claim_type"> Claim Type <span class="text-danger"></span></label>
|
||||||
<select class="form-control" id="ticket_type" name="ticket_type">
|
<select class="form-control" id="claim_type" name="claim_type">
|
||||||
<option value="0">Select claim Type</option>
|
<option value="0">Select claim Type</option>
|
||||||
<?php
|
<?php
|
||||||
if (isset($ticket_type) && count($ticket_type)) {
|
if (isset($claim_type) && count($claim_type)) {
|
||||||
foreach ($ticket_type as $key => $value) {
|
foreach ($claim_type as $key => $value) {
|
||||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
$selected = (isset($ticket_data) && $ticket_data['claim_type'] == $key) ? 'selected' : '';
|
||||||
|
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -121,17 +111,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="emp_code">Employee ID<span class="text-danger"></span></label>
|
<label for="emp_code">Employee ID <i class="fa fa-search text-danger"
|
||||||
|
aria-hidden="true" onclick="openFetchEmpDataodal(this)"></i> <span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="emp_code" placeholder="Enter Employee ID"
|
<input type="text" class="form-control" id="emp_code" placeholder="Enter Employee ID"
|
||||||
value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>"
|
value="<?= isset($ticket_data['emp_code']) ? $ticket_data['emp_code'] : '' ?>"
|
||||||
name="emp_code">
|
name="emp_code">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="emp_name">Employee Name<span class="text-danger"></span></label>
|
<label for="emp_name">Employee Name<span class="text-danger"></span></label>
|
||||||
|
<input type=hidden id="emp_id" name="emp_id" value="<?= isset($ticket_data['emp_id']) ? $ticket_data['emp_id'] : '' ?>">
|
||||||
<input type="text" class="form-control" id="emp_name" placeholder="Enter Employee Name"
|
<input type="text" class="form-control" id="emp_name" placeholder="Enter Employee Name"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
|
value="<?= isset($ticket_data['emp_name']) ? $ticket_data['emp_name'] : '' ?>"
|
||||||
name="emp_name">
|
name="emp_name">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -140,7 +132,7 @@
|
|||||||
<label for="date_of_join">Date of joining<span class="text-danger"></span></label>
|
<label for="date_of_join">Date of joining<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="date_of_join"
|
<input type="text" class="form-control" id="date_of_join"
|
||||||
placeholder="Enter Joining Date"
|
placeholder="Enter Joining Date"
|
||||||
value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>"
|
value="<?= isset($ticket_data['date_of_join']) ? $ticket_data['date_of_join'] : '' ?>"
|
||||||
name="date_of_join">
|
name="date_of_join">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -148,21 +140,21 @@
|
|||||||
<label for="date_of_incep">Date of Inception<span class="text-danger"></span></label>
|
<label for="date_of_incep">Date of Inception<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="date_of_incep"
|
<input type="text" class="form-control" id="date_of_incep"
|
||||||
placeholder="Enter Inception Date"
|
placeholder="Enter Inception Date"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
|
value="<?= isset($ticket_data['date_of_incep']) ? $ticket_data['date_of_incep'] : '' ?>"
|
||||||
name="date_of_incep">
|
name="date_of_incep">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="dob">Date of Birth<span class="text-danger"></span></label>
|
<label for="dob">Date of Birth<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="dob" placeholder="Enter Birth Date"
|
<input type="text" class="form-control" id="dob" placeholder="Enter Birth Date"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>" name="dob">
|
value="<?= isset($ticket_data['dob']) ? $ticket_data['dob'] : '' ?>" name="dob">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="date_of_accident">Date of Accident<span class="text-danger"></span></label>
|
<label for="date_of_accident">Date of Accident<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="date_of_accident"
|
<input type="text" class="form-control" id="date_of_accident"
|
||||||
placeholder="Enter Accident Date"
|
placeholder="Enter Accident Date"
|
||||||
value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>"
|
value="<?= isset($ticket_data['date_of_accident']) ? $ticket_data['date_of_accident'] : '' ?>"
|
||||||
name="date_of_accident">
|
name="date_of_accident">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -170,7 +162,7 @@
|
|||||||
<label for="date_of_death">Date of Death<span class="text-danger"></span></label>
|
<label for="date_of_death">Date of Death<span class="text-danger"></span></label>
|
||||||
<input type="date_of_death" class="form-control" id="date_of_death"
|
<input type="date_of_death" class="form-control" id="date_of_death"
|
||||||
placeholder="Enter Death Date"
|
placeholder="Enter Death Date"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
|
value="<?= isset($ticket_data['date_of_death']) ? $ticket_data['date_of_death'] : '' ?>"
|
||||||
name="date_of_death">
|
name="date_of_death">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -178,14 +170,14 @@
|
|||||||
<label for="date_of_intimat">Date of Intimation<span class="text-danger"></span></label>
|
<label for="date_of_intimat">Date of Intimation<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="date_of_intimat"
|
<input type="text" class="form-control" id="date_of_intimat"
|
||||||
placeholder="Enter Intimation Date"
|
placeholder="Enter Intimation Date"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
|
value="<?= isset($ticket_data['date_of_intimat']) ? $ticket_data['date_of_intimat'] : '' ?>"
|
||||||
name="date_of_intimat">
|
name="date_of_intimat">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="si_amt">Sum insured<span class="text-danger"></span></label>
|
<label for="si_amt">Sum insured<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="si_amt" placeholder="Enter SI"
|
<input type="text" class="form-control" id="si_amt" placeholder="Enter SI"
|
||||||
value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
|
value="<?= isset($ticket_data['si_amt']) ? $ticket_data['si_amt'] : '' ?>"
|
||||||
name="si_amt">
|
name="si_amt">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -199,4 +191,39 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
var date_of_join = flatpickr("#date_of_join", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
|
||||||
|
var dob = flatpickr("#dob", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
|
||||||
|
var date_of_incep = flatpickr("#date_of_incep", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
|
||||||
|
var date_of_accident = flatpickr("#date_of_accident", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
|
||||||
|
var date_of_death = flatpickr("#date_of_death", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
|
||||||
|
var date_of_intimat = flatpickr("#date_of_intimat", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@ -147,8 +147,8 @@ if ($ticket_form == 1) {
|
|||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Branch</label>
|
<label>Branch</label>
|
||||||
<select id="branch" name="branch" class="form-control custom-select"
|
<select id="emp_client_branch_data_list" name="branch"
|
||||||
onchange="get_policies_list(this)">
|
class="form-control custom-select" onchange="get_policies_list(this)">
|
||||||
<option value="">Select Branch</option>
|
<option value="">Select Branch</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -156,8 +156,8 @@ if ($ticket_form == 1) {
|
|||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Policy</label>
|
<label>Policy</label>
|
||||||
<select id="policy_client_branch" name="policy_client_branch"
|
<select id="emp_client_policy_data_list" name="policy_client_branch"
|
||||||
class="form-control custom-select" onchange="get_employee_list(this)">
|
class="form-control custom-select" onchange="getEmpData(this)">
|
||||||
<option value="">Select Policy</option>
|
<option value="">Select Policy</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -267,38 +267,146 @@ function appendClients(data) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function appendBranch(data) {
|
||||||
|
$('#emp_client_branch_data_list').empty();
|
||||||
|
|
||||||
function claimFormSubmit($form_id) {
|
$('#emp_client_branch_data_list').append($('<option>', {
|
||||||
|
value: '',
|
||||||
|
text: 'Select Branch'
|
||||||
|
}));
|
||||||
|
|
||||||
console.log('claimFormSubmit function called')
|
$.each(data, function(index, item) {
|
||||||
|
var option = $('<option>', {
|
||||||
|
value: item.id,
|
||||||
|
text: item.branch_name,
|
||||||
|
'data-name': item.branch_name,
|
||||||
|
});
|
||||||
|
|
||||||
console.log('$form_id ', $form_id)
|
$('#emp_client_branch_data_list').append(option);
|
||||||
|
|
||||||
let url = '<?= base_url('/ticket/create') ?>';
|
|
||||||
console.log('url ', url)
|
|
||||||
|
|
||||||
|
|
||||||
// Data to send in the AJAX request
|
|
||||||
var formData = new FormData($('#'+$form_id)[0]);
|
|
||||||
console.log('formData ', formData)
|
|
||||||
|
|
||||||
|
|
||||||
// Send AJAX request
|
|
||||||
sendAjaxRequestForGlobal(url, 'POST', formData, function(response) {
|
|
||||||
|
|
||||||
console.log('Form submitted response:', response);
|
|
||||||
|
|
||||||
if (response.status == true) {
|
|
||||||
toastr.success(response.message, 'SUCCESS');
|
|
||||||
} else {
|
|
||||||
toastr.error(response.message, 'ERROR');
|
|
||||||
}
|
|
||||||
|
|
||||||
}, function(xhr, status, error) {
|
|
||||||
console.error('Error fetching data:', error);
|
|
||||||
console.error(xhr.responseText);
|
|
||||||
toastr.error('An error occurred while form submiting.', 'ERROR');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function appendPolicy(data) {
|
||||||
|
|
||||||
|
$('#emp_client_policy_data_list').empty();
|
||||||
|
|
||||||
|
$('#emp_client_policy_data_list').append($('<option>', {
|
||||||
|
value: '',
|
||||||
|
text: 'Select Policy'
|
||||||
|
}));
|
||||||
|
|
||||||
|
$.each(data, function(index, item) {
|
||||||
|
var option = $('<option>', {
|
||||||
|
value: item.id,
|
||||||
|
text: item.policy_type + '-' + item.policy_no,
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#emp_client_policy_data_list').append(option);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitClaimForm(event, form) {
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
const formAction = '<?= base_url("ticket/create"); ?>';
|
||||||
|
|
||||||
|
// Show loader
|
||||||
|
$('.loader').fadeIn();
|
||||||
|
$('.loader-mask').fadeIn();
|
||||||
|
|
||||||
|
// Collect IDs and form data
|
||||||
|
const formData = new FormData(form);
|
||||||
|
|
||||||
|
// AJAX request
|
||||||
|
$.ajax({
|
||||||
|
data: formData,
|
||||||
|
url: formAction,
|
||||||
|
type: "POST",
|
||||||
|
dataType: 'json',
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
success: function(response) {
|
||||||
|
// Hide loader
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
|
||||||
|
console.log('Form submitted response:', response);
|
||||||
|
|
||||||
|
if (response.status === true) {
|
||||||
|
toastr.success(response.message, 'SUCCESS');
|
||||||
|
} else {
|
||||||
|
toastr.error(response.message, 'ERROR');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
console.error(status, error);
|
||||||
|
|
||||||
|
// Hide loader
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#emp_client_data_list').change(function() {
|
||||||
|
|
||||||
|
let client_id = $(this).val();
|
||||||
|
let client_name = $('#emp_client_data_list option:selected').data('name');
|
||||||
|
|
||||||
|
console.log('client_id', client_id);
|
||||||
|
console.log('client_name', client_name);
|
||||||
|
|
||||||
|
if (branch_list != '') {
|
||||||
|
// console.log(branch_list[client_id]);
|
||||||
|
let data = branch_list[client_id];
|
||||||
|
appendBranch(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#emp_client_branch_data_list').change(function() {
|
||||||
|
|
||||||
|
let branch_id = $(this).val();
|
||||||
|
|
||||||
|
console.log('branch_id', branch_id);
|
||||||
|
|
||||||
|
if (policy_list != '') {
|
||||||
|
// console.log(branch_list[client_id]);
|
||||||
|
let data = policy_list[branch_id];
|
||||||
|
appendPolicy(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
function getEmpData(input) {
|
||||||
|
|
||||||
|
console.log(input)
|
||||||
|
let client_policy_id = $(input).val();
|
||||||
|
|
||||||
|
let url = '<?= base_url('util/getTheEmpDataForClaim/') ?>' + client_policy_id;
|
||||||
|
|
||||||
|
// Data to send in the AJAX request
|
||||||
|
let requestData = {
|
||||||
|
client_policy_id: client_policy_id,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Send AJAX request
|
||||||
|
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
|
||||||
|
console.log('Data fetched successfully:', response);
|
||||||
|
|
||||||
|
if (response.status) {
|
||||||
|
toastr.success(response.message, 'SUCCESS');
|
||||||
|
} else {
|
||||||
|
toastr.warning(response.message, 'WARNING');
|
||||||
|
}
|
||||||
|
}, function(xhr, status, error) {
|
||||||
|
console.error('Error fetching data:', error);
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
toastr.error('An error occurred while fetch data.', 'ERROR');
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user