172 lines
6.0 KiB
PHP
172 lines
6.0 KiB
PHP
<!-- ======= Scripts Footer — INTER SANTÉ ======= -->
|
|
<!-- IMPORTANT: Respecter strictement l'ordre de chargement -->
|
|
|
|
<!-- 1. Script spécifique à la société -->
|
|
<script src="<?= $_SESSION['dossierSociete'] . '/Js/societe.js' ?>"></script>
|
|
|
|
<!-- 2. Vendor Libs (Bootstrap ecosystem) -->
|
|
<script src="Bootstrap/vendor/apexcharts/apexcharts.min.js"></script>
|
|
<script src="Bootstrap/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
|
<script src="Bootstrap/vendor/chart.js/chart.umd.js"></script>
|
|
<script src="Bootstrap/vendor/echarts/echarts.min.js"></script>
|
|
<script src="Bootstrap/vendor/quill/quill.min.js"></script>
|
|
<script src="Bootstrap/vendor/simple-datatables/simple-datatables.js"></script>
|
|
<script src="Bootstrap/vendor/php-email-form/validate.js"></script>
|
|
|
|
<!-- 3. jQuery (DOIT précéder tout le reste) -->
|
|
<script src="Bootstrap/js/jquery.min.js"></script>
|
|
<script src="Bootstrap/js/jquery-ui.js"></script>
|
|
<script src="Bootstrap/js/timer.jquery.js"></script>
|
|
|
|
<!-- 4. Select2 & Bootstrap-Select -->
|
|
<script src="Bootstrap_new/js/select2.min.js"></script>
|
|
<script src="Bootstrap_new/select/js/bootstrap-select.min.js"></script>
|
|
|
|
<!-- 5. Template main -->
|
|
<script src="Bootstrap/js/main.js"></script>
|
|
<script src="Bootstrap_new/datatables/datatable.min.js" crossorigin="anonymous"></script>
|
|
|
|
<!-- 6. Datepicker selon langue -->
|
|
<?php if (est_anglophone()): ?>
|
|
<script src="Js/datepicker-eng.js"></script>
|
|
<?php else: ?>
|
|
<script src="Js/datepicker-fr.js"></script>
|
|
<?php endif; ?>
|
|
|
|
<!-- 7. Utilitaires -->
|
|
<script src="Js/html2pdf.js"></script>
|
|
|
|
<!-- 8. Toastr notifications -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.css" crossorigin="anonymous">
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js" crossorigin="anonymous"></script>
|
|
|
|
<!-- 9. SweetAlert2 -->
|
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.14.1/dist/sweetalert2.all.min.js"></script>
|
|
|
|
<!-- 10. Fonctions applicatives Inter Santé -->
|
|
<script src="Js/fonctions.js?ver=<?= defined('APP_VERSION') ? APP_VERSION : date('YmdHi') ?>"></script>
|
|
|
|
<!-- 11. Vue.js -->
|
|
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
|
|
|
|
<!-- 12. Chart.js (dédupliqué — déjà en head, mais conservé pour compatibilité) -->
|
|
<!-- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> -->
|
|
|
|
<!-- 13. Bootstrap JS -->
|
|
<script src="Bootstrap/js/bootstrap.min.js"></script>
|
|
|
|
<!-- ===== Conteneur AJAX gabarit ===== -->
|
|
<div id="div_ajaxgabarit"></div>
|
|
|
|
<!-- ===== Initialisation applicative ===== -->
|
|
<script type="text/javascript">
|
|
/* Rafraîchissement du gabarit */
|
|
raffraichier_gabarit();
|
|
|
|
/* Timer messagerie (60s) */
|
|
$(document).ready(function () {
|
|
|
|
/* --- Panneau contexte : Drawer animé --- */
|
|
$('#barre_laterale_d').hide();
|
|
$('#showSideNav').hide(); // Masqué jusqu'au scroll ou action
|
|
|
|
// Afficher le bouton déclencheur après un court délai
|
|
setTimeout(function () {
|
|
$('#showSideNav').fadeIn(300);
|
|
}, 800);
|
|
|
|
// Ouverture du panneau
|
|
$('#showSideNav').on('click', function () {
|
|
$('#barre_laterale_d').stop(true).show('slide', { direction: 'right' }, 350);
|
|
$(this).fadeOut(150);
|
|
});
|
|
|
|
// Fermeture du panneau
|
|
$('#hideSideNav').on('click', function () {
|
|
$('#barre_laterale_d').stop(true).hide('slide', { direction: 'right' }, 350, function () {
|
|
$('#showSideNav').fadeIn(200);
|
|
});
|
|
});
|
|
|
|
// Fermeture en cliquant en dehors du panneau
|
|
$(document).on('click', function (e) {
|
|
if ($('#barre_laterale_d').is(':visible') &&
|
|
!$(e.target).closest('#barre_laterale_d, #showSideNav').length) {
|
|
$('#barre_laterale_d').stop(true).hide('slide', { direction: 'right' }, 300, function () {
|
|
$('#showSideNav').fadeIn(200);
|
|
});
|
|
}
|
|
});
|
|
|
|
/* --- Timer messagerie --- */
|
|
$('#timer').timer({
|
|
duration: '60s',
|
|
callback: function () {
|
|
raffraichier_messagerie();
|
|
},
|
|
repeat: true
|
|
});
|
|
|
|
/* --- Select2 global --- */
|
|
if ($.fn.select2) {
|
|
$('select.select2, .select-field').each(function () {
|
|
$(this).select2({ theme: 'bootstrap-5', width: '100%' });
|
|
});
|
|
}
|
|
|
|
/* --- Bootstrap Select global --- */
|
|
if ($.fn.selectpicker) {
|
|
$('select.selectpicker').selectpicker('refresh');
|
|
}
|
|
|
|
/* --- Sidebar toggle responsive --- */
|
|
$('.toggle-sidebar-btn').on('click', function () {
|
|
$('body').toggleClass('toggle-sidebar');
|
|
// Sur mobile, slide le sidebar
|
|
if ($(window).width() < 1200) {
|
|
$('#sidebar').toggleClass('sidebar-open');
|
|
}
|
|
});
|
|
|
|
/* --- Highlight ligne active DataTable au clic --- */
|
|
$(document).on('click', '.table tbody tr', function () {
|
|
$(this).closest('tbody').find('tr').removeClass('row-selected');
|
|
$(this).addClass('row-selected');
|
|
});
|
|
|
|
/* --- Toastr config globale --- */
|
|
if (typeof toastr !== 'undefined') {
|
|
toastr.options = {
|
|
positionClass: 'toast-top-right',
|
|
timeOut: 4000,
|
|
closeButton: true,
|
|
progressBar: true,
|
|
preventDuplicates: true,
|
|
newestOnTop: true
|
|
};
|
|
}
|
|
|
|
}); // end document.ready
|
|
</script>
|
|
|
|
<!-- Style additionnel pour la ligne sélectionnée dans les tables -->
|
|
<style>
|
|
.table tbody tr.row-selected > td {
|
|
background: rgba(26, 107, 74, 0.08) !important;
|
|
border-left: 3px solid var(--color-accent, #0abf7c);
|
|
}
|
|
|
|
/* Sidebar toggle body class */
|
|
body.toggle-sidebar #sidebar { width: var(--sidebar-collapsed, 68px); }
|
|
body.toggle-sidebar #sidebar .nav-link span,
|
|
body.toggle-sidebar #sidebar .nav-link .bi-chevron-down,
|
|
body.toggle-sidebar #sidebar .sidebar-section-label { display: none; }
|
|
body.toggle-sidebar #main { margin-left: var(--sidebar-collapsed, 68px); }
|
|
body.toggle-sidebar #sidebar .nav-link { justify-content: center; padding: 10px; }
|
|
body.toggle-sidebar #sidebar .nav-link i:first-child { font-size: 1.2rem; width: auto; }
|
|
body.toggle-sidebar #sidebar .nav-content { display: none !important; }
|
|
</style>
|
|
|
|
</body>
|
|
</html>
|