Files
safekat/ci4/app/Views/themes/_commonPartialsBs/_modalDialog.php
2023-09-14 14:15:31 +02:00

73 lines
2.2 KiB
PHP

<div id="modalConfirmYesNo" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button"
class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 id="lblTitleConfirmYesNo" class="modal-title">Confirmation</h4>
</div>
<div class="modal-body">
<p id="lblMsgConfirmYesNo"></p>
</div>
<div class="modal-footer">
<button id="btnYesConfirmYesNo"
type="button" class="btn btn-primary">Yes</button>
<button id="btnNoConfirmYesNo"
type="button" class="btn btn-default">No</button>
</div>
</div>
</div>
</div>
<?= $this->section('additionalInlineJs') ?>
function popAlert(message, alertClass, alertIcon){
var htmlString = `
<div class="alert ${alertClass} d-flex align-items-baseline" role="alert">
<span class="alert-icon alert-icon-lg text-primary me-2">
<i class="ti ${alertIcon} ti-sm"></i>
</span>
<div class="d-flex flex-column ps-1">
<h5 class="alert-heading mb-2">${message}</h5>
</div>
</div>`;
$(window).scrollTop(0);
$('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){
setTimeout(function(){
$('#sk-alert').fadeOut("slow");
}, 5000);
});
}
function popSuccessAlert(successMsg){
popAlert(successMsg, "alert-success", "ti-check");
}
function popWarningAlert(warningMsg){
popAlert(warningMsg, "alert-warning", "ti-bell");
}
function popErrorAlert(errorMsg){
popAlert(errorMsg, "alert-danger", "ti-ban");
}
<?php if (isset($successMessage) && $successMessage){ ?>
popSuccessAlert(`<?= $successMessage ?>`);
<?php } ?>
<?php if (isset($warningMessage) && $warningMessage){ ?>
popWarningAlert(`<?= $warningMessage ?>`);
<?php } ?>
<?php if (isset($errorMessage) && $errorMessage){ ?>
popErrorAlert(`<?= $errorMessage ?>`);
<?php } ?>
<?= $this->endSection() ?>