Creating modalDialog functionality

This commit is contained in:
imnavajas
2023-09-14 14:15:31 +02:00
parent d5ffd39b5f
commit 3a09e6166a
4 changed files with 118 additions and 18 deletions

View File

@ -99,7 +99,8 @@
</div>
</div> <!-- //.accordion -->
<?php endif; ?>
<?= $this->endSection() ?>
@ -140,8 +141,10 @@
});
$('#isRotativa').on("click",function(el){
AsyncConfirmYesNo('title', 'msg', MyYesFunction, MyNoFunction);
Swal.fire({
/*Swal.fire({
title: '<?= lang('MaquinasPapelImpresion.sureToChangeRotativaTitle') ?>',
text: '<?= lang('MaquinasPapelImpresion.sureToChangeRotativaText') ?>',
icon: 'warning',
@ -172,8 +175,33 @@
yeniden(response.<?= csrf_token() ?>);
}
});
*/
});
function AsyncConfirmYesNo(title, msg, yesFn, noFn) {
var $confirm = $("#modalConfirmYesNo");
$confirm.modal('show');
$("#lblTitleConfirmYesNo").html(title);
$("#lblMsgConfirmYesNo").html(msg);
$("#btnYesConfirmYesNo").off('click').click(function () {
yesFn();
$confirm.modal("hide");
});
$("#btnNoConfirmYesNo").off('click').click(function () {
noFn();
$confirm.modal("hide");
});
}
function MyYesFunction() {
alert("Time to get off your workstation!");
$("#lblTestResult").html("You are hungry");
}
function MyNoFunction() {
alert("Well... just continue working.");
$("#lblTestResult").html("You are not hungry");
}
$('#isPadre').on("click",function(el){
if($(this).is(':checked')){