FIX_UI support
This commit is contained in:
parent
c7dacf02a7
commit
9682865454
@ -377,8 +377,8 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn app-btn-outline-secondary app-btn-border-radius mr-2 " type="button" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button class="btn app-btn-secondary app-btn-border-radius waves-effect waves-light" id="btnSubmit">Submit</button>
|
||||
<button class="btn app-btn-outline-secondary mr-2 " type="button" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button class="btn app-btn-secondary waves-effect waves-light" id="btnSubmit">Submit</button>
|
||||
<!-- <button type="button" class="btn btn-secondry waves-effect waves-light mr-1" data-dismiss="modal" aria-hidden="true">Close</button> -->
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -1,3 +1,25 @@
|
||||
<style>
|
||||
.input-icon {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input-icon .form-control {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.input-icon .additional-icon {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
pointer-events: none;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<!-- modal content -->
|
||||
<div id="con-close-modal" class="modal fade app-font-family" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg" <?= !isset($CD_Master_Data) ? 'style="max-width: 35% !important; margin:5px auto!important;"' : '' ?>>
|
||||
@ -78,8 +100,8 @@
|
||||
</div>
|
||||
|
||||
<div id="cdButtonWrapper" class="form-group text-right m-b-0">
|
||||
<button class="btn app-btn-outline-secondary app-btn-border-radius mr-2 " type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetCdMasterFormModal()">Cancel</button>
|
||||
<button class="btn app-btn-secondary app-btn-border-radius waves-effect waves-light" id="cd_master_btn_Submit">Submit</button>
|
||||
<button class="btn app-btn-outline-secondary mr-2 " type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetCdMasterFormModal()">Cancel</button>
|
||||
<button class="btn btn-primary waves-effect waves-light" id="cd_master_btn_Submit">Submit</button>
|
||||
<!-- <button type="button" class="btn btn-secondry waves-effect waves-light mr-1" data-dismiss="modal" aria-hidden="true">Close</button> -->
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
<div class="tab-pane fade" id="branch-tab" style="padding-left: 25px;">
|
||||
|
||||
<div class="row float-right" style="padding-bottom: 10px;position: relative;">
|
||||
<a href="#" id="btnBranchAdd" class="btn app-btn-primary app-btn-border-radius mr-2"><span class="mdi mdi-plus" aria-hidden="true" style="padding: 5px 10px;"></span>Add Branch</a>
|
||||
<a href="#" id="btnBranchAdd" class="btn app-btn-primary mr-2"><span class="mdi mdi-plus" aria-hidden="true" style="padding: 5px 10px;"></span>Add Branch</a>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive" id="branch_table" >
|
||||
@ -244,9 +244,9 @@
|
||||
<!-- Submit / Cancel -->
|
||||
<div class="form-row">
|
||||
<!-- <div class="form-group col-md-12 mt-2"> -->
|
||||
<div class="mt-2">
|
||||
<button type="submit" class="btn app-btn-secondary app-btn-border-radius mr-2" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn app-btn-outline-secondary app-btn-border-radius btnBack" id="btnBack" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<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>
|
||||
@ -254,13 +254,11 @@
|
||||
|
||||
<!-- 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 class="bg-white p-2 mb-2 rounded">
|
||||
<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-plus text-primary ac me-3" style="cursor:pointer; font-size:24px !important;" onclick="appendContactHtml()" id="add"></i>
|
||||
<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>
|
||||
@ -268,26 +266,30 @@
|
||||
<!-- Contact Form Fields -->
|
||||
<input type="hidden" name="primarykey[]" id="contact_id_1" value=""/>
|
||||
<div class="form-group mb-2">
|
||||
<label for="name_1">Name <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name_1" required>
|
||||
<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_1">Designation <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation_1" required>
|
||||
<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_1">Email <span class="text-danger">*</span></label>
|
||||
<input type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email_1" required>
|
||||
<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_1">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_1" required>
|
||||
<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>
|
||||
@ -456,7 +458,7 @@
|
||||
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
// $('.btnBack').hide();
|
||||
// $('#btnBranchAdd').show();
|
||||
|
||||
},
|
||||
@ -505,6 +507,7 @@
|
||||
// $('#branch_table').show();
|
||||
$('.btnBack').show();
|
||||
// $('#btnBranchAdd').hide();
|
||||
console.log("res.levelcontact[0].id"+res.levelcontact[0].id);
|
||||
$('#branch_name').val(res.insurerbranch.branch_name);
|
||||
$('#branch_code').val(res.insurerbranch.branch_code);
|
||||
$('#state option[value="' + res.insurerbranch.state + '"]').prop('selected', true);
|
||||
@ -545,102 +548,187 @@
|
||||
|
||||
|
||||
|
||||
// function appendContactHtml(contact = false, reset = false) {
|
||||
|
||||
// console.log('appendContactHtml function called ')
|
||||
// contactCount++;
|
||||
|
||||
// var container = document.getElementById('container');
|
||||
// var uniqueId = Date.now().toString();
|
||||
|
||||
// var html = `
|
||||
// <div id="${uniqueId}" class="bg-white p-2 mb-2 rounded">
|
||||
// <div class="d-flex justify-content-between align-items-center mb-2">
|
||||
// <h6 class="modal-subtitle mb-0">Contact ${contactCount}</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>
|
||||
// <br>
|
||||
// <div class="form-row">
|
||||
// <input type="hidden" name="primarykey[]" id="contact_id_1" value="${contact !== undefined && contact !== false ? contact.id : ''}"/>
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
|
||||
// <input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
// <input data-parsley-type="email" value="${contact !== undefined && contact !== false ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
// <input data-parsley-type="number" data-parsley-length="[10,10]" pattern="[0-9]{10}" value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
// <input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// `;
|
||||
|
||||
// if(reset == false){
|
||||
// container.insertAdjacentHTML('beforeend', html);
|
||||
// storeButtonId(uniqueId + '_add');
|
||||
|
||||
// if (contactCount >= 3) {
|
||||
// hideStoredAddButtons();
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// function removeContact(button) {
|
||||
// var uniqueId = button.id.split("_")[0];
|
||||
// var contactSection = document.getElementById(uniqueId);
|
||||
|
||||
// if (contactSection) {
|
||||
// contactSection.parentNode.removeChild(contactSection);
|
||||
// contactCount --;
|
||||
|
||||
// if (contactCount < 3) {
|
||||
// var addButton = document.querySelector('.ac');
|
||||
// if (addButton) {
|
||||
// addButton.style.display = 'block';
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// function storeButtonId(id) {
|
||||
|
||||
// var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
// buttonIds.push(id);
|
||||
// localStorage.setItem('buttonIds', JSON.stringify(buttonIds));
|
||||
// }
|
||||
|
||||
|
||||
// function hideStoredAddButtons() {
|
||||
// var storedIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
// storedIds.forEach(function(id) {
|
||||
// var addButton = document.getElementById(id);
|
||||
// var first_addButton = document.querySelector('.ac')
|
||||
// if (addButton) {
|
||||
// addButton.style.display = 'none';
|
||||
// first_addButton.style.display = 'none';
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
function renumberContacts() {
|
||||
var contacts = document.querySelectorAll('.contact-block');
|
||||
|
||||
contacts.forEach(function(contact, index) {
|
||||
let title = contact.querySelector('.modal-subtitle');
|
||||
if (title) {
|
||||
title.textContent = "Contact " + (index + 1); // auto numbering
|
||||
}
|
||||
});
|
||||
|
||||
contactCount = contacts.length; // keep global in sync
|
||||
}
|
||||
|
||||
|
||||
function appendContactHtml(contact = false, reset = false) {
|
||||
console.log('appendContactHtml function called ');
|
||||
|
||||
console.log('appendContactHtml function called ')
|
||||
contactCount++;
|
||||
var container = document.getElementById('container');
|
||||
var uniqueId = Date.now().toString();
|
||||
|
||||
var container = document.getElementById('container');
|
||||
var uniqueId = Date.now().toString();
|
||||
|
||||
var html = `
|
||||
<div id="${uniqueId}" class="bg-white p-2 m-1 rounded">
|
||||
<div class="bg-white p-2 mb-2 rounded">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<h6 class="modal-subtitle mb-0">Contact ${contactCount}</h6>
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="mdi mdi-plus text-primary ac me-3" style="cursor:pointer; font-size:24px !important;" onclick="appendContactHtml()" id="${uniqueId}_add"></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>
|
||||
<br>
|
||||
<div class="form-row">
|
||||
<input type="hidden" name="primarykey[]" id="contact_id_1" value="${contact !== undefined && contact !== false ? contact.id : ''}"/>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
<input data-parsley-type="email" value="${contact !== undefined && contact !== false ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input data-parsley-type="number" data-parsley-length="[10,10]" pattern="[0-9]{10}" value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
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">
|
||||
<h6 class="modal-subtitle mb-0"></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>
|
||||
`;
|
||||
|
||||
if(reset == false){
|
||||
container.insertAdjacentHTML('beforeend', html);
|
||||
storeButtonId(uniqueId + '_add');
|
||||
|
||||
if (contactCount >= 3) {
|
||||
hideStoredAddButtons();
|
||||
}
|
||||
}
|
||||
<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>Email<span class="text-danger">*</span></label>
|
||||
<input value="${contact ? contact.email : ''}" 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
if(!reset){
|
||||
container.insertAdjacentHTML('beforeend', html);
|
||||
renumberContacts(); // ✅ fix numbering
|
||||
toggleAddButton();
|
||||
}
|
||||
}
|
||||
|
||||
function removeContact(button) {
|
||||
var uniqueId = button.id.split("_")[0];
|
||||
var contactSection = document.getElementById(uniqueId);
|
||||
|
||||
if (contactSection) {
|
||||
contactSection.parentNode.removeChild(contactSection);
|
||||
contactCount --;
|
||||
|
||||
if (contactCount < 3) {
|
||||
var addButton = document.querySelector('.ac');
|
||||
if (addButton) {
|
||||
addButton.style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
function storeButtonId(id) {
|
||||
function toggleAddButton() {
|
||||
var totalContacts = document.querySelectorAll('.contact-block, #contact_1_wrapper').length;
|
||||
var addButton = document.querySelector('.ac');
|
||||
|
||||
var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
buttonIds.push(id);
|
||||
localStorage.setItem('buttonIds', JSON.stringify(buttonIds));
|
||||
if (totalContacts >= 3) {
|
||||
addButton.style.display = 'none';
|
||||
} else {
|
||||
addButton.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function hideStoredAddButtons() {
|
||||
var storedIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
storedIds.forEach(function(id) {
|
||||
var addButton = document.getElementById(id);
|
||||
var first_addButton = document.querySelector('.ac')
|
||||
if (addButton) {
|
||||
addButton.style.display = 'none';
|
||||
first_addButton.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showNextAddButton() {
|
||||
var storedIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
var addButtonShown = false;
|
||||
|
||||
@ -62,13 +62,13 @@
|
||||
|
||||
<div class="form-group col-md-6" style="position: relative;top: 28px;">
|
||||
<label for="email"><span class="text-danger"></span></label>
|
||||
<a href="#" class="btn app-btn-secondary app-btn-border-radius mr-2" onclick="checkInsurerTemplete(this)">Copy</a>
|
||||
<a href="#" class="btn app-btn-secondary mr-2" onclick="checkInsurerTemplete(this)">Copy</a>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2" style="position: relative;top: 28px;">
|
||||
<div class="float-right">
|
||||
<label for="email"><span class="text-danger"></span></label>
|
||||
<a href="#" class="btn app-btn-primary app-btn-border-radius" onclick="addNewJsonExportTemplate(this)"><i class="mdi mdi-plus"></i> Add </a>
|
||||
<a href="#" class="btn app-btn-primary " onclick="addNewJsonExportTemplate(this)"><i class="mdi mdi-plus"></i> Add </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -194,7 +194,7 @@
|
||||
|
||||
</div>
|
||||
<div class="form-group text-right m-b-0" id="hide_smbt_btn">
|
||||
<button type="submit" class="btn btn-primary app-btn-border-radius waves-effect waves-light mr-1">Submit</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -511,8 +511,8 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2" style="position: relative;left: 28px;">
|
||||
<a class="btn app-btn-secondary app-btn-border-radius waves-effect waves-light mr-1" onclick="addHTMLInput(this)"><i class="mdi mdi-plus text-white" style="cursor:pointer; font-size:15px !important;"></i></a>
|
||||
<a class="btn btn-danger app-btn-border-radius waves-effect waves-light" onclick="removeHTMLInput(this)"><i class="mdi mdi-trash-can text-white" style="cursor:pointer; font-size:15px !important;"></i></a>
|
||||
<a class="btn app-btn-secondary waves-effect waves-light mr-1" onclick="addHTMLInput(this)"><i class="mdi mdi-plus text-white" style="cursor:pointer; font-size:15px !important;"></i></a>
|
||||
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)"><i class="mdi mdi-trash-can text-white" style="cursor:pointer; font-size:15px !important;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="row" style="padding-bottom: 10px;padding-left: 20px;">
|
||||
<div class="row" style="padding-bottom: 10px;padding-left: 5px;">
|
||||
<h4 class="d-flex align-items-center" style="gap: 8px;">
|
||||
<span onclick="history.back()" style="cursor: pointer;">
|
||||
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div class="tab-pane fade" id="branch-tab" style="padding-left: 22px;">
|
||||
<div class="tab-pane fade" id="branch-tab">
|
||||
|
||||
<div class="row float-right" style="padding-bottom: 10px;position: relative;right: 13px;">
|
||||
<button type="button" id="btnBranchAdd" class="btn btn-primary waves-effect waves-light btn-sm"><span class="mdi mdi-plus-box-outline" aria-hidden="true" style="padding: 5px 10px;"></span>Add KYC Docs</button>
|
||||
@ -89,10 +89,10 @@
|
||||
|
||||
<!-- Form Actions -->
|
||||
<div class="form-group text-right mb-0">
|
||||
<button type="button" class="btn app-btn-outline-secondary app-btn-border-radius waves-effect btnBack" id="btnBack" data-dismiss="modal">
|
||||
<button type="button" class="btn app-btn-outline-secondary waves-effect btnBack" id="btnBack" data-dismiss="modal">
|
||||
Cancel
|
||||
</button>
|
||||
<button type="submit" class="btn app-btn-secondary app-btn-border-radius waves-effect waves-light mr-1" id="btnSubmit">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<div class="tab-pane fade active show" id="general-q-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<div class="card-body subcard">
|
||||
<div class="custom-form">
|
||||
<form role="form" class="parsley-examples" method="post" id="kyc_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
@ -21,7 +21,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary app-btn-border-radius waves-effect waves-light mr-1"
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack"
|
||||
id="btnBack">Cancel</button>
|
||||
|
||||
@ -34,7 +34,7 @@ body {
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body maincard">
|
||||
<div class="row" style="padding-bottom: 10px;padding-left: 20px;">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<h4 class="d-flex align-items-center" style="gap: 8px;">
|
||||
<span onclick="history.back()" style="cursor: pointer;">
|
||||
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
|
||||
|
||||
@ -520,8 +520,6 @@ a.app-text-success:hover, a.app-text-success:focus {
|
||||
box-shadow: 0 0 0 0.15rem rgba(226, 103, 40, 0.5); }
|
||||
|
||||
|
||||
.app-btn-border-radius{ border-radius: 10px !important; }
|
||||
|
||||
.app-badge-primary {
|
||||
color: #ffffff;
|
||||
background-color: #00999E; }
|
||||
@ -1093,9 +1091,9 @@ a.app-badge-secondary:focus, a.app-badge-secondary.focus {
|
||||
}
|
||||
.custom-form .form-control {
|
||||
background-color: #F5FFFF !important;
|
||||
border: 1px solid #ccc; /* optional */
|
||||
border: none !important;
|
||||
/* color: #000; keep text readable */
|
||||
box-shadow: none !important;
|
||||
box-shadow: 0px 1px 1px 0px #00000040;
|
||||
}
|
||||
.custom-form .form-control:focus {
|
||||
background-color: #F5FFFF !important;
|
||||
@ -1103,7 +1101,7 @@ a.app-badge-secondary:focus, a.app-badge-secondary.focus {
|
||||
}
|
||||
.custom-form .select2-container--default .select2-selection--multiple {
|
||||
background-color: #F5FFFF !important;
|
||||
border: 1px solid #ccc;
|
||||
border: none !important;
|
||||
}
|
||||
.custom-form .select2-container .select2-selection--single {
|
||||
background-color: #F5FFFF !important;
|
||||
@ -1121,6 +1119,11 @@ a.app-badge-secondary:focus, a.app-badge-secondary.focus {
|
||||
margin-top:0 !important;
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.subcard{
|
||||
padding-top: 0px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<div class="tab-pane fade active show" id="general-q-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<div class="card-body subcard">
|
||||
<div class="custom-form">
|
||||
<form role="form" class="parsley-examples" method="post" id="policytype_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
@ -76,7 +76,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary app-btn-border-radius waves-effect waves-light mr-1"
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack"
|
||||
id="btnBack">Cancel</button>
|
||||
|
||||
@ -42,7 +42,7 @@ body {
|
||||
<a href="<?= base_url("master/policy/list"); ?>"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i> </a>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="row" style="padding-bottom: 10px;padding-left: 20px;">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<h4 class="d-flex align-items-center" style="gap: 8px;">
|
||||
<span onclick="history.back()" style="cursor: pointer;">
|
||||
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
|
||||
|
||||
@ -281,8 +281,8 @@ table.dataTable td.wrap {
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn app-btn-primary app-btn-border-radius mr-2 " onclick="resetTicket()">Reset</button>
|
||||
<button type="submit" class="btn app-btn-secondary app-btn-border-radius" onclick="submitTicket(event)">Save</button>
|
||||
<button type="button" class="btn app-btn-primary mr-2 " onclick="resetTicket()">Reset</button>
|
||||
<button type="submit" class="btn app-btn-secondary " onclick="submitTicket(event)">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -314,7 +314,7 @@ table.dataTable td.wrap {
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn-custom app-btn-secondary app-btn-border-radius " onclick="updateAssignTo()">Save</button>
|
||||
<button type="button" class="btn-custom app-btn-secondary " onclick="updateAssignTo()">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -610,7 +610,7 @@ $(document).ready(function() {
|
||||
buttons: [
|
||||
{
|
||||
text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Create New Ticket </span>',
|
||||
className: 'btn app-btn-primary app-btn-border-radius mr-2',
|
||||
className: 'btn app-btn-primary mr-2',
|
||||
action: function(e, dt, node, config) {
|
||||
openTicket();
|
||||
}
|
||||
@ -618,7 +618,7 @@ $(document).ready(function() {
|
||||
{
|
||||
extend: 'collection',
|
||||
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
|
||||
className: 'btn app-btn-secondary app-btn-border-radius',
|
||||
className: 'btn app-btn-secondary ',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
|
||||
@ -386,7 +386,7 @@ hr{
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn app-btn-secondary app-btn-border-radius" onclick="submitTicket()">Save</button>
|
||||
<button type="button" class="btn app-btn-secondary " onclick="submitTicket()">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
/* .delete-btn {
|
||||
background-color: #e5f7f6;
|
||||
color: #00999E;
|
||||
border: none;
|
||||
@ -36,7 +36,7 @@
|
||||
padding: 6px 20px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
}
|
||||
} */
|
||||
|
||||
.helper-text {
|
||||
font-size: 12px;
|
||||
@ -58,7 +58,7 @@
|
||||
<div class="tab-pane fade active show" id="general-q-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body" style="padding-top: 0px;">
|
||||
<div class="card-body subcard">
|
||||
<div class="custom-form">
|
||||
<form role="form" class="parsley-examples" method="post" id="tpa_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
@ -144,7 +144,7 @@
|
||||
<div class="col">
|
||||
<div class="d-flex">
|
||||
<button type="button" class="upload-btn" onclick="document.getElementById('tpa_logo').click();">Upload</button>
|
||||
<button type="button" class="delete-btn" onclick="removeImage0();">Delete</button>
|
||||
<!-- <button type="button" class="delete-btn" onclick="removeImage0();">Delete</button> -->
|
||||
</div>
|
||||
<div class="helper-text" id="fileNameText0">
|
||||
<?= isset($tpa['tpa_logo']) && !empty($tpa['tpa_logo']) ? $tpa['tpa_logo'] : '( Upload Your TPA Logo )' ?>
|
||||
@ -177,7 +177,7 @@
|
||||
<div class="col">
|
||||
<div class="d-flex">
|
||||
<button type="button" class="upload-btn" onclick="document.getElementById('fc').click();">Upload</button>
|
||||
<button type="button" class="delete-btn" onclick="removeImage1();">Delete</button>
|
||||
<!-- <button type="button" class="delete-btn" onclick="removeImage1();">Delete</button> -->
|
||||
</div>
|
||||
<div class="helper-text" id="fileNameText1">
|
||||
<?= isset($tpa['front_card']) && !empty($tpa['front_card']) ? $tpa['front_card'] : '( Upload Your Front card Image )' ?>
|
||||
@ -210,7 +210,7 @@
|
||||
<div class="col">
|
||||
<div class="d-flex">
|
||||
<button type="button" class="upload-btn" onclick="document.getElementById('bc').click();">Upload</button>
|
||||
<button type="button" class="delete-btn" onclick="removeImage4();">Delete</button>
|
||||
<!-- <button type="button" class="delete-btn" onclick="removeImage4();">Delete</button> -->
|
||||
</div>
|
||||
<div class="helper-text" id="fileNameText4">
|
||||
<?= isset($tpa['back_card']) && !empty($tpa['back_card']) ? $tpa['back_card'] : '( Upload Your Back card Image )' ?>
|
||||
@ -230,7 +230,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn app-btn-secondary app-btn-border-radius waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<button type="submit" class="btn app-btn-secondary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack" id="btnBack">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -29,10 +29,10 @@
|
||||
max-height: 80vh;
|
||||
}
|
||||
</style>
|
||||
<div class="tab-pane fade" id="branch-tab" style="padding-left: 22px;">
|
||||
<div class="tab-pane fade" id="branch-tab">
|
||||
|
||||
<div class="row float-right" style="padding-bottom: 10px;position: relative;">
|
||||
<a href="#" id="btnBranchAdd" class="btn app-btn-primary app-btn-border-radius mr-2"><span class="mdi mdi-plus" aria-hidden="true" style="padding: 5px 10px;"></span>Add Branch</a>
|
||||
<a href="#" id="btnBranchAdd" class="btn app-btn-primary mr-2"><span class="mdi mdi-plus" aria-hidden="true" style="padding: 5px 10px;"></span>Add Branch</a>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive" id="branch_table" >
|
||||
@ -241,8 +241,8 @@
|
||||
<div class="form-row">
|
||||
<!-- <div class="form-group col-md-12 mt-2"> -->
|
||||
<div class="mt-2">
|
||||
<button type="submit" class="btn app-btn-secondary app-btn-border-radius mr-2" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn app-btn-outline-secondary app-btn-border-radius btnBack" id="btnBack" data-dismiss="modal" aria-hidden="true">Cancel</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>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
@ -250,13 +250,11 @@
|
||||
|
||||
<!-- 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 class="bg-white p-2 mb-2 rounded">
|
||||
<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-plus text-primary ac me-3" style="cursor:pointer; font-size:24px !important;" onclick="appendContactHtml()" id="add"></i>
|
||||
<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>
|
||||
@ -264,26 +262,30 @@
|
||||
<!-- Contact Form Fields -->
|
||||
<input type="hidden" name="primarykey[]" id="contact_id_1" value=""/>
|
||||
<div class="form-group mb-2">
|
||||
<label for="name_1">Name <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name_1" required>
|
||||
<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_1">Designation <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation_1" required>
|
||||
<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_1">Email <span class="text-danger">*</span></label>
|
||||
<input type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email_1" required>
|
||||
<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_1">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_1" required>
|
||||
<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>
|
||||
@ -451,7 +453,7 @@ $(document).ready(function () {
|
||||
myModal.hide();
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
// $('.btnBack').hide();
|
||||
// $('#btnBranchAdd').show();
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
@ -587,75 +589,163 @@ $(document).ready(function () {
|
||||
|
||||
|
||||
|
||||
function appendContactHtml(contact = false, reset = false) {
|
||||
// function appendContactHtml(contact = false, reset = false) {
|
||||
|
||||
console.log('appendContactHtml function called ')
|
||||
contactCount++;
|
||||
// console.log('appendContactHtml function called ')
|
||||
// contactCount++;
|
||||
|
||||
// var container = document.getElementById('container');
|
||||
// var uniqueId = Date.now().toString();
|
||||
|
||||
// var html = `
|
||||
// <div id="${uniqueId}">
|
||||
// <hr>
|
||||
// <h6 class="header-title">Contact ${contactCount}</h6>
|
||||
// <br>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
|
||||
// <input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
// <input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
// <input data-parsley-type="email" value="${contact !== undefined && contact !== false ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
// <input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-group" style="display: flex;">
|
||||
// <button type="button" class="btn btn-danger btn-sm" onclick="removeContact(this)" id="${uniqueId}_remove">Remove</button>
|
||||
// </div>
|
||||
// </div>
|
||||
// `;
|
||||
|
||||
// if(reset == false){
|
||||
// console.log(reset)
|
||||
// container.insertAdjacentHTML('beforeend', html);
|
||||
// storeButtonId(uniqueId + '_add');
|
||||
|
||||
// if (contactCount >= 3) {
|
||||
// hideStoredAddButtons();
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
function renumberContacts() {
|
||||
var contacts = document.querySelectorAll('.contact-block');
|
||||
|
||||
contacts.forEach(function(contact, index) {
|
||||
let title = contact.querySelector('.modal-subtitle');
|
||||
if (title) {
|
||||
title.textContent = "Contact " + (index + 1); // auto numbering
|
||||
}
|
||||
});
|
||||
|
||||
contactCount = contacts.length; // keep global in sync
|
||||
}
|
||||
|
||||
|
||||
function appendContactHtml(contact = false, reset = false) {
|
||||
console.log('appendContactHtml function called ');
|
||||
|
||||
var container = document.getElementById('container');
|
||||
var uniqueId = Date.now().toString();
|
||||
|
||||
var html = `
|
||||
<div id="${uniqueId}">
|
||||
<hr>
|
||||
<h6 class="header-title">Contact ${contactCount}</h6>
|
||||
<br>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
<input data-parsley-type="email" value="${contact !== undefined && contact !== false ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display: flex;">
|
||||
<button style="margin-right: 10px;" type="button" class="btn btn-primary btn-sm ac" onclick="appendContactHtml()" id="${uniqueId}_add">Add Contact</button>
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="removeContact(this)" id="${uniqueId}_remove">Remove</button>
|
||||
<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">
|
||||
<h6 class="modal-subtitle mb-0"></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>
|
||||
<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>Email<span class="text-danger">*</span></label>
|
||||
<input value="${contact ? contact.email : ''}" 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
if(reset == false){
|
||||
console.log(reset)
|
||||
if(!reset){
|
||||
container.insertAdjacentHTML('beforeend', html);
|
||||
storeButtonId(uniqueId + '_add');
|
||||
|
||||
if (contactCount >= 3) {
|
||||
hideStoredAddButtons();
|
||||
}
|
||||
renumberContacts(); // ✅ fix numbering
|
||||
toggleAddButton();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function removeContact(button) {
|
||||
var uniqueId = button.id.split("_")[0];
|
||||
var contactSection = document.getElementById(uniqueId);
|
||||
|
||||
if (contactSection) {
|
||||
contactSection.parentNode.removeChild(contactSection);
|
||||
contactCount --;
|
||||
|
||||
if (contactCount < 3) {
|
||||
var addButton = document.querySelector('.ac');
|
||||
if (addButton) {
|
||||
addButton.style.display = 'block';
|
||||
}
|
||||
}
|
||||
renumberContacts(); // ✅ renumber after removal
|
||||
toggleAddButton();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleAddButton() {
|
||||
var totalContacts = document.querySelectorAll('.contact-block, #contact_1_wrapper').length;
|
||||
var addButton = document.querySelector('.ac');
|
||||
|
||||
if (totalContacts >= 3) {
|
||||
addButton.style.display = 'none';
|
||||
} else {
|
||||
addButton.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
// function removeContact(button) {
|
||||
// var uniqueId = button.id.split("_")[0];
|
||||
// var contactSection = document.getElementById(uniqueId);
|
||||
|
||||
// if (contactSection) {
|
||||
// contactSection.parentNode.removeChild(contactSection);
|
||||
// contactCount --;
|
||||
|
||||
// if (contactCount < 3) {
|
||||
// var addButton = document.querySelector('.ac');
|
||||
// if (addButton) {
|
||||
// addButton.style.display = 'block';
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
function storeButtonId(id) {
|
||||
|
||||
var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
|
||||
@ -34,7 +34,7 @@ body {
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;padding-left: 20px;">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<h4 class="d-flex align-items-center" style="gap: 8px;">
|
||||
<span onclick="history.back()" style="cursor: pointer;">
|
||||
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
|
||||
|
||||
@ -218,8 +218,8 @@ table.dataTable tbody td {
|
||||
|
||||
</div>
|
||||
<div class="form-group text-right m-b-0" id="hide_smbt_btn">
|
||||
<button class="btn app-btn-outline-secondary app-btn-border-radius mr-2 close" type="button" id="close_btn" data-dismiss="modal" aria-label="Close" aria-hidden="true">Cancel</button>
|
||||
<button type="submit" id="btnSubmit" class="btn app-btn-secondary app-btn-border-radius waves-effect waves-light" id="cd_master_btn_Submit">Submit</button>
|
||||
<button class="btn app-btn-outline-secondary mr-2 colse" type="button" id="close_btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button type="submit" id="btnSubmit" class="btn app-btn-secondary waves-effect waves-light" id="cd_master_btn_Submit">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user