mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
115 lines
4.0 KiB
PHP
115 lines
4.0 KiB
PHP
<?php
|
|
|
|
$errorMessage = $errorMessage ?? session('errorMessage');
|
|
$warningMessage = session('warningMessage');
|
|
|
|
if (session()->has('message')) {
|
|
$successMessage = session('message');
|
|
}
|
|
if (session()->has('error')) {
|
|
$errorMessage = is_array(session('error')) ? implode(session('error')) : session('error');
|
|
} /* // Uncomment this block if you want the errors listed line by line in the alert
|
|
elseif (session()->has('errors')) {
|
|
$errorMessage = '<ul class="text-start">';
|
|
foreach (session('errors') as $error) :
|
|
$errorMessage .= '<li>' . $error . '</li>';
|
|
endforeach;
|
|
$errorMessage .= '</ul>';
|
|
}
|
|
*/
|
|
?>
|
|
|
|
<?php if (isset($successMessage) && $successMessage): ?>
|
|
<div class="alert alert-success alert-dismissible d-flex align-items-baseline" role="alert">
|
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
|
<i class="ti ti-check ti-sm"></i>
|
|
</span>
|
|
<div class="d-flex flex-column ps-1">
|
|
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Success') ?></h5>
|
|
<p class="mb-0"><?= $successMessage; ?></p>
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (isset($errorMessage) && $errorMessage): ?>
|
|
<div class="alert alert-danger alert-dismissible d-flex align-items-baseline" role="alert">
|
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
|
<i class="ti ti-ban ti-sm"></i>
|
|
</span>
|
|
<div class="d-flex flex-column ps-1">
|
|
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Error') ?></h5>
|
|
<p class="mb-0"><?= $errorMessage; ?></p>
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php if (isset($warningMessage) && $warningMessage): ?>
|
|
<div class="alert alert-warning alert-dismissible d-flex align-items-baseline" role="alert">
|
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
|
<i class="ti ti-bell ti-sm"></i>
|
|
</span>
|
|
<div class="d-flex flex-column ps-1">
|
|
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Warning') ?></h5>
|
|
<p class="mb-0"><?= $warningMessage; ?></p>
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div id="sk-alert">
|
|
</div>
|
|
|
|
|
|
<?= $this->section('additionalInlineJs') ?>
|
|
|
|
function popSuccessAlert(successMsg){
|
|
var htmlString = `
|
|
<div class="alert alert-success d-flex align-items-baseline" role="alert">
|
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
|
<i class="ti ti-check ti-sm"></i>
|
|
</span>
|
|
<div class="d-flex flex-column ps-1">
|
|
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Success') ?></h5>
|
|
<p class="mb-0">` + successMsg + `</p>
|
|
</div>
|
|
</div>`;
|
|
|
|
$(window).scrollTop(0);
|
|
$('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){
|
|
setTimeout(function(){
|
|
$('#sk-alert').fadeOut("slow");
|
|
}, 5000);
|
|
});
|
|
}
|
|
|
|
function popErrorAlert(errorMsg){
|
|
var htmlString = `
|
|
<div class="alert alert-error d-flex align-items-baseline" role="alert">
|
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
|
<i class="ti ti-error ti-sm"></i>
|
|
</span>
|
|
<div class="d-flex flex-column ps-1">
|
|
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Error') ?></h5>
|
|
<p class="mb-0">` + errorMsg + `</p>
|
|
</div>
|
|
</div>`;
|
|
|
|
$(window).scrollTop(0);
|
|
$('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){
|
|
setTimeout(function(){
|
|
$('#sk-alert').fadeOut("slow");
|
|
}, 5000);
|
|
});
|
|
}
|
|
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|