<footer class="main-footer">
  <div class="pull-right hidden-xs">
    <b>Version</b> 2.4.0
  </div>
  <strong>Copyright &copy; 2020-2026 <a href="#" target="_blank">HC MEDICA</a>.</strong> All rights
  reserved.
</footer>
<!-- jQuery -->
<script src="../public/js/jquery-3.1.1.min.js"></script>
<!-- jQuery UI for Autocomplete -->
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="../public/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="../public/js/app.min.js"></script>

<!-- DATATABLES -->
<script src="../public/datatables/jquery.dataTables.min.js"></script>
<script src="../public/datatables/dataTables.buttons.min.js"></script>
<script src="../public/datatables/buttons.html5.min.js"></script>
<script src="../public/datatables/buttons.colVis.min.js"></script>
<script src="../public/datatables/jszip.min.js"></script>
<script src="../public/datatables/pdfmake.min.js"></script>
<script src="../public/datatables/vfs_fonts.js"></script>

<script src="../public/js/bootbox.min.js"></script>
<script src="../public/js/bootstrap-select.min.js"></script>
<!-- SELECT2 JS -->
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>
  // Exponer variables de sesión para los scripts JS
  var idusuario_session = "<?php echo isset($_SESSION['idusuario']) ? $_SESSION['idusuario'] : 0; ?>";
  var idempleado_session = "<?php echo isset($_SESSION['idempleado']) ? $_SESSION['idempleado'] : (isset($_SESSION['idusuario']) ? $_SESSION['idusuario'] : 0); ?>";

  function checkNotifications() {
    $.get("../ajax/agenda.php?op=notificaciones", function (data) {
      try {
        data = JSON.parse(data);
        if (data && data.length > 0) {
          $("#notif-count").text(data.length);
          $("#notif-header").text("Tienes " + data.length + " citas pendientes");
          var list = "";
          $.each(data, function (index, value) {
            list += '<li><a href="agenda.php"><i class="fa fa-calendar text-aqua"></i> ' + value.titulo + ' <small class="pull-right"><i class="fa fa-clock-o"></i> ' + value.hora + '</small></a></li>';
          });
          $("#notif-list").html(list);
        } else {
          $("#notif-count").text("");
          $("#notif-header").text("No hay notificaciones nuevas");
          $("#notif-list").html("");
        }
      } catch (e) {
        console.log("Error parsing notifications");
      }
    });
  }

  $(document).ready(function () {
    checkNotifications();
    setInterval(checkNotifications, 60000); // Check every minute
  });
</script>
<script src="scripts/header_alerts.js"></script>
<!-- Driver.js + Tutorial (Onboarding) -->
<script src="../public/driver/driver.js.iife.js"></script>
<script src="scripts/tutorial.js"></script>
</body>

</html>