production/Vue/gabarit.php
2026-02-02 15:44:46 +00:00

221 lines
11 KiB
PHP
Executable File

<?php
require_once 'gabarit_queries.php';
$gabary = new Gabary();
$_SESSION['firstLevelMenu']='';
$current_url = $_SERVER['REQUEST_URI'];
$elements = explode("/", $current_url);
$activeLink = $elements[1];
$fullPath = $gabary->get_full_path($activeLink);
$fullPath = explode("\ ", $fullPath);
$activeLevel1 = $activeLink;
$activeLevel2 = sizeof($fullPath)>1?$fullPath[1]:'';
$activeLevel3 =sizeof($fullPath)>2?$fullPath[2]:'';
$activeLevel4 = sizeof($fullPath)>3?$fullPath[3]:'';
$activeLevel5 = sizeof($fullPath)>4?$fullPath[4]:'';
$_SESSION['firstLevelMenu']=$activeLink;
const MAX_COMPANY_NAME_LENGTH = 20;
$companyDisplayName = htmlspecialchars($_SESSION['nomSociete'], ENT_QUOTES);
$modeDev = $_SESSION['modeDev_C'];
$imgData = $_SESSION['photoAssureCrypte'];
//
?>
<!doctype html>
<html lang="fr">
<?php require_once 'head.php'; ?>
<body class="d-flex flex-column min-vh-100 bg-light">
<?php include 'header.php'; ?>
<div class="d-flex flex-grow-1" style="margin-top: 60px;">
<?php include 'sidebar.php'; ?>
<main id="main" class="main">
<input class="sr-only" type="text" id="vue" name="vue" value="<?= isset($_SESSION['vue']) ? $_SESSION['vue'] : ""; ?>">
<input class="sr-only" type="text" id="racineWeb" name="racineWeb" value="<?= $racineWeb ?>">
<input class="sr-only" type="text" id="dureeSession" name="dureeSession" value="<?= $_SESSION['dureeSession'] ?>">
<input class="sr-only" type="text" id="is_connecte" name="is_connecte" value="<?= $_SESSION['is_connecte'] ?>">
<div id="div_entite" class="sr-only"></div>
<div class="container-fluid p-0">
<?php
$infovue = $gabary->getInfosVue($_SESSION['vue']);
$descriptionVue = est_anglophone() ? $infovue['DescriptionEng'] : $infovue['Description'];
$titreRetour = est_anglophone() ? $infovue['titreRetourEng'] : $infovue['titreRetour'];
$retourVue = $infovue['lienRetour'];
?>
<div class="breadcrumb-container mb-4 px-3">
<nav aria-label="breadcrumb">
<ol class="breadcrumb bg-white shadow-sm rounded-pill py-2 px-4 border-0">
<li class="breadcrumb-item">
<a href="<?= $retourVue; ?>" class="text-decoration-none text-muted small">
<i class="fa fa-chevron-left me-1"></i> <?= $titreRetour ?>
</a>
</li>
<li class="breadcrumb-item active text-primary fw-bold small text-uppercase" aria-current="page">
<?= $descriptionVue ?>
</li>
</ol>
</nav>
</div>
<?php if (sizeof($menusvue) > 0): ?>
<div class="tabs-container mb-4 px-3">
<div class="card border-0 shadow-sm rounded-3 overflow-hidden">
<div class="card-body p-0">
<div class="d-flex overflow-auto nav-scroller">
<?php foreach ($menusvue as $menu):
$isSubActive = (basename($_SERVER['REQUEST_URI']) == basename($menu['lienMenu']));
$activeClass = $isSubActive ? 'active-tab' : '';
?>
<a class="sub-nav-link p-3 <?= $activeClass ?>"
title="<?= $menu['descriptionMenu']; ?>"
href="<?= $menu['lienMenu']; ?>">
<?= $menu['libeleMenu'] ?>
</a>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
<section class="section main-dashboard px-3">
<div id="contenu" class="animate__animated animate__fadeIn">
<div id="div_test_gabarit"></div>
<?= $contenu ?>
</div>
</section>
</div>
</main>
<?php include 'contexte.php'; ?>
</div>
<div class="modal fade animate__animated animate__fadeInDown" id="popmessagerie" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content border-0 shadow-lg">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title fw-bold">
<i class="fa fa-envelope-open-text me-2"></i> <?= _("Messages non lus") ?>
</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body p-4">
<div id="div_messagerie" class="min-vh-25">
</div>
</div>
<div class="modal-footer border-0">
<button type="button" class="btn btn-light rounded-pill px-4" data-bs-dismiss="modal"><?= _("Fermer") ?></button>
</div>
</div>
</div>
</div>
<div class="modal fade animate__animated animate__bounceIn" id="popderniermessagerie" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content border-0 shadow-lg">
<div class="modal-header border-0 pb-0">
<h5 class="modal-title fw-bold text-danger">
<i class="fa fa-bell me-2"></i> <?= _("Nouveau Message") ?>
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div id="div_dernier_messagerie" class="alert alert-info border-0 shadow-sm">
</div>
</div>
<div class="modal-footer border-0">
<button id="btn_close_pop_dernier_messagerie" type="button" class="btn btn-danger w-100 rounded-pill" data-bs-dismiss="modal"><?= _("Fermer") ?></button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="pop_photo" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content bg-transparent border-0">
<div class="modal-header border-0">
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body text-center p-0">
<img src="data:image/jpg;base64,<?=$imgData?>" class="img-fluid rounded shadow-lg border border-5 border-white" style="max-height: 80vh;">
<h4 class="text-white mt-3 fw-bold"><?= $_SESSION['nomBeneficiaire_C'] ?></h4>
</div>
</div>
</div>
</div>
<script src="Bootstrap/js/jquery.min.js"></script>
<script src="Bootstrap/js/jquery-ui.js"></script>
<script src="Bootstrap/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="Bootstrap_new/datatables/datatable.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="Js/html2pdf.js"></script>
<script src="Bootstrap_new/js/select2.min.js"></script>
<script src="Bootstrap/js/timer.jquery.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<?php if (est_anglophone()) : ?>
<script src="Js/datepicker-eng.js"></script>
<?php else: ?>
<script src="Js/datepicker-fr.js"></script>
<?php endif; ?>
<script src="Js/fonctions.js?ver=2025.11.29.09"></script>
<script src="<?= $_SESSION['dossierSociete'].'/Js/societe.js' ?>"></script>
<script type="text/javascript">
$(document).ready(function() {
// 1. GESTION DU SIDEBAR GAUCHE (MENU)
$('.toggle-sidebar-btn').on('click', function() {
$('body').toggleClass('toggle-sidebar');
});
// 2. GESTION DE L'ASSISTANT CONTEXTUEL (CHATBOT - DROITE)
$("#showSideNav").click(function() {
$("#barre_laterale_d").addClass("active");
$(this).fadeOut(200);
});
$("#hideSideNav").click(function() {
$("#barre_laterale_d").removeClass("active");
$("#showSideNav").fadeIn(200);
});
// 3. SYNCHRONISATION DU BADGE DE MESSAGERIE
function syncBadge() {
var count = $("#msgNonLus").val();
if(count > 0) {
$("#badge_notif_msg").text(count).fadeIn();
} else {
$("#badge_notif_msg").hide();
}
}
// Mise à jour du badge toutes les 2 secondes
setInterval(syncBadge, 2000);
// 4. INITIALISATION MÉTIER & TIMERS EXISTANTS
// Charge les données initiales du gabarit
raffraichier_gabarit();
// Timer de rafraîchissement de la messagerie (toutes les 60s)
$('#timer').timer({
duration: '60s',
callback: function() {
raffraichier_messagerie();
},
repeat: true
});
});
</script>
</body>
</html>