Skip to content

Commit

Permalink
Merge pull request #1 from Brunin12/master
Browse files Browse the repository at this point in the history
sweet alert in default/components/layout/_js implementation
  • Loading branch information
Brunin12 authored Dec 3, 2023
2 parents 4f88c3d + 4aae455 commit 32c01ca
Showing 1 changed file with 33 additions and 17 deletions.
50 changes: 33 additions & 17 deletions app/Views/default/components/layout/_js.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,13 @@
<script src="<?= base_url('assets/plugins/jquery-ui/jquery-ui.min.js') ?>"></script>
<!-- Bootstrap 4 -->
<script src="<?= base_url('assets/plugins/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
<!-- ChartJS -->
<script src="<?= base_url('assets/plugins/chart.js/Chart.min.js') ?>"></script>
<!-- Sparkline -->
<script src="<?= base_url('assets/plugins/sparklines/sparkline.js') ?>"></script>
<!-- JQVMap -->
<script src="<?= base_url('assets/plugins/jqvmap/jquery.vmap.min.js') ?>"></script>
<script src="<?= base_url('assets/plugins/jqvmap/maps/jquery.vmap.usa.js') ?>"></script>
<!-- jQuery Knob Chart -->
<script src="<?= base_url('assets/plugins/jquery-knob/jquery.knob.min.js') ?>"></script>
<!-- daterangepicker -->
<script src="<?= base_url('assets/plugins/moment/moment.min.js') ?>"></script>
<script src="<?= base_url('assets/plugins/daterangepicker/daterangepicker.js') ?>"></script>
<!-- Tempusdominus Bootstrap 4 -->
<script src="<?= base_url('assets/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js') ?>"></script>
<!-- Summernote -->
<script src="<?= base_url('assets/plugins/summernote/summernote-bs4.min.js') ?>"></script>

<!-- overlayScrollbars -->
<script src="<?= base_url('assets/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?= base_url('assets/dist/js/adminlte.js') ?>"></script>


<script>
$(() => {
$('.navbar').hide().show(750)
Expand Down Expand Up @@ -59,4 +45,34 @@
});
}
})
</script>
</script>

<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Link para o CSS do SweetAlert2 via CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">


<?php if (session()->has('success')) : ?>
<script>
$(() => {
Swal.fire({
title: 'Sucesso!',
text: '<?= session('success') ?>',
icon: 'success',
showConfirmButton: false,
timer: 1500
});
});
</script>
<?php elseif (session()->has('error')) : ?>
<script>
$(() => {
Swal.fire({
title: 'Erro!',
text: '<?= session('error') ?>',
icon: 'error',
showConfirmButton: true
});
});
</script>
<?php endif; ?>

0 comments on commit 32c01ca

Please sign in to comment.