Changes
Specific Folder FTP Upload / ftp-deploy (push) Successful in 34s Details

This commit is contained in:
Ravi Gulhane 2026-11-04 13:29:42 +05:30
parent a8af1a13d7
commit 2c2b556c0d
1 changed files with 89 additions and 32 deletions

View File

@ -468,6 +468,13 @@
max-width: 220px;
height: auto;
}
#tgics-validate-wa-modal {
z-index: 1055;
}
.tgics-validate-backdrop {
z-index: 1050;
}
</style>
@include('layouts.shared/footer-script')
<script src="{{ asset('assets/libs/sweetalert2/sweetalert2.min.js') }}"></script>
@ -825,6 +832,40 @@
}
}
function hideTgicsValidateModal() {
stopTgicsWaPoll();
var $modal = $('#tgics-validate-wa-modal');
if ($.fn.modal && typeof $modal.modal === 'function') {
$modal.modal('hide');
} else if (window.bootstrap && bootstrap.Modal) {
var inst = bootstrap.Modal.getInstance($modal[0]);
if (inst) {
inst.hide();
}
}
$modal.removeClass('show').css('display', 'none').attr('aria-hidden', 'true');
$('.tgics-validate-backdrop').remove();
$('body').removeClass('modal-open').css('overflow', '');
}
function showTgicsValidateModal() {
var $modal = $('#tgics-validate-wa-modal');
if ($.fn.modal && typeof $modal.modal === 'function') {
$modal.modal('show');
return;
}
if (window.bootstrap && bootstrap.Modal) {
bootstrap.Modal.getOrCreateInstance($modal[0]).show();
return;
}
// Manual fallback when Bootstrap modal JS is unavailable
$modal.addClass('show').css('display', 'block').attr('aria-hidden', 'false');
if (!$('.tgics-validate-backdrop').length) {
$('body').append('<div class="modal-backdrop fade show tgics-validate-backdrop"></div>');
}
$('body').addClass('modal-open');
}
function startTgicsWaPoll(contactId) {
stopTgicsWaPoll();
tgicsWaPollStartedAt = Date.now();
@ -862,40 +903,57 @@
}, 3000);
}
$(document).on('click', '.tgics-validate-wa-btn', function() {
$(document).on('click', '.tgics-validate-wa-btn', function(e) {
e.preventDefault();
e.stopPropagation();
var contactId = $(this).attr('data-contact-id') || '';
var validateUrl = $(this).attr('data-validate-url') || '';
var doctorName = $(this).attr('data-doctor-name') || 'Doctor';
if (!contactId || !validateUrl) {
Swal.fire({
icon: 'error',
title: 'Validation unavailable',
text: 'Missing doctor contact link. Please re-enrol or contact support.'
});
return;
}
$('#tgics-validate-wa-doctor').text(doctorName);
$('#tgics-validate-wa-open').attr('href', validateUrl);
$('#tgics-validate-wa-qr').empty();
if (typeof QRCode !== 'undefined') {
new QRCode(document.getElementById('tgics-validate-wa-qr'), {
text: validateUrl,
width: 200,
height: 200
});
} else {
$('#tgics-validate-wa-qr').html('<p class="text-danger small">Unable to render QR. Use Open link instead.</p>');
try {
if (typeof QRCode !== 'undefined') {
new QRCode(document.getElementById('tgics-validate-wa-qr'), {
text: validateUrl,
width: 200,
height: 200
});
} else {
$('#tgics-validate-wa-qr').html(
'<p class="text-muted small mb-2">QR library unavailable. Use the button below.</p>'
);
}
} catch (qrErr) {
console.error(qrErr);
$('#tgics-validate-wa-qr').html(
'<p class="text-muted small mb-2">Unable to render QR. Use the button below.</p>'
);
}
var $modal = $('#tgics-validate-wa-modal');
if (typeof bootstrap !== 'undefined' && bootstrap.Modal) {
bootstrap.Modal.getOrCreateInstance($modal[0]).show();
} else if ($modal.modal) {
$modal.modal('show');
} else {
$modal.show();
}
showTgicsValidateModal();
startTgicsWaPoll(contactId);
});
$(document).on('click', '#tgics-validate-wa-modal [data-bs-dismiss="modal"], #tgics-validate-wa-modal .btn-close, #tgics-validate-wa-modal .btn-secondary', function() {
hideTgicsValidateModal();
});
$(document).on('click', '.tgics-validate-backdrop', function() {
hideTgicsValidateModal();
});
$('#tgics-validate-wa-modal').on('hidden.bs.modal hide.bs.modal', function() {
stopTgicsWaPoll();
$('.tgics-validate-backdrop').remove();
});
$('#execution-form').on('submit', function(event) {
@ -944,28 +1002,27 @@
today = yyyy + '-' + mm + '-' + dd;
var recordDateField = document.getElementById('field-plan_date');
recordDateField.setAttribute('min', today);
if (recordDateField) {
recordDateField.setAttribute('min', today);
}
var executionDateField = document.getElementById('execution-plan_date');
//executionDateField.setAttribute('min', today);
// $('.edit-btn').click(function() {
// var executionexeField = document.getElementById('execution-record_date');
// executionexeField.setAttribute('min', executionDateField.value);
// });
$('.edit-btn').click(function() {
var executionexeField = document.getElementById('execution-execution_date');
executionexeField.setAttribute('min', executionDateField.value);
if (executionexeField && executionDateField && executionDateField.value) {
executionexeField.setAttribute('min', executionDateField.value);
}
});
executionDateField.addEventListener('change', function() {
console.log('gg');
var executionexeField = document.getElementById('execution-record_date');
executionexeField.setAttribute('min', executionDateField.value);
});
if (executionDateField) {
executionDateField.addEventListener('change', function() {
var executionexeField = document.getElementById('execution-record_date');
if (executionexeField) {
executionexeField.setAttribute('min', executionDateField.value);
}
});
}
});
</script>