Use toastr notifications and alerts instead dedupe alert feedback code

This commit is contained in:
johnnyq 2022-05-14 13:03:03 -04:00
parent 205c4e1bec
commit 334766e567
7 changed files with 16 additions and 40 deletions

View File

@ -11,9 +11,11 @@
<!-- Page Content -->
<h1>Blank Page</h1>
<hr>
<p>This is a great starting point for new custom pages.
<p>This is a great starting point for new custom pages.</p>
<?php echo CURRENT_DATABASE_VERSION; ?>
</p>
<script>toastr.success('Have Fun Wozz')</script>
<?php include("footer.php"); ?>

View File

@ -7,13 +7,11 @@
<!-- ./wrapper -->
<!-- REQUIRED SCRIPTS -->
<!-- jQuery -->
<script src="plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Custom js-->
<script src="plugins/toastr/toastr.min.js"></script>
<script src="plugins/moment/moment.min.js"></script>
<script src="plugins/chart.js/Chart.min.js"></script>
<script src="plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>

View File

@ -33,6 +33,9 @@ header("X-Frame-Options: DENY");
<link href="plugins/summernote/summernote-bs4.min.css" rel="stylesheet">
<link href="plugins/toastr/toastr.min.css" rel="stylesheet">
<!-- <link href="plugins/dropzone/min/dropzone.min.css" rel="stylesheet"> -->
<!-- jQuery -->
<script src="plugins/jquery/jquery.min.js"></script>
<script src="plugins/toastr/toastr.min.js"></script>
</head>
<body class="hold-transition sidebar-mini">

View File

@ -3,15 +3,14 @@
//Alert Feedback
if(!empty($_SESSION['alert_message'])){
if (!isset($_SESSION['alert_type'])){
$_SESSION['alert_type'] = "info";
$_SESSION['alert_type'] = "success";
}
?>
<div class="alert alert-<?php echo $_SESSION['alert_type']; ?>" id="alert">
<?php echo $_SESSION['alert_message']; ?>
<button class='close' data-dismiss='alert'>&times;</button>
</div>
<script type="text/javascript">toastr.<?php echo $_SESSION['alert_type']; ?>("<?php echo $_SESSION['alert_message']; ?>")</script>
<?php
unset($_SESSION['alert_type']);
unset($_SESSION['alert_message']);

View File

@ -3,29 +3,4 @@
<!-- Main content -->
<div class="content mt-3">
<div class="container-fluid">
<?php
//Alert Feedback
if(!empty($_SESSION['alert_message'])){
if (!isset($_SESSION['alert_type'])){
$_SESSION['alert_type'] = "info";
}
?>
<div class="alert alert-<?php echo $_SESSION['alert_type']; ?>" id="alert">
<?php echo $_SESSION['alert_message']; ?>
<button class='close' data-dismiss='alert'>&times;</button>
</div>
<?php
unset($_SESSION['alert_type']);
unset($_SESSION['alert_message']);
}
//Set Records Per Page
if(empty($_SESSION['records_per_page'])){
$_SESSION['records_per_page'] = 10;
}
?>
<div class="container-fluid">

View File

@ -77,4 +77,4 @@ clipboard.on('error', function(e) {
// Enable Popovers
$(function () {
$('[data-toggle="popover"]').popover()
})
});

View File

@ -4727,7 +4727,6 @@ if(isset($_GET['undo_archive_location'])){
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Location', log_action = 'Undo Archive', log_description = '$session_name unarchived location $location_name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, company_id = $session_company_id");
$_SESSION['alert_type'] = "danger";
$_SESSION['alert_message'] = "Location ".stripslashes($location_name)." unarchived.";
header("Location: " . $_SERVER["HTTP_REFERER"]);