Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
201ad57974
@ -731,7 +731,7 @@ class TicketController extends BaseController
|
|||||||
$data['claim_type'] = $this->claimType[2];
|
$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");
|
$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->where('id', $ticket_id)->where('is_active', 1)->first();
|
||||||
$ticket_data = $this->ticketMasterModel->getTicketDataByTicketID($ticket_id);
|
$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');
|
$ticket_data = $this->formatDateForClaim($ticket_data, 'd/m/Y');
|
||||||
|
|
||||||
if (in_array($ticket_data['claim_status_id'], [15, 25, 35])) {
|
if (in_array($ticket_data['claim_status_id'], [15, 25, 35])) {
|
||||||
@ -942,22 +934,15 @@ class TicketController extends BaseController
|
|||||||
// print_rr($data); die;
|
// 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){
|
||||||
|
|
||||||
public function motor_claim($ticket_data,$ticket_id)
|
|
||||||
{
|
|
||||||
$claim_status_id = $ticket_data['claim_status_id'];
|
$claim_status_id = $ticket_data['claim_status_id'];
|
||||||
$ticket_type = $ticket_data['ticket_type_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['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();
|
$data['client_for_motor'] = $this->clientModel->select('id,client_name,phone')->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')
|
public function formatDateForClaim($ticket_data, $out_put_format = 'Y-m-d')
|
||||||
|
|||||||
@ -14,17 +14,17 @@
|
|||||||
<!-- Optional CSS -->
|
<!-- Optional CSS -->
|
||||||
<style>
|
<style>
|
||||||
/* Make modal really XL and scrollable */
|
/* Make modal really XL and scrollable */
|
||||||
#branchModal .modal-dialog.modal-xl {
|
#insurerBranchModal .modal-dialog.modal-xl {
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
height: 90vh;
|
height: 90vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
#branchModal .modal-content {
|
#insurerBranchModal .modal-content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#branchModal .modal-body {
|
#insurerBranchModal .modal-body {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
max-height: 80vh;
|
max-height: 80vh;
|
||||||
}
|
}
|
||||||
@ -170,7 +170,7 @@
|
|||||||
<!-- end -->
|
<!-- end -->
|
||||||
|
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="branchModal" tabindex="-1" role="dialog" aria-hidden="true">
|
<div class="modal fade" id="insurerBranchModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered modal-xl" style="max-width: 1140px !important;">
|
<div class="modal-dialog modal-dialog-centered modal-xl" style="max-width: 1140px !important;">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<!-- Modal Header -->
|
<!-- Modal Header -->
|
||||||
@ -183,20 +183,25 @@
|
|||||||
|
|
||||||
<!-- Modal Body -->
|
<!-- Modal Body -->
|
||||||
<div class="modal-body" style="overflow-y:auto; max-height:80vh;">
|
<div class="modal-body" style="overflow-y:auto; max-height:80vh;">
|
||||||
<form id="insurer_branch_form" class="parsley-examples" method="post" enctype="multipart/form-data">
|
<form id="insurer_branch_form" role="form" class="parsley-examples" method="post" action="" enctype="multipart/form-data">
|
||||||
<div class="row">
|
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||||
|
<input type="hidden" name="PrimaryKey" id="insurer_Branch_PrimaryKey" />
|
||||||
|
<input type="hidden" name="insurer_id" id="insurer_id_branch" value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>"/>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
<!-- Left Section: Branch Details -->
|
<!-- Left Section: Branch Details -->
|
||||||
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
|
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
|
||||||
<!-- Branch Name & Code -->
|
<!-- Branch Name & Code -->
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="branch_name">Branch Name <span class="text-danger">*</span></label>
|
<label for="branch_name">Branch Name <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="branch_name" name="branch_name" required>
|
<input type="text" class="form-control" id="branch_name"
|
||||||
|
placeholder="Enter Branch Name" name="branch_name" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="branch_code">Branch Code <span class="text-danger">*</span></label>
|
<label for="branch_code">Branch Code <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="branch_code" name="branch_code" required>
|
<input type="text" class="form-control" id="branch_code"
|
||||||
|
placeholder="Enter Branch Code" name="branch_code" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -204,11 +209,11 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="address1">Address Line 1 <span class="text-danger">*</span></label>
|
<label for="address1">Address Line 1 <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="address1" name="address1" required>
|
<input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="address2">Address Line 2</label>
|
<label for="address2">Address Line 2</label>
|
||||||
<input type="text" class="form-control" id="address2" name="address2">
|
<input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -225,7 +230,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="district">District <span class="text-danger">*</span></label>
|
<label for="district">District <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="district" name="district" required>
|
<input type="text" class="form-control" id="district"
|
||||||
|
placeholder="Enter District" name="district" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -233,11 +239,12 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="branch_city">City <span class="text-danger">*</span></label>
|
<label for="branch_city">City <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="branch_city" name="city" required>
|
<input type="text" class="form-control" id="branch_city"
|
||||||
|
placeholder="Enter City" name="city" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="pincode">Pincode <span class="text-danger">*</span></label>
|
<label for="pincode">Pincode <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="pincode" name="pincode" required>
|
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -259,27 +266,38 @@
|
|||||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
<h6 class="modal-subtitle mb-0">Contact 1</h6>
|
<h6 class="modal-subtitle mb-0">Contact 1</h6>
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<i class="mdi mdi-trash-can text-danger" style="cursor:pointer; font-size:24px !important;" onclick="removeContact(this)" id="contact_1_remove"></i>
|
<i class="mdi mdi-trash-can text-danger" style="cursor:pointer; font-size:24px !important;" onclick="removeContact(this)" id="${uniqueId}_remove"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Contact Form Fields -->
|
<!-- Contact Form Fields -->
|
||||||
<input type="hidden" name="primarykey[]" id="contact_id_1" value=""/>
|
<div class="form-row">
|
||||||
<div class="form-group mb-2">
|
<!-- <input type="hidden" name="primarykey[]" id="contact_id_1" value=""/> -->
|
||||||
|
<div class="form-group col-md-12">
|
||||||
<label for="name">Name <span class="text-danger">*</span></label>
|
<label for="name">Name <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
|
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group mb-2">
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-12">
|
||||||
<label for="designation">Designation <span class="text-danger">*</span></label>
|
<label for="designation">Designation <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group mb-2">
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-12">
|
||||||
<label for="email">Email <span class="text-danger">*</span></label>
|
<label for="email">Email <span class="text-danger">*</span></label>
|
||||||
<input type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
|
<input value="" type="email" data-parsley-type="email" data-parsley-trigger="change"class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group mb-2">
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
|
||||||
|
<div class="form-group col-md-12">
|
||||||
<label for="mobile">Mobile <span class="text-danger">*</span></label>
|
<label for="mobile">Mobile <span class="text-danger">*</span></label>
|
||||||
<input type="tel" class="form-control" placeholder="Enter Contact Mobile" pattern="[0-9]{10}" name="mobile[]" id="mobile" required>
|
<!-- <input name="mobile[]" pattern="[0-9]{10}" value="" type="tel" data-parsley-type="number" data-parsley-length="[10,10]" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required> -->
|
||||||
|
<!-- oninput="this.value = this.value.replace(/[^0-9]/g,'');" maxlength="10" -->
|
||||||
|
<input value="" name="mobile[]" value="" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required maxlength="10" inputmode="numeric">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -291,7 +309,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -310,16 +327,17 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
insurer_Branch_PrimaryKey = $('#insurer_id_branch').val();
|
insurer_Branch_PrimaryKey = $('#insurer_id_branch').val();
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
var myModal = new bootstrap.Modal(document.getElementById('insurerBranchModal'));
|
||||||
myModal.hide();
|
myModal.hide();
|
||||||
|
|
||||||
// $('#add_branch').hide();
|
// $('#add_branch').hide();
|
||||||
$('.btnBack').hide();
|
// $('.btnBack').hide();
|
||||||
|
|
||||||
if(insurer_Branch_PrimaryKey !== ''){
|
if(insurer_Branch_PrimaryKey !== ''){
|
||||||
|
|
||||||
var branchTable = '';
|
var branchTable = '';
|
||||||
var data = <?= isset($insuer_branch) ? json_encode($insuer_branch) : '[]' ?>;
|
var data = <?= isset($insuer_branch) ? json_encode($insuer_branch) : '[]' ?>;
|
||||||
|
console.log("insurer branch data", data);
|
||||||
$.each(data, function(index, item) {
|
$.each(data, function(index, item) {
|
||||||
branchTable += `
|
branchTable += `
|
||||||
<tr>
|
<tr>
|
||||||
@ -347,11 +365,11 @@
|
|||||||
$("#insurer_branch_form")[0].reset();
|
$("#insurer_branch_form")[0].reset();
|
||||||
contactCount = 1
|
contactCount = 1
|
||||||
insurer_branch_form_action = '<?= base_url("master/insurer/branch/create"); ?>';
|
insurer_branch_form_action = '<?= base_url("master/insurer/branch/create"); ?>';
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
var myModal = new bootstrap.Modal(document.getElementById('insurerBranchModal'));
|
||||||
myModal.show();
|
myModal.show();
|
||||||
// $('#add_branch').show();
|
// $('#add_branch').show();
|
||||||
// $('#branch_table').hide();
|
// $('#branch_table').hide();
|
||||||
$('.btnBack').show();
|
// $('.btnBack').show();
|
||||||
// $('#btnBranchAdd').hide();
|
// $('#btnBranchAdd').hide();
|
||||||
|
|
||||||
$('#branch_name').val('');
|
$('#branch_name').val('');
|
||||||
@ -391,12 +409,12 @@
|
|||||||
$('.btnBack').click(function(){
|
$('.btnBack').click(function(){
|
||||||
|
|
||||||
$("#insurer_branch_form")[0].reset();
|
$("#insurer_branch_form")[0].reset();
|
||||||
|
|
||||||
contactCount = 1
|
contactCount = 1
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
$('.close').click();
|
||||||
myModal.hide();
|
|
||||||
// $('#add_branch').hide();
|
// $('#add_branch').hide();
|
||||||
// $('#branch_table').show();
|
// $('#branch_table').show();
|
||||||
$('.btnBack').hide();
|
// $('.btnBack').hide();
|
||||||
// $('#btnBranchAdd').show();
|
// $('#btnBranchAdd').show();
|
||||||
|
|
||||||
$('#branch_name').val('');
|
$('#branch_name').val('');
|
||||||
@ -409,6 +427,7 @@
|
|||||||
$('#email').val('');
|
$('#email').val('');
|
||||||
$('#mobile').val('');
|
$('#mobile').val('');
|
||||||
$('#designation').val('');
|
$('#designation').val('');
|
||||||
|
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -430,12 +449,12 @@
|
|||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
|
beforeSend: function() {
|
||||||
|
$('.loader').fadeIn();
|
||||||
|
$('.loader-mask').fadeIn();
|
||||||
|
},
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
$("#insurer_branch_form")[0].reset();
|
$("#insurer_branch_form")[0].reset();
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
|
||||||
}, 1000);
|
|
||||||
console.log(res);
|
console.log(res);
|
||||||
$('#insurer_branch_list tr').remove();
|
$('#insurer_branch_list tr').remove();
|
||||||
var insurerBranchTableInsert = ''
|
var insurerBranchTableInsert = ''
|
||||||
@ -453,9 +472,9 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#insurer_branch_list').append(insurerBranchTableInsert);
|
$('#insurer_branch_list').append(insurerBranchTableInsert);
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||||
myModal.hide();
|
$('.close').click();
|
||||||
|
// window.location.reload();
|
||||||
// $('#add_branch').hide();
|
// $('#add_branch').hide();
|
||||||
// $('#branch_table').show();
|
// $('#branch_table').show();
|
||||||
// $('.btnBack').hide();
|
// $('.btnBack').hide();
|
||||||
@ -471,6 +490,13 @@
|
|||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
toastr.warning('Something Wrong!', 'warning');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
setTimeout(function() {
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
}, 1000);
|
||||||
|
$('.close').click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -501,11 +527,11 @@
|
|||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
var myModal = new bootstrap.Modal(document.getElementById('insurerBranchModal'));
|
||||||
myModal.show();
|
myModal.show();
|
||||||
// $('#add_branch').show();
|
// $('#add_branch').show();
|
||||||
// $('#branch_table').show();
|
// $('#branch_table').show();
|
||||||
$('.btnBack').show();
|
// $('.btnBack').show();
|
||||||
// $('#btnBranchAdd').hide();
|
// $('#btnBranchAdd').hide();
|
||||||
console.log("res.levelcontact[0].id"+res.levelcontact[0].id);
|
console.log("res.levelcontact[0].id"+res.levelcontact[0].id);
|
||||||
$('#branch_name').val(res.insurerbranch.branch_name);
|
$('#branch_name').val(res.insurerbranch.branch_name);
|
||||||
@ -661,6 +687,7 @@
|
|||||||
var container = document.getElementById('container');
|
var container = document.getElementById('container');
|
||||||
var uniqueId = Date.now().toString();
|
var uniqueId = Date.now().toString();
|
||||||
|
|
||||||
|
// <input type="hidden" name="primarykey[]" id="contact_id_1" value="${contact !== undefined && contact !== false ? contact.id : ''}"/>
|
||||||
var html = `
|
var html = `
|
||||||
<div id="${uniqueId}" class="bg-white p-2 mb-2 rounded contact-block">
|
<div id="${uniqueId}" class="bg-white p-2 mb-2 rounded contact-block">
|
||||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
@ -670,28 +697,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<input type="hidden" name="primarykey[]" value="${contact ? contact.id : ''}"/>
|
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label>Name<span class="text-danger">*</span></label>
|
<label>Name<span class="text-danger">*</span></label>
|
||||||
<input value="${contact ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" required>
|
<input value="${contact ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-12">
|
||||||
|
<label>Designation<span class="text-danger">*</span></label>
|
||||||
|
<input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label>Email<span class="text-danger">*</span></label>
|
<label>Email<span class="text-danger">*</span></label>
|
||||||
<input value="${contact ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" required>
|
<input value="${contact ? contact.email : ''}" type="email" data-parsley-type="email" data-parsley-trigger="change"class="form-control" placeholder="Enter Contact Email" name="email[]" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label>Mobile<span class="text-danger">*</span></label>
|
<label>Mobile<span class="text-danger">*</span></label>
|
||||||
<input value="${contact ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" pattern="[0-9]{10}" name="mobile[]" required>
|
<input value="${contact ? contact.mobile : ''}" name="mobile[]" value="" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required maxlength="10" inputmode="numeric">
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<div class="form-group col-md-12">
|
|
||||||
<label>Designation<span class="text-danger">*</span></label>
|
|
||||||
<input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -705,18 +731,29 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function removeContact(btn){
|
||||||
|
var $block = $(btn).closest('.contact-block');
|
||||||
|
var isFirst = $block.attr('id') === 'contact_1_wrapper';
|
||||||
|
|
||||||
function removeContact(button) {
|
if (isFirst) {
|
||||||
var uniqueId = button.id.split("_")[0];
|
var $next = $('#container .contact-block').first();
|
||||||
var contactSection = document.getElementById(uniqueId);
|
if ($next.length){
|
||||||
|
$block.replaceWith($next);
|
||||||
if (contactSection) {
|
$next.attr('id','contact_1_wrapper');
|
||||||
contactSection.parentNode.removeChild(contactSection);
|
$next.find('.modal-subtitle').text('Contact 1');
|
||||||
renumberContacts(); // ✅ renumber after removal
|
} else {
|
||||||
toggleAddButton();
|
$block.find('input').val('');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$block.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
renumberContacts();
|
||||||
|
toggleAddButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function toggleAddButton() {
|
function toggleAddButton() {
|
||||||
var totalContacts = document.querySelectorAll('.contact-block, #contact_1_wrapper').length;
|
var totalContacts = document.querySelectorAll('.contact-block, #contact_1_wrapper').length;
|
||||||
var addButton = document.querySelector('.ac');
|
var addButton = document.querySelector('.ac');
|
||||||
|
|||||||
@ -68,9 +68,9 @@
|
|||||||
$('#btnBranchAdd').hide();
|
$('#btnBranchAdd').hide();
|
||||||
toastr.warning('First Add the Insurer!', 'warning',{timeOut: 2000});
|
toastr.warning('First Add the Insurer!', 'warning',{timeOut: 2000});
|
||||||
}else{
|
}else{
|
||||||
if ($('#btnBranchBack')[0].style.display == 'none') {
|
// if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||||
$('#btnBranchAdd').show();
|
$('#btnBranchAdd').show();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,6 +54,7 @@
|
|||||||
<span class="d-none d-sm-inline-block">History</span>
|
<span class="d-none d-sm-inline-block">History</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#autoQuery-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="auto_query_tab"
|
<a href="#autoQuery-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="auto_query_tab"
|
||||||
aria-expanded="false">
|
aria-expanded="false">
|
||||||
@ -61,6 +62,7 @@
|
|||||||
<span class="d-none d-sm-inline-block">Auto Query Content</span>
|
<span class="d-none d-sm-inline-block">Auto Query Content</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php } ?>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#uploads-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="uploads_tab"
|
<a href="#uploads-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="uploads_tab"
|
||||||
aria-expanded="false">
|
aria-expanded="false">
|
||||||
@ -68,6 +70,7 @@
|
|||||||
<span class="d-none d-sm-inline-block">Claim Files</span>
|
<span class="d-none d-sm-inline-block">Claim Files</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#viewpolicyterms-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="viewpolicyterms_tab"
|
<a href="#viewpolicyterms-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="viewpolicyterms_tab"
|
||||||
aria-expanded="false">
|
aria-expanded="false">
|
||||||
@ -75,6 +78,7 @@
|
|||||||
<span class="d-none d-sm-inline-block">View Policy Terms</span>
|
<span class="d-none d-sm-inline-block">View Policy Terms</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Tab Content -->
|
<!-- Tab Content -->
|
||||||
@ -84,6 +88,8 @@
|
|||||||
|
|
||||||
if ($ticket_data['ticket_type_id'] == 1) {
|
if ($ticket_data['ticket_type_id'] == 1) {
|
||||||
include('ticket_form_gmc.php');
|
include('ticket_form_gmc.php');
|
||||||
|
} else if($ticket_data['ticket_type_id'] == 8){
|
||||||
|
include('ticket_form_motor.php');
|
||||||
} else {
|
} else {
|
||||||
include('ticket_form_gpa.php');
|
include('ticket_form_gpa.php');
|
||||||
}
|
}
|
||||||
@ -98,15 +104,19 @@
|
|||||||
<div class="tab-pane fade" id="history-tab">
|
<div class="tab-pane fade" id="history-tab">
|
||||||
<?php include('ticket_history.php'); ?>
|
<?php include('ticket_history.php'); ?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
|
||||||
<div class="tab-pane fade" id="autoQuery-tab">
|
<div class="tab-pane fade" id="autoQuery-tab">
|
||||||
<?php include('ticket_auto_query.php'); ?>
|
<?php include('ticket_auto_query.php'); ?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
<div class="tab-pane fade" id="uploads-tab">
|
<div class="tab-pane fade" id="uploads-tab">
|
||||||
<?php include('claim_files_upload.php'); ?>
|
<?php include('claim_files_upload.php'); ?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
|
||||||
<div class="tab-pane fade" id="viewpolicyterms-tab">
|
<div class="tab-pane fade" id="viewpolicyterms-tab">
|
||||||
<?php include('view_policy_terms.php'); ?>
|
<?php include('view_policy_terms.php'); ?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -27,11 +27,11 @@
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="<?= !isset($ticket_data) ? "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_data)) { ?>
|
<?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">
|
||||||
<h4 class="mb-0"> Motor </h4>
|
<h4 class="mb-0">Claim <?= $ticket_form ?></h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 text-right">
|
<div class="col-6 text-right">
|
||||||
<a href="<?= base_url('ticket/list'); ?>" aria-label="Back to ticket list">
|
<a href="<?= base_url('ticket/list'); ?>" aria-label="Back to ticket list">
|
||||||
@ -39,16 +39,21 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php // } ?>
|
<?php } ?>
|
||||||
<form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)"
|
<form role="form" class="parsley-examples" method="post" id="ticket_form_data"
|
||||||
|
onsubmit="return validateBeforeSubmit(event, this)"
|
||||||
enctype="multipart/form-data">
|
enctype="multipart/form-data">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<h5>General Details</h5>
|
||||||
|
<hr>
|
||||||
|
<!-- Hide_data_points -->
|
||||||
<input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>">
|
<input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>">
|
||||||
<input type="hidden" id="is_head_approved" name="is_head_approved" value="<?= isset($ticket_data['is_head_approved']) ? $ticket_data['is_head_approved'] : '' ?>">
|
<input type="hidden" id="is_head_approved" name="is_head_approved" value="<?= isset($ticket_data['is_head_approved']) ? $ticket_data['is_head_approved'] : '' ?>">
|
||||||
<input type="hidden" id="extra_fields_array_for_validate" name="extra_fields_array_for_validate" value='<?= isset($extra_fields_array_for_validate) && !empty($extra_fields_array_for_validate) ? json_encode($extra_fields_array_for_validate) : "[]" ?>'>
|
<input type="hidden" id="extra_fields_array_for_validate" name="extra_fields_array_for_validate" value='<?= isset($extra_fields_array_for_validate) && !empty($extra_fields_array_for_validate) ? json_encode($extra_fields_array_for_validate) : "[]" ?>'>
|
||||||
|
<input type="hidden" id="client_id" name="client_id" value="<?= isset($ticket_data['client_id']) ? $ticket_data['client_id'] : '' ?>">
|
||||||
<div class="form-group">
|
<input type="hidden" id="emp_id" name="emp_id" value="<?= isset($ticket_data['emp_id']) ? $ticket_data['emp_id'] : '' ?>">
|
||||||
<hr>
|
<input type="hidden" id="emp_name" name="emp_name" value="<?= isset($ticket_data['emp_name']) ? $ticket_data['emp_name'] : '' ?>">
|
||||||
<!-- first_data_points -->
|
<!-- first_data_points -->
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
|
|
||||||
@ -70,62 +75,60 @@
|
|||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label class="label-font-size" for="client_name">Client Name <span class="text-danger">*</span></label>
|
<label class="label-font-size" for="client_name">Client Name <span class="text-danger">*</span></label>
|
||||||
<select class="form-control" id="client_name" name="client_name" required onchange="fetchOtherDetails(this,1)">
|
<select class="form-control" id="client_name" name="client_name" required onchange="fetchOtherDetails(this,1)" data-parsley-trigger="change" data-parsley-required-message="Please select a option">
|
||||||
<option value="0">Select Client</option>
|
<option value="0">Select Client</option>
|
||||||
<?php
|
<?php
|
||||||
if (isset($client_for_motor) && count($client_for_motor)) {
|
if (isset($client_for_motor) && count($client_for_motor)) {
|
||||||
foreach ($client_for_motor as $value) {
|
foreach ($client_for_motor as $value) {
|
||||||
$selected = (isset($ticket_data) && $ticket_data['client_name'] == $value['client_name']) ? 'selected' : '';
|
$selected = (isset($ticket_data) && $ticket_data['client_name'] == $value['client_name']) ? 'selected' : '';
|
||||||
echo '<option data-cid="'.$value['id'].'" data-cname="'.$value['client_name'].'" value="'.$value['client_name'].'" '.$selected.'>'.$value['client_name'].'</option>';
|
echo '<option data-cid="'.$value['id'].'" data-cname="'.$value['client_name'].'" value="'.$value['client_name'].'" '.$selected.'>'.$value['client_name'] .' - '.$value['phone'] .'</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<input type="hidden" id="client_id" name="client_id" value="<?= isset($ticket_data['client_id']) ? $ticket_data['client_id'] : '' ?>">
|
|
||||||
<input type="hidden" id="emp_id" name="emp_id" value="<?= isset($ticket_data['emp_id']) ? $ticket_data['emp_id'] : '' ?>">
|
|
||||||
<input type="hidden" id="emp_name" name="emp_name" value="<?= isset($ticket_data['emp_name']) ? $ticket_data['emp_name'] : '' ?>">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label class="label-font-size" for="vehicle_id">Vehicle <span class="text-danger">*</span></label>
|
<label class="label-font-size" for="vehicle_id">Vehicle <span class="text-danger">*</span></label>
|
||||||
<select class="form-control" id="vehicle_id" name="vehicle_id" required>
|
<select class="form-control" id="vehicle_id" name="vehicle_id" required data-parsley-trigger="change" data-parsley-required-message="Please select a option">
|
||||||
<option value="0">Select Vehicle Number</option>
|
<option value="0">Select Vehicle</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="label-font-size">Policy <span class="text-danger">*</span></label>
|
<label class="label-font-size" for="emp_client_policy">Policy <span class="text-danger">*</span></label>
|
||||||
<select id="emp_client_policy" name="client_policy_id" onchange="fetchOtherDetails(this,2)">
|
<select class="form-control" id="emp_client_policy" name="client_policy_id" required onchange="fetchOtherDetails(this,2)" data-parsley-trigger="change" data-parsley-required-message="Please select a option">
|
||||||
<option value=""
|
<option value="0"
|
||||||
data-policynumber="" data-managerid=""
|
data-policynumber="" data-managerid=""
|
||||||
data-insuredname="" data-agentid=""
|
data-insuredname="" data-agentid=""
|
||||||
data-insurerid="" data-insurername="" >Select Policy Number</option>
|
data-insurerid="" data-insurername="" >Select Policy</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label class="label-font-size" for="insurer_name">Insurer </label>
|
<label class="label-font-size" for="insurer_name">Insurer </label>
|
||||||
<input type="text" 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="Enter Insurer" value="<?= isset($ticket_data['insurer_name']) ? $ticket_data['insurer_name'] : '' ?>" readonly>
|
||||||
<input type="text" id="agent_id" name="agent_id" value="<?= isset($ticket_data['agent_id']) ? $ticket_data['agent_id'] : '' ?>">
|
<input type="hidden" id="insurer_id" name="insurer_id" value="<?= isset($ticket_data['insurer_id']) ? $ticket_data['insurer_id'] : '' ?>">
|
||||||
<input type="text" id="manager_id" name="manager_id" value="<?= isset($ticket_data['manager_id']) ? $ticket_data['manager_id'] : '' ?>">
|
<input type="hidden" id="agent_id" name="agent_id" value="<?= isset($ticket_data['agent_id']) ? $ticket_data['agent_id'] : '' ?>">
|
||||||
<input type="text" id="policy_no" name="policy_no" value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>">
|
<input type="hidden" id="manager_id" name="manager_id" value="<?= isset($ticket_data['manager_id']) ? $ticket_data['manager_id'] : '' ?>">
|
||||||
<input type=text class="form-control" id="insurer_name" placeholder="Insurer" value="<?= isset($ticket_data['insurer_name']) ? $ticket_data['insurer_name'] : '' ?>" readonly>
|
<input type="hidden" id="policy_no" name="policy_no" value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label class="label-font-size" for="emp_mobile"> Mobile No </label>
|
<label class="label-font-size" for="emp_mobile"> Mobile No </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 Mobile No"
|
||||||
value="<?= isset($ticket_data['emp_mobile']) ? $ticket_data['emp_mobile'] : '' ?>"
|
value="<?= isset($ticket_data['emp_mobile']) ? $ticket_data['emp_mobile'] : '' ?>"
|
||||||
name="emp_mobile" readonly>
|
name="emp_mobile" readonly>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label class="label-font-size" for="emp_mail"> Mail ID </label>
|
<label class="label-font-size" for="emp_mail"> Mail ID </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 Mail ID"
|
||||||
value="<?= isset($ticket_data['emp_mail']) ? $ticket_data['emp_mail'] : '' ?>"
|
value="<?= isset($ticket_data['emp_mail']) ? $ticket_data['emp_mail'] : '' ?>"
|
||||||
name="emp_mail" readonly>
|
name="emp_mail" readonly>
|
||||||
</div>
|
</div>
|
||||||
@ -179,10 +182,11 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label class="label-font-size" for="claim_status">Status <span class="text-danger">*</span></label>
|
<label class="label-font-size" for="claim_status_id">Status <span class="text-danger">*</span></label>
|
||||||
<select class="form-control" id="claim_status_id" name="claim_status_id" required>
|
<select class="form-control" id="claim_status_id" name="claim_status_id" required data-parsley-trigger="change" data-parsley-required-message="Please select a status">
|
||||||
<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) {
|
||||||
@ -1012,6 +1016,11 @@
|
|||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
// window.onload = function() {
|
||||||
|
// document.getElementById("ticket_form_data").reset();
|
||||||
|
// };
|
||||||
|
|
||||||
$("#emp_client_policy").select2();
|
$("#emp_client_policy").select2();
|
||||||
$("#vehicle_id").select2();
|
$("#vehicle_id").select2();
|
||||||
$("#client_name").select2();
|
$("#client_name").select2();
|
||||||
@ -1077,7 +1086,7 @@
|
|||||||
success: function (res) {
|
success: function (res) {
|
||||||
// Vehicle dropdown
|
// Vehicle dropdown
|
||||||
let $vehicleSelect = $('#vehicle_id');
|
let $vehicleSelect = $('#vehicle_id');
|
||||||
$vehicleSelect.empty().append('<option value="0">Select vehicle</option>');
|
$vehicleSelect.empty().append('<option value="0">Select Vehicle</option>');
|
||||||
$.each(res.data.vehicle_list, function(index, item) {
|
$.each(res.data.vehicle_list, function(index, item) {
|
||||||
let selected = (vehicleId && vehicleId == item.id) ? "selected" : "";
|
let selected = (vehicleId && vehicleId == item.id) ? "selected" : "";
|
||||||
$vehicleSelect.append('<option value="'+ item.id +'" '+selected+'>'+ item.vehicle_no +'</option>');
|
$vehicleSelect.append('<option value="'+ item.id +'" '+selected+'>'+ item.vehicle_no +'</option>');
|
||||||
@ -1086,7 +1095,7 @@
|
|||||||
|
|
||||||
// Policy dropdown
|
// Policy dropdown
|
||||||
let $policySelect = $('#emp_client_policy');
|
let $policySelect = $('#emp_client_policy');
|
||||||
$policySelect.empty().append('<option value="0">Select policy</option>');
|
$policySelect.empty().append('<option value="0">Select Policy</option>');
|
||||||
$.each(res.data.partner_policy_list, function(index, item) {
|
$.each(res.data.partner_policy_list, function(index, item) {
|
||||||
let selected = (policyId && policyId == item.id) ? "selected" : "";
|
let selected = (policyId && policyId == item.id) ? "selected" : "";
|
||||||
$policySelect.append(
|
$policySelect.append(
|
||||||
@ -1111,12 +1120,72 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setReadonlyField(fieldId, value, labelText) {
|
function setReadonlyField(fieldId, value, labelText) {
|
||||||
|
let $field = $("#" + fieldId);
|
||||||
|
let $label = $('label[for="' + fieldId + '"]');
|
||||||
|
|
||||||
if (value && value.trim() !== "") {
|
if (value && value.trim() !== "") {
|
||||||
$("#" + fieldId).val(value).prop("readonly", true).prop("required", false);
|
// Not required, readonly
|
||||||
$('label[for="' + fieldId + '"]').html(labelText);
|
$field.val(value).prop("readonly", true).prop("required", false)
|
||||||
|
.removeAttr("data-parsley-trigger")
|
||||||
|
.removeAttr("data-parsley-required-message");
|
||||||
|
$label.html(labelText);
|
||||||
} else {
|
} else {
|
||||||
$("#" + fieldId).val("").prop("readonly", false).prop("required", true);
|
$field.val("").prop("readonly", false).prop("required", true)
|
||||||
$('label[for="' + fieldId + '"]').html(labelText + ' <span class="text-danger">*</span>');
|
.attr("data-parsley-trigger", "change")
|
||||||
|
.attr("data-parsley-required-message", "Please Enter " + labelText.toLowerCase());
|
||||||
|
$label.html(labelText + ' <span class="text-danger">*</span>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validateBeforeSubmit(e, form) {
|
||||||
|
e.preventDefault();
|
||||||
|
var $form = $(form);
|
||||||
|
|
||||||
|
// Remove old error messages (only for selects)
|
||||||
|
$form.find(".field-error").remove();
|
||||||
|
$form.find("select").removeClass("is-invalid");
|
||||||
|
|
||||||
|
let isValid = true;
|
||||||
|
|
||||||
|
|
||||||
|
// $form.find("input[required], select[required]").each(function ()
|
||||||
|
$form.find("select[required]").each(function () {
|
||||||
|
let $field = $(this);
|
||||||
|
let value = $field.val().trim();
|
||||||
|
|
||||||
|
if (value === "" || value === "0" || value === undefined) {
|
||||||
|
isValid = false;
|
||||||
|
$field.addClass("is-invalid");
|
||||||
|
|
||||||
|
let errorMessage = $field.attr("data-parsley-required-message") || "This field is required";
|
||||||
|
|
||||||
|
$field.closest(".form-group").append(
|
||||||
|
'<p class="field-error text-danger d-block mt-1">' +
|
||||||
|
errorMessage +
|
||||||
|
'</p>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!isValid) {
|
||||||
|
let $firstError = $form.find(".is-invalid").first();
|
||||||
|
$("html, body").animate(
|
||||||
|
{ scrollTop: $firstError.offset().top - 100 },
|
||||||
|
500
|
||||||
|
);
|
||||||
|
$firstError.focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ Let Parsley validate inputs automatically
|
||||||
|
if (!$form.parsley().validate()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// All good
|
||||||
|
submitClaimForm(e, form);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -14,17 +14,17 @@
|
|||||||
<!-- Optional CSS -->
|
<!-- Optional CSS -->
|
||||||
<style>
|
<style>
|
||||||
/* Make modal really XL and scrollable */
|
/* Make modal really XL and scrollable */
|
||||||
#branchModal .modal-dialog.modal-xl {
|
#tpaBranchModal .modal-dialog.modal-xl {
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
height: 90vh;
|
height: 90vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
#branchModal .modal-content {
|
#tpaBranchModal .modal-content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#branchModal .modal-body {
|
#tpaBranchModal .modal-body {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
max-height: 80vh;
|
max-height: 80vh;
|
||||||
}
|
}
|
||||||
@ -166,7 +166,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="branchModal" tabindex="-1" role="dialog" aria-hidden="true">
|
<div class="modal fade" id="tpaBranchModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered modal-xl" style="max-width: 1140px !important;">
|
<div class="modal-dialog modal-dialog-centered modal-xl" style="max-width: 1140px !important;">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<!-- Modal Header -->
|
<!-- Modal Header -->
|
||||||
@ -179,20 +179,24 @@
|
|||||||
|
|
||||||
<!-- Modal Body -->
|
<!-- Modal Body -->
|
||||||
<div class="modal-body" style="overflow-y:auto; max-height:80vh;">
|
<div class="modal-body" style="overflow-y:auto; max-height:80vh;">
|
||||||
<form id="insurer_branch_form" class="parsley-examples" method="post" enctype="multipart/form-data">
|
<form id="tpa_branch_form" role="form" class="parsley-examples" method="post" action="" enctype="multipart/form-data">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||||
|
<input type="hidden" name="PrimaryKey" id="tpa_Branch_PrimaryKey" />
|
||||||
|
<input type="hidden" name="tpa_id" id="tpa_id_branch" value="<?= isset($tpa['id']) ? $tpa['id'] : '' ?>"/>
|
||||||
<!-- Left Section: Branch Details -->
|
<!-- Left Section: Branch Details -->
|
||||||
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
|
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
|
||||||
<!-- Branch Name & Code -->
|
<!-- Branch Name & Code -->
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="branch_name">Branch Name <span class="text-danger">*</span></label>
|
<label for="branch_name">Branch Name <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="branch_name" name="branch_name" required>
|
<input type="text" class="form-control" id="branch_name"
|
||||||
|
placeholder="Enter Branch Name" name="branch_name" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="branch_code">Branch Code <span class="text-danger">*</span></label>
|
<label for="branch_code">Branch Code <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="branch_code" name="branch_code" required>
|
<input type="text" class="form-control" id="branch_code"
|
||||||
|
placeholder="Enter Branch Code" name="branch_code" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -200,11 +204,11 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="address1">Address Line 1 <span class="text-danger">*</span></label>
|
<label for="address1">Address Line 1 <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="address1" name="address1" required>
|
<input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="address2">Address Line 2</label>
|
<label for="address2">Address Line 2</label>
|
||||||
<input type="text" class="form-control" id="address2" name="address2">
|
<input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -214,14 +218,16 @@
|
|||||||
<label for="state">State <span class="text-danger">*</span></label>
|
<label for="state">State <span class="text-danger">*</span></label>
|
||||||
<select class="form-control" id="state" name="state" required>
|
<select class="form-control" id="state" name="state" required>
|
||||||
<option value="">Select State</option>
|
<option value="">Select State</option>
|
||||||
<?php foreach($state as $value) { ?>
|
<?php if ($state) {
|
||||||
|
foreach($state as $value) { ?>
|
||||||
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
|
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
|
||||||
<?php } ?>
|
<?php } }?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="district">District <span class="text-danger">*</span></label>
|
<label for="district">District <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="district" name="district" required>
|
<input type="text" class="form-control" id="district"
|
||||||
|
placeholder="Enter District" name="district" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -229,18 +235,19 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="branch_city">City <span class="text-danger">*</span></label>
|
<label for="branch_city">City <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="branch_city" name="city" required>
|
<input type="text" class="form-control" id="branch_city"
|
||||||
|
placeholder="Enter City" name="city" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="pincode">Pincode <span class="text-danger">*</span></label>
|
<label for="pincode">Pincode <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="pincode" name="pincode" required>
|
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Submit / Cancel -->
|
<!-- Submit / Cancel -->
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<!-- <div class="form-group col-md-12 mt-2"> -->
|
<!-- <div class="form-group col-md-12 mt-2"> -->
|
||||||
<div class="mt-2">
|
<div style="margin-top: 85px;">
|
||||||
<button type="submit" class="btn app-btn-secondary mr-2" id="btnSubmit">Submit</button>
|
<button type="submit" class="btn app-btn-secondary mr-2" id="btnSubmit">Submit</button>
|
||||||
<button type="button" class="btn app-btn-outline-secondary btnBack" id="btnBack" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
<button type="button" class="btn app-btn-outline-secondary btnBack" id="btnBack" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
@ -260,22 +267,30 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Contact Form Fields -->
|
<!-- Contact Form Fields -->
|
||||||
<input type="hidden" name="primarykey[]" id="contact_id_1" value=""/>
|
<!-- <input type="hidden" name="primarykey[]" id="contact_id_1" value=""/> -->
|
||||||
<div class="form-group mb-2">
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-12">
|
||||||
<label for="name">Name <span class="text-danger">*</span></label>
|
<label for="name">Name <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
|
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group mb-2">
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-12">
|
||||||
<label for="designation">Designation <span class="text-danger">*</span></label>
|
<label for="designation">Designation <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group mb-2">
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-12">
|
||||||
<label for="email">Email <span class="text-danger">*</span></label>
|
<label for="email">Email <span class="text-danger">*</span></label>
|
||||||
<input type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
|
<input value="" data-parsley-type="email" type="email" data-parsley-trigger="change" data-parsley-type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group mb-2">
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-12">
|
||||||
<label for="mobile">Mobile <span class="text-danger">*</span></label>
|
<label for="mobile">Mobile <span class="text-danger">*</span></label>
|
||||||
<input type="tel" class="form-control" placeholder="Enter Contact Mobile" pattern="[0-9]{10}" name="mobile[]" id="mobile" required>
|
<input value="" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="mobile" required maxlength="10" inputmode="numeric">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -309,21 +324,21 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
var tpa_Branch_PrimaryKey = $('#tpa_id_branch').val();
|
var tpa_Branch_PrimaryKey = $('#tpa_id_branch').val();
|
||||||
var tpa_branch_form_action = '';
|
var tpa_branch_form_action = '';
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
|
||||||
myModal.hide();
|
myModal.hide();
|
||||||
// $('#add_branch').hide();
|
// $('#add_branch').hide();
|
||||||
$('.btnBack').hide();
|
// $('.btnBack').hide();
|
||||||
|
|
||||||
loadBranchList();
|
loadBranchList();
|
||||||
|
|
||||||
$('#btnBranchAdd').click(function(){
|
$('#btnBranchAdd').click(function(){
|
||||||
|
|
||||||
tpa_branch_form_action = '<?= base_url("master/tpa/branch/create"); ?>';
|
tpa_branch_form_action = '<?= base_url("master/tpa/branch/create"); ?>';
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
|
||||||
myModal.show();
|
myModal.show();
|
||||||
// $('#add_branch').show();
|
// $('#add_branch').show();
|
||||||
// $('#branch_table').hide();
|
// $('#branch_table').hide();
|
||||||
$('.btnBack').show();
|
// $('.btnBack').show();
|
||||||
// $('#btnBranchAdd').hide();
|
// $('#btnBranchAdd').hide();
|
||||||
|
|
||||||
$('#branch_name').val('');
|
$('#branch_name').val('');
|
||||||
@ -364,11 +379,11 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
$('.btnBack').click(function(){
|
$('.btnBack').click(function(){
|
||||||
|
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
|
||||||
myModal.hide();
|
myModal.hide();
|
||||||
// $('#add_branch').hide();
|
// $('#add_branch').hide();
|
||||||
// $('#branch_table').show();
|
// $('#branch_table').show();
|
||||||
$('.btnBack').hide();
|
// $('.btnBack').hide();
|
||||||
// $('#btnBranchAdd').show();
|
// $('#btnBranchAdd').show();
|
||||||
|
|
||||||
$('#branch_name').val('');
|
$('#branch_name').val('');
|
||||||
@ -381,6 +396,7 @@ $(document).ready(function () {
|
|||||||
$('#email').val('');
|
$('#email').val('');
|
||||||
$('#mobile').val('');
|
$('#mobile').val('');
|
||||||
$('#designation').val('');
|
$('#designation').val('');
|
||||||
|
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -449,8 +465,8 @@ $(document).ready(function () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
$('#tpa_branch_list').append(tpaBranchTableInsert);
|
$('#tpa_branch_list').append(tpaBranchTableInsert);
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||||
myModal.hide();
|
$('.close').click();
|
||||||
// $('#add_branch').hide();
|
// $('#add_branch').hide();
|
||||||
// $('#branch_table').show();
|
// $('#branch_table').show();
|
||||||
// $('.btnBack').hide();
|
// $('.btnBack').hide();
|
||||||
@ -464,6 +480,13 @@ $(document).ready(function () {
|
|||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
toastr.warning('Something Wrong!', 'warning');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
setTimeout(function() {
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
}, 1000);
|
||||||
|
$('.close').click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -487,7 +510,7 @@ $(document).ready(function () {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
console.log("tpa.............");
|
console.log("tpa.............");
|
||||||
console.log(res)
|
console.log(res)
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
|
||||||
myModal.show();
|
myModal.show();
|
||||||
// $('#add_branch').show();
|
// $('#add_branch').show();
|
||||||
// $('#branch_table').hide();
|
// $('#branch_table').hide();
|
||||||
@ -663,7 +686,7 @@ function renumberContacts() {
|
|||||||
|
|
||||||
var container = document.getElementById('container');
|
var container = document.getElementById('container');
|
||||||
var uniqueId = Date.now().toString();
|
var uniqueId = Date.now().toString();
|
||||||
|
// <input type="hidden" name="primarykey[]" value="${contact ? contact.id : ''}"/>
|
||||||
var html = `
|
var html = `
|
||||||
<div id="${uniqueId}" class="bg-white p-2 mb-2 rounded contact-block">
|
<div id="${uniqueId}" class="bg-white p-2 mb-2 rounded contact-block">
|
||||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
@ -673,28 +696,28 @@ function renumberContacts() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<input type="hidden" name="primarykey[]" value="${contact ? contact.id : ''}"/>
|
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label>Name<span class="text-danger">*</span></label>
|
<label>Name<span class="text-danger">*</span></label>
|
||||||
<input value="${contact ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" required>
|
<input value="${contact ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-12">
|
||||||
|
<label>Designation<span class="text-danger">*</span></label>
|
||||||
|
<input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label>Email<span class="text-danger">*</span></label>
|
<label>Email<span class="text-danger">*</span></label>
|
||||||
<input value="${contact ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" required>
|
<input value="${contact ? contact.email : ''}" data-parsley-type="email" type="email" data-parsley-trigger="change" data-parsley-type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label>Mobile<span class="text-danger">*</span></label>
|
<label>Mobile<span class="text-danger">*</span></label>
|
||||||
<input value="${contact ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" pattern="[0-9]{10}" name="mobile[]" required>
|
<input value="${contact ? contact.mobile : ''}" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" required maxlength="10" inputmode="numeric">
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<div class="form-group col-md-12">
|
|
||||||
<label>Designation<span class="text-danger">*</span></label>
|
|
||||||
<input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -707,15 +730,26 @@ function renumberContacts() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeContact(button) {
|
function removeContact(btn){
|
||||||
var uniqueId = button.id.split("_")[0];
|
var $block = $(btn).closest('.contact-block');
|
||||||
var contactSection = document.getElementById(uniqueId);
|
var isFirst = $block.attr('id') === 'contact_1_wrapper';
|
||||||
|
|
||||||
if (contactSection) {
|
if (isFirst) {
|
||||||
contactSection.parentNode.removeChild(contactSection);
|
var $next = $('#container .contact-block').first();
|
||||||
renumberContacts(); // ✅ renumber after removal
|
if ($next.length){
|
||||||
toggleAddButton();
|
$block.replaceWith($next);
|
||||||
|
$next.attr('id','contact_1_wrapper');
|
||||||
|
$next.find('.modal-subtitle').text('Contact 1');
|
||||||
|
} else {
|
||||||
|
$block.find('input').val('');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$block.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
renumberContacts();
|
||||||
|
toggleAddButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleAddButton() {
|
function toggleAddButton() {
|
||||||
|
|||||||
@ -83,9 +83,9 @@ body {
|
|||||||
$('#btnBranchAdd').hide();
|
$('#btnBranchAdd').hide();
|
||||||
toastr.warning('First Add the TPA!', 'warning',{timeOut: 2000});
|
toastr.warning('First Add the TPA!', 'warning',{timeOut: 2000});
|
||||||
}else{
|
}else{
|
||||||
if ($('#btnBranchBack')[0].style.display == 'none') {
|
// if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||||
$('#btnBranchAdd').show();
|
$('#btnBranchAdd').show();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user