cargando datos

This commit is contained in:
2024-10-18 01:43:41 +02:00
parent 7c9b8a0b6d
commit 8a044d41fe
9 changed files with 11610 additions and 64 deletions

View File

@ -21,10 +21,13 @@ if (session()->has('error')) {
<div id="sk-alert">
</div>
<div id="sk-alert-2">
</div>
<?= $this->section('globalJsFunctions') ?>
function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert'){
function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert', fade = true){
var htmlString = `
<div class="alert ${alertClass} d-flex align-items-baseline" role="alert">
<span class="alert-icon alert-icon-lg text-primary me-2">
@ -37,25 +40,39 @@ function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert'){
if(containerId == 'sk-alert'){
$(window).scrollTop(0);
}
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow", function(){
if(fade){
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow", function(){
setTimeout(function(){
$('#' + containerId).fadeOut("slow");
}, 5000);
});
}
else{
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow");
$('html, body').animate({ scrollTop: 0 }, 500);
}
}
function popSuccessAlert(successMsg, containerId = 'sk-alert', fade = true){
popAlert(successMsg, "alert-success", "ti-check", containerId, fade);
}
function popWarningAlert(warningMsg, containerId = 'sk-alert', fade = true){
popAlert(warningMsg, "alert-warning", "ti-bell", containerId, fade);
}
function popErrorAlert(errorMsg, containerId = 'sk-alert', fade = true){
popAlert(errorMsg, "alert-danger", "ti-ban", containerId, fade);
}
function popAlert2Hide(containerId = 'sk-alert-2'){
$('#' + containerId).hide().empty().fadeIn("slow", function(){
setTimeout(function(){
$('#' + containerId).fadeOut("slow");
}, 5000);
}, 2000);
});
}
function popSuccessAlert(successMsg, containerId = 'sk-alert'){
popAlert(successMsg, "alert-success", "ti-check", containerId);
}
function popWarningAlert(warningMsg, containerId = 'sk-alert'){
popAlert(warningMsg, "alert-warning", "ti-bell", containerId);
}
function popErrorAlert(errorMsg, containerId = 'sk-alert'){
popAlert(errorMsg, "alert-danger", "ti-ban", containerId);
}
<?php if (isset($successMessage) && $successMessage){ ?>
popSuccessAlert(`<?= $successMessage ?>`);
<?php } ?>