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['client_for_motor'] = $this->clientModel->select('id,client_name')->where('client_type', 2)->where('is_active', 1)->findAll();
|
||||
$data['client_for_motor'] = $this->clientModel->select('id,client_name,phone')->where('client_type', 2)->where('is_active', 1)->findAll();
|
||||
|
||||
$this->myLogger->logme('error', "Ticket form data fetched successfully for Ticket Type: $ticket_type");
|
||||
|
||||
@ -875,15 +875,7 @@ class TicketController extends BaseController
|
||||
{
|
||||
// $ticket_data = $this->ticketMasterModel->where('id', $ticket_id)->where('is_active', 1)->first();
|
||||
$ticket_data = $this->ticketMasterModel->getTicketDataByTicketID($ticket_id);
|
||||
if($ticket_data['ticket_type_id'] == 8){
|
||||
$this->motor_claim($ticket_data,$ticket_id);
|
||||
}else{
|
||||
$this->other_claim($ticket_data,$ticket_id);
|
||||
}
|
||||
}
|
||||
|
||||
public function other_claim($ticket_data,$ticket_id)
|
||||
{
|
||||
|
||||
$ticket_data = $this->formatDateForClaim($ticket_data, 'd/m/Y');
|
||||
|
||||
if (in_array($ticket_data['claim_status_id'], [15, 25, 35])) {
|
||||
@ -942,22 +934,15 @@ class TicketController extends BaseController
|
||||
// print_rr($data); die;
|
||||
}
|
||||
|
||||
return $this->loadLayout('ticket_edit_onbording', $data);
|
||||
}
|
||||
// 8TH TYPE is Motor - so do not remove it....
|
||||
if($ticket_data['ticket_type_id'] == 8){
|
||||
$claim_status_id = $ticket_data['claim_status_id'];
|
||||
$ticket_type = $ticket_data['ticket_type_id'];
|
||||
$data['claim_status'] = $this->transFormClaimStatus($claim_status_id, $ticket_type);
|
||||
$data['client_for_motor'] = $this->clientModel->select('id,client_name,phone')->where('client_type', 2)->where('is_active', 1)->findAll();
|
||||
}
|
||||
|
||||
public function motor_claim($ticket_data,$ticket_id)
|
||||
{
|
||||
$claim_status_id = $ticket_data['claim_status_id'];
|
||||
$ticket_type = $ticket_data['ticket_type_id'];
|
||||
|
||||
$data['selected_ticket_type'] = $ticket_type;
|
||||
$data['ticket_type'] = [ 8 => 'Motor' ];
|
||||
$data['ticket_data'] = $ticket_data;
|
||||
// print_r($ticket_data);die;
|
||||
$data['claim_status'] = $this->transFormClaimStatus($claim_status_id, $ticket_type);
|
||||
$data['client_for_motor'] = $this->clientModel->select('id,client_name')->where('client_type', 2)->where('is_active', 1)->findAll();
|
||||
// print_r($data);die;
|
||||
return $this->loadLayout('ticket_form_motor', $data);
|
||||
return $this->loadLayout('ticket_edit_onbording', $data);
|
||||
}
|
||||
|
||||
public function formatDateForClaim($ticket_data, $out_put_format = 'Y-m-d')
|
||||
|
||||
@ -14,17 +14,17 @@
|
||||
<!-- Optional CSS -->
|
||||
<style>
|
||||
/* Make modal really XL and scrollable */
|
||||
#branchModal .modal-dialog.modal-xl {
|
||||
#insurerBranchModal .modal-dialog.modal-xl {
|
||||
max-width: 90%;
|
||||
height: 90vh;
|
||||
}
|
||||
|
||||
#branchModal .modal-content {
|
||||
#insurerBranchModal .modal-content {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#branchModal .modal-body {
|
||||
#insurerBranchModal .modal-body {
|
||||
overflow-y: auto;
|
||||
max-height: 80vh;
|
||||
}
|
||||
@ -170,7 +170,7 @@
|
||||
<!-- end -->
|
||||
|
||||
<!-- 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-content">
|
||||
<!-- Modal Header -->
|
||||
@ -183,116 +183,133 @@
|
||||
|
||||
<!-- Modal Body -->
|
||||
<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">
|
||||
<div class="row">
|
||||
|
||||
<!-- Left Section: Branch Details -->
|
||||
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
|
||||
<!-- Branch Name & Code -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<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>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Address Lines -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address1">Address Line 1 <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="address1" name="address1" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address2">Address Line 2</label>
|
||||
<input type="text" class="form-control" id="address2" name="address2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- State & District -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="state">State <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="state" name="state" required>
|
||||
<option value="">Select State</option>
|
||||
<?php foreach($state as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="district">District <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="district" name="district" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- City & Pincode -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_city">City <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_city" name="city" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="pincode">Pincode <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="pincode" name="pincode" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit / Cancel -->
|
||||
<form id="insurer_branch_form" role="form" class="parsley-examples" method="post" action="" enctype="multipart/form-data">
|
||||
<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 -->
|
||||
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
|
||||
<!-- Branch Name & Code -->
|
||||
<div class="form-row">
|
||||
<!-- <div class="form-group col-md-12 mt-2"> -->
|
||||
<div style="margin-top: 85px;">
|
||||
<button type="submit" class="btn btn-primary 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>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_name">Branch Name <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_name"
|
||||
placeholder="Enter Branch Name" name="branch_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_code">Branch Code <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_code"
|
||||
placeholder="Enter Branch Code" name="branch_code" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Address Lines -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address1">Address Line 1 <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address2">Address Line 2</label>
|
||||
<input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- State & District -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="state">State <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="state" name="state" required>
|
||||
<option value="">Select State</option>
|
||||
<?php foreach($state as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="district">District <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="district"
|
||||
placeholder="Enter District" name="district" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- City & Pincode -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_city">City <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_city"
|
||||
placeholder="Enter City" name="city" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="pincode">Pincode <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit / Cancel -->
|
||||
<div class="form-row">
|
||||
<!-- <div class="form-group col-md-12 mt-2"> -->
|
||||
<div style="margin-top: 85px;">
|
||||
<button type="submit" class="btn btn-primary 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>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Section: Contact Details -->
|
||||
<div class="col-md-4" style="background:#f8f9fa; max-height: calc(80vh - 50px); overflow-y:auto; border-radius:8px; padding:10px;">
|
||||
<!-- First Contact -->
|
||||
<div id="contact_1_wrapper" class="bg-white p-2 mb-2 rounded contact-block">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<h6 class="modal-subtitle mb-0">Contact 1</h6>
|
||||
<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="${uniqueId}_remove"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contact Form Fields -->
|
||||
<div class="form-row">
|
||||
<!-- <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>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="designation">Designation <span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="email">Email <span class="text-danger">*</span></label>
|
||||
<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-row">
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="mobile">Mobile <span class="text-danger">*</span></label>
|
||||
<!-- <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>
|
||||
|
||||
<!-- Container for dynamically added contacts -->
|
||||
<div id="container"></div>
|
||||
|
||||
<div>
|
||||
<button type="button" class="btn btn-primary btn-sm ac me-3" style="width: 100%;" onclick="appendContactHtml()" id="add"><i class="mdi mdi-plus"></i> Add Contact</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Section: Contact Details -->
|
||||
<div class="col-md-4" style="background:#f8f9fa; max-height: calc(80vh - 50px); overflow-y:auto; border-radius:8px; padding:10px;">
|
||||
<!-- First Contact -->
|
||||
<div id="contact_1_wrapper" class="bg-white p-2 mb-2 rounded contact-block">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<h6 class="modal-subtitle mb-0">Contact 1</h6>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contact Form Fields -->
|
||||
<input type="hidden" name="primarykey[]" id="contact_id_1" value=""/>
|
||||
<div class="form-group mb-2">
|
||||
<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>
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<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>
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<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>
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Container for dynamically added contacts -->
|
||||
<div id="container"></div>
|
||||
|
||||
<div>
|
||||
<button type="button" class="btn btn-primary btn-sm ac me-3" style="width: 100%;" onclick="appendContactHtml()" id="add"><i class="mdi mdi-plus"></i> Add Contact</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -310,16 +327,17 @@
|
||||
$(document).ready(function () {
|
||||
|
||||
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();
|
||||
|
||||
// $('#add_branch').hide();
|
||||
$('.btnBack').hide();
|
||||
// $('.btnBack').hide();
|
||||
|
||||
if(insurer_Branch_PrimaryKey !== ''){
|
||||
|
||||
var branchTable = '';
|
||||
var data = <?= isset($insuer_branch) ? json_encode($insuer_branch) : '[]' ?>;
|
||||
console.log("insurer branch data", data);
|
||||
$.each(data, function(index, item) {
|
||||
branchTable += `
|
||||
<tr>
|
||||
@ -347,11 +365,11 @@
|
||||
$("#insurer_branch_form")[0].reset();
|
||||
contactCount = 1
|
||||
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();
|
||||
// $('#add_branch').show();
|
||||
// $('#branch_table').hide();
|
||||
$('.btnBack').show();
|
||||
// $('.btnBack').show();
|
||||
// $('#btnBranchAdd').hide();
|
||||
|
||||
$('#branch_name').val('');
|
||||
@ -391,12 +409,12 @@
|
||||
$('.btnBack').click(function(){
|
||||
|
||||
$("#insurer_branch_form")[0].reset();
|
||||
|
||||
contactCount = 1
|
||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
||||
myModal.hide();
|
||||
$('.close').click();
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
// $('.btnBack').hide();
|
||||
// $('#btnBranchAdd').show();
|
||||
|
||||
$('#branch_name').val('');
|
||||
@ -409,6 +427,7 @@
|
||||
$('#email').val('');
|
||||
$('#mobile').val('');
|
||||
$('#designation').val('');
|
||||
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||
|
||||
})
|
||||
|
||||
@ -430,12 +449,12 @@
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
beforeSend: function() {
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
},
|
||||
success: function(res) {
|
||||
$("#insurer_branch_form")[0].reset();
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#insurer_branch_list tr').remove();
|
||||
var insurerBranchTableInsert = ''
|
||||
@ -453,9 +472,9 @@
|
||||
});
|
||||
|
||||
$('#insurer_branch_list').append(insurerBranchTableInsert);
|
||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
||||
myModal.hide();
|
||||
|
||||
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||
$('.close').click();
|
||||
// window.location.reload();
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
// $('.btnBack').hide();
|
||||
@ -467,10 +486,17 @@
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
},
|
||||
complete: function() {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
$('.close').click();
|
||||
}
|
||||
});
|
||||
|
||||
@ -501,11 +527,11 @@
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
||||
var myModal = new bootstrap.Modal(document.getElementById('insurerBranchModal'));
|
||||
myModal.show();
|
||||
// $('#add_branch').show();
|
||||
// $('#branch_table').show();
|
||||
$('.btnBack').show();
|
||||
// $('.btnBack').show();
|
||||
// $('#btnBranchAdd').hide();
|
||||
console.log("res.levelcontact[0].id"+res.levelcontact[0].id);
|
||||
$('#branch_name').val(res.insurerbranch.branch_name);
|
||||
@ -661,6 +687,7 @@
|
||||
var container = document.getElementById('container');
|
||||
var uniqueId = Date.now().toString();
|
||||
|
||||
// <input type="hidden" name="primarykey[]" id="contact_id_1" value="${contact !== undefined && contact !== false ? contact.id : ''}"/>
|
||||
var html = `
|
||||
<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">
|
||||
@ -669,29 +696,28 @@
|
||||
<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 class="form-row">
|
||||
<input type="hidden" name="primarykey[]" value="${contact ? contact.id : ''}"/>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<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>
|
||||
</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-group col-md-12">
|
||||
<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 class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<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>
|
||||
</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>
|
||||
<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>
|
||||
@ -705,18 +731,29 @@
|
||||
}
|
||||
|
||||
|
||||
function removeContact(btn){
|
||||
var $block = $(btn).closest('.contact-block');
|
||||
var isFirst = $block.attr('id') === 'contact_1_wrapper';
|
||||
|
||||
function removeContact(button) {
|
||||
var uniqueId = button.id.split("_")[0];
|
||||
var contactSection = document.getElementById(uniqueId);
|
||||
|
||||
if (contactSection) {
|
||||
contactSection.parentNode.removeChild(contactSection);
|
||||
renumberContacts(); // ✅ renumber after removal
|
||||
toggleAddButton();
|
||||
if (isFirst) {
|
||||
var $next = $('#container .contact-block').first();
|
||||
if ($next.length){
|
||||
$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() {
|
||||
var totalContacts = document.querySelectorAll('.contact-block, #contact_1_wrapper').length;
|
||||
var addButton = document.querySelector('.ac');
|
||||
|
||||
@ -68,9 +68,9 @@
|
||||
$('#btnBranchAdd').hide();
|
||||
toastr.warning('First Add the Insurer!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
// if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -54,6 +54,7 @@
|
||||
<span class="d-none d-sm-inline-block">History</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
|
||||
<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"
|
||||
aria-expanded="false">
|
||||
@ -61,6 +62,7 @@
|
||||
<span class="d-none d-sm-inline-block">Auto Query Content</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="nav-item">
|
||||
<a href="#uploads-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="uploads_tab"
|
||||
aria-expanded="false">
|
||||
@ -68,6 +70,7 @@
|
||||
<span class="d-none d-sm-inline-block">Claim Files</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
|
||||
<li class="nav-item">
|
||||
<a href="#viewpolicyterms-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="viewpolicyterms_tab"
|
||||
aria-expanded="false">
|
||||
@ -75,6 +78,7 @@
|
||||
<span class="d-none d-sm-inline-block">View Policy Terms</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
<!-- Tab Content -->
|
||||
@ -84,9 +88,11 @@
|
||||
|
||||
if ($ticket_data['ticket_type_id'] == 1) {
|
||||
include('ticket_form_gmc.php');
|
||||
} else if($ticket_data['ticket_type_id'] == 8){
|
||||
include('ticket_form_motor.php');
|
||||
} else {
|
||||
include('ticket_form_gpa.php');
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="reply-tab">
|
||||
@ -98,15 +104,19 @@
|
||||
<div class="tab-pane fade" id="history-tab">
|
||||
<?php include('ticket_history.php'); ?>
|
||||
</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">
|
||||
<?php include('ticket_auto_query.php'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="tab-pane fade" id="uploads-tab">
|
||||
<?php include('claim_files_upload.php'); ?>
|
||||
</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">
|
||||
<?php include('view_policy_terms.php'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -27,11 +27,11 @@
|
||||
<div class="col-12">
|
||||
<div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;">
|
||||
<div class="card-body">
|
||||
<?php // if (!isset($ticket_data)) { ?>
|
||||
<?php if (!isset($ticket_data)) { ?>
|
||||
<!-- Header Section -->
|
||||
<div class="row mb-3">
|
||||
<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 class="col-6 text-right">
|
||||
<a href="<?= base_url('ticket/list'); ?>" aria-label="Back to ticket list">
|
||||
@ -39,16 +39,21 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php // } ?>
|
||||
<form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)"
|
||||
<?php } ?>
|
||||
<form role="form" class="parsley-examples" method="post" id="ticket_form_data"
|
||||
onsubmit="return validateBeforeSubmit(event, this)"
|
||||
enctype="multipart/form-data">
|
||||
|
||||
<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="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) : "[]" ?>'>
|
||||
|
||||
|
||||
<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="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="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'] : '' ?>">
|
||||
<!-- first_data_points -->
|
||||
<div class="form-row">
|
||||
|
||||
@ -70,62 +75,60 @@
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<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>
|
||||
<?php
|
||||
if (isset($client_for_motor) && count($client_for_motor)) {
|
||||
foreach ($client_for_motor as $value) {
|
||||
$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>
|
||||
|
||||
<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 class="form-group col-md-3">
|
||||
<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>
|
||||
<option value="0">Select Vehicle Number</option>
|
||||
<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</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label class="label-font-size">Policy <span class="text-danger">*</span></label>
|
||||
<select id="emp_client_policy" name="client_policy_id" onchange="fetchOtherDetails(this,2)">
|
||||
<option value=""
|
||||
<label class="label-font-size" for="emp_client_policy">Policy <span class="text-danger">*</span></label>
|
||||
<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="0"
|
||||
data-policynumber="" data-managerid=""
|
||||
data-insuredname="" data-agentid=""
|
||||
data-insurerid="" data-insurername="" >Select Policy Number</option>
|
||||
data-insurerid="" data-insurername="" >Select Policy</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<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" id="agent_id" name="agent_id" value="<?= isset($ticket_data['agent_id']) ? $ticket_data['agent_id'] : '' ?>">
|
||||
<input type="text" id="manager_id" name="manager_id" value="<?= isset($ticket_data['manager_id']) ? $ticket_data['manager_id'] : '' ?>">
|
||||
<input type="text" id="policy_no" name="policy_no" value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>">
|
||||
<input type=text class="form-control" id="insurer_name" placeholder="Insurer" value="<?= isset($ticket_data['insurer_name']) ? $ticket_data['insurer_name'] : '' ?>" readonly>
|
||||
<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="hidden" id="insurer_id" name="insurer_id" value="<?= isset($ticket_data['insurer_id']) ? $ticket_data['insurer_id'] : '' ?>">
|
||||
<input type="hidden" id="agent_id" name="agent_id" value="<?= isset($ticket_data['agent_id']) ? $ticket_data['agent_id'] : '' ?>">
|
||||
<input type="hidden" id="manager_id" name="manager_id" value="<?= isset($ticket_data['manager_id']) ? $ticket_data['manager_id'] : '' ?>">
|
||||
<input type="hidden" id="policy_no" name="policy_no" value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<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'] : '' ?>"
|
||||
name="emp_mobile" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<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'] : '' ?>"
|
||||
name="emp_mail" readonly>
|
||||
</div>
|
||||
@ -179,10 +182,11 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="claim_status">Status <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="claim_status_id" name="claim_status_id" required>
|
||||
<option value="0">Select status</option>
|
||||
<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 data-parsley-trigger="change" data-parsley-required-message="Please select a status">
|
||||
<option value="0">Select Status</option>
|
||||
<?php
|
||||
if (isset($claim_status) && count($claim_status)) {
|
||||
foreach ($claim_status as $key => $value) {
|
||||
@ -1012,6 +1016,11 @@
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
// window.onload = function() {
|
||||
// document.getElementById("ticket_form_data").reset();
|
||||
// };
|
||||
|
||||
$("#emp_client_policy").select2();
|
||||
$("#vehicle_id").select2();
|
||||
$("#client_name").select2();
|
||||
@ -1077,7 +1086,7 @@
|
||||
success: function (res) {
|
||||
// Vehicle dropdown
|
||||
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) {
|
||||
let selected = (vehicleId && vehicleId == item.id) ? "selected" : "";
|
||||
$vehicleSelect.append('<option value="'+ item.id +'" '+selected+'>'+ item.vehicle_no +'</option>');
|
||||
@ -1086,7 +1095,7 @@
|
||||
|
||||
// Policy dropdown
|
||||
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) {
|
||||
let selected = (policyId && policyId == item.id) ? "selected" : "";
|
||||
$policySelect.append(
|
||||
@ -1110,13 +1119,73 @@
|
||||
});
|
||||
}
|
||||
|
||||
function setReadonlyField(fieldId, value, labelText) {
|
||||
if (value && value.trim() !== "") {
|
||||
$("#" + fieldId).val(value).prop("readonly", true).prop("required", false);
|
||||
$('label[for="' + fieldId + '"]').html(labelText);
|
||||
} else {
|
||||
$("#" + fieldId).val("").prop("readonly", false).prop("required", true);
|
||||
$('label[for="' + fieldId + '"]').html(labelText + ' <span class="text-danger">*</span>');
|
||||
function setReadonlyField(fieldId, value, labelText) {
|
||||
let $field = $("#" + fieldId);
|
||||
let $label = $('label[for="' + fieldId + '"]');
|
||||
|
||||
if (value && value.trim() !== "") {
|
||||
// Not required, readonly
|
||||
$field.val(value).prop("readonly", true).prop("required", false)
|
||||
.removeAttr("data-parsley-trigger")
|
||||
.removeAttr("data-parsley-required-message");
|
||||
$label.html(labelText);
|
||||
} else {
|
||||
$field.val("").prop("readonly", false).prop("required", true)
|
||||
.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>
|
||||
@ -14,17 +14,17 @@
|
||||
<!-- Optional CSS -->
|
||||
<style>
|
||||
/* Make modal really XL and scrollable */
|
||||
#branchModal .modal-dialog.modal-xl {
|
||||
#tpaBranchModal .modal-dialog.modal-xl {
|
||||
max-width: 90%;
|
||||
height: 90vh;
|
||||
}
|
||||
|
||||
#branchModal .modal-content {
|
||||
#tpaBranchModal .modal-content {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#branchModal .modal-body {
|
||||
#tpaBranchModal .modal-body {
|
||||
overflow-y: auto;
|
||||
max-height: 80vh;
|
||||
}
|
||||
@ -166,7 +166,7 @@
|
||||
</div>
|
||||
<!-- end -->
|
||||
<!-- 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-content">
|
||||
<!-- Modal Header -->
|
||||
@ -179,20 +179,24 @@
|
||||
|
||||
<!-- Modal Body -->
|
||||
<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">
|
||||
|
||||
<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 -->
|
||||
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
|
||||
<!-- Branch Name & Code -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<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 class="form-group col-md-6">
|
||||
<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>
|
||||
|
||||
@ -200,11 +204,11 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<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 class="form-group col-md-6">
|
||||
<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>
|
||||
|
||||
@ -213,15 +217,17 @@
|
||||
<div class="form-group col-md-6">
|
||||
<label for="state">State <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="state" name="state" required>
|
||||
<option value="">Select State</option>
|
||||
<?php foreach($state as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
|
||||
<?php } ?>
|
||||
<option value="">Select State</option>
|
||||
<?php if ($state) {
|
||||
foreach($state as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
|
||||
<?php } }?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<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>
|
||||
|
||||
@ -229,18 +235,19 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<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 class="form-group col-md-6">
|
||||
<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>
|
||||
|
||||
<!-- Submit / Cancel -->
|
||||
<div class="form-row">
|
||||
<!-- <div class="form-group col-md-12 mt-2"> -->
|
||||
<div class="mt-2">
|
||||
<!-- <div class="form-group col-md-12 mt-2"> -->
|
||||
<div style="margin-top: 85px;">
|
||||
<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>
|
||||
</div>
|
||||
@ -260,22 +267,30 @@
|
||||
</div>
|
||||
|
||||
<!-- Contact Form Fields -->
|
||||
<input type="hidden" name="primarykey[]" id="contact_id_1" value=""/>
|
||||
<div class="form-group mb-2">
|
||||
<!-- <input type="hidden" name="primarykey[]" id="contact_id_1" value=""/> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<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 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>
|
||||
<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 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>
|
||||
<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 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>
|
||||
<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>
|
||||
|
||||
@ -309,21 +324,21 @@ $(document).ready(function () {
|
||||
|
||||
var tpa_Branch_PrimaryKey = $('#tpa_id_branch').val();
|
||||
var tpa_branch_form_action = '';
|
||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
||||
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
|
||||
myModal.hide();
|
||||
// $('#add_branch').hide();
|
||||
$('.btnBack').hide();
|
||||
// $('.btnBack').hide();
|
||||
|
||||
loadBranchList();
|
||||
|
||||
$('#btnBranchAdd').click(function(){
|
||||
|
||||
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();
|
||||
// $('#add_branch').show();
|
||||
// $('#branch_table').hide();
|
||||
$('.btnBack').show();
|
||||
// $('.btnBack').show();
|
||||
// $('#btnBranchAdd').hide();
|
||||
|
||||
$('#branch_name').val('');
|
||||
@ -364,11 +379,11 @@ $(document).ready(function () {
|
||||
|
||||
$('.btnBack').click(function(){
|
||||
|
||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
||||
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
|
||||
myModal.hide();
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
// $('.btnBack').hide();
|
||||
// $('#btnBranchAdd').show();
|
||||
|
||||
$('#branch_name').val('');
|
||||
@ -381,6 +396,7 @@ $(document).ready(function () {
|
||||
$('#email').val('');
|
||||
$('#mobile').val('');
|
||||
$('#designation').val('');
|
||||
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||
|
||||
|
||||
})
|
||||
@ -449,8 +465,8 @@ $(document).ready(function () {
|
||||
});
|
||||
}
|
||||
$('#tpa_branch_list').append(tpaBranchTableInsert);
|
||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
||||
myModal.hide();
|
||||
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||
$('.close').click();
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
// $('.btnBack').hide();
|
||||
@ -464,6 +480,13 @@ $(document).ready(function () {
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
},
|
||||
complete: function() {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
$('.close').click();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -487,7 +510,7 @@ $(document).ready(function () {
|
||||
}, 1000);
|
||||
console.log("tpa.............");
|
||||
console.log(res)
|
||||
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
|
||||
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
|
||||
myModal.show();
|
||||
// $('#add_branch').show();
|
||||
// $('#branch_table').hide();
|
||||
@ -663,7 +686,7 @@ function renumberContacts() {
|
||||
|
||||
var container = document.getElementById('container');
|
||||
var uniqueId = Date.now().toString();
|
||||
|
||||
// <input type="hidden" name="primarykey[]" value="${contact ? contact.id : ''}"/>
|
||||
var html = `
|
||||
<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">
|
||||
@ -673,28 +696,28 @@ function renumberContacts() {
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<input type="hidden" name="primarykey[]" value="${contact ? contact.id : ''}"/>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<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>
|
||||
</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-group col-md-12">
|
||||
<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 class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<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>
|
||||
</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>
|
||||
<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>
|
||||
@ -707,15 +730,26 @@ function renumberContacts() {
|
||||
}
|
||||
}
|
||||
|
||||
function removeContact(button) {
|
||||
var uniqueId = button.id.split("_")[0];
|
||||
var contactSection = document.getElementById(uniqueId);
|
||||
function removeContact(btn){
|
||||
var $block = $(btn).closest('.contact-block');
|
||||
var isFirst = $block.attr('id') === 'contact_1_wrapper';
|
||||
|
||||
if (contactSection) {
|
||||
contactSection.parentNode.removeChild(contactSection);
|
||||
renumberContacts(); // ✅ renumber after removal
|
||||
toggleAddButton();
|
||||
if (isFirst) {
|
||||
var $next = $('#container .contact-block').first();
|
||||
if ($next.length){
|
||||
$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() {
|
||||
|
||||
@ -83,9 +83,9 @@ body {
|
||||
$('#btnBranchAdd').hide();
|
||||
toastr.warning('First Add the TPA!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
// if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user