Gestión de Notificaciones
This commit is contained in:
@@ -63,6 +63,8 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
$esVistaBitacoras = str_contains($_SERVER['REQUEST_URI'], '/bitacoras');
|
||||
// Detecta si estamos en alguna parta de seguridad
|
||||
$esVistaSeguridad = str_contains($_SERVER['REQUEST_URI'], '/seguridad');
|
||||
// Detecta si estamos en alguna parte de preferencias
|
||||
$esVistaPreferencias = str_contains($_SERVER['REQUEST_URI'], '/preferencias')
|
||||
?>
|
||||
|
||||
<!-- INFORMACIÓN GENERAL -->
|
||||
@@ -78,10 +80,31 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
</a>
|
||||
|
||||
<!-- PREFERENCIAS -->
|
||||
<a href="/IMPORTADORES/configuracion/preferencias"
|
||||
class="nav-link px-3 py-2 <?= str_contains($_SERVER['REQUEST_URI'], '/configuracion/preferencias') ? 'active' : '' ?>">
|
||||
✅ Preferencias
|
||||
</a>
|
||||
<?php if ($esVistaPreferencias): ?>
|
||||
<?php $enDashboardPreferencias = $_SERVER['REQUEST_URI'] === '/IMPORTADORES/preferencias/index'; ?>
|
||||
<a class="nav-link px-3 py-2 d-flex justify-content-between align-items-center <?= $esVistaPreferencias ? 'active' : '' ?>"
|
||||
href="<?= $enDashboardPreferencias ? '#submenuPreferencias' : '/IMPORTADORES/preferencias/index' ?>"
|
||||
<?= $enDashboardPreferencias ? 'data-bd-toggle="collapse"' : '' ?>
|
||||
role="button" aria-expanded="true" aria-controls="submenuPreferencias"
|
||||
onclick="<? $enDashboardPreferenecias ? '' : 'event.preventDefault(); window.location.href = \'/IMPORTADORES/preferencias/index\';' ?>">
|
||||
✅ Preferencias
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
<div class="collapse show" id="submenuPreferencias">
|
||||
<nav class="nav flex-column ms-3">
|
||||
<a href="/IMPORTADORES/preferencias/notificaciones"
|
||||
class="nav-link px-3 py-1 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/preferencias/notificaciones' ? 'active' : '' ?>">
|
||||
• Gestión de Notificaciones
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esConfiguracion || $esVistaBitacoras || $esVistaSeguridad): ?>
|
||||
<a href="/IMPORTADORES/preferencias/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
✅ Preferencias
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- SEGURIDAD -->
|
||||
<?php if ($esVistaSeguridad): ?>
|
||||
@@ -102,7 +125,7 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esConfiguracion || $esVistaBitacoras): ?>
|
||||
<?php elseif ($esConfiguracion || $esVistaBitacoras || $esVistaPreferencias): ?>
|
||||
<a href="/IMPORTADORES/seguridad/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
👮 Seguridad
|
||||
@@ -130,7 +153,7 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esConfiguracion || $esVistaSeguridad): ?>
|
||||
<?php elseif ($esConfiguracion || $esVistaSeguridad || $esVistaPreferencias): ?>
|
||||
<!-- Si estamos en configuración, pero no en bitácoras -->
|
||||
<a href="/IMPORTADORES/bitacoras/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
@@ -159,10 +182,31 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
</a>
|
||||
|
||||
<!-- PREFERENCIAS -->
|
||||
<a href="/IMPORTADORES/configuracion/preferencias"
|
||||
class="nav-link px-3 py-2 <?= str_contains($_SERVER['REQUEST_URI'], '/configuracion/preferencias') ? 'active' : '' ?>">
|
||||
✅ Preferencias
|
||||
</a>
|
||||
<?php if ($esVistaPreferencias): ?>
|
||||
<?php $enDashboardPreferencias = $_SERVER['REQUEST_URI'] === '/IMPORTADORES/preferencias/index'; ?>
|
||||
<a class="nav-link px-3 py-2 d-flex justify-content-between align-items-center <?= $esVistaPreferencias ? 'active' : '' ?>"
|
||||
href="<?= $enDashboardPreferencias ? '#submenuPreferencias' : '/IMPORTADORES/preferencias/index' ?>"
|
||||
<?= $enDashboardPreferencias ? 'data-bd-toggle="collapse"' : '' ?>
|
||||
role="button" aria-expanded="true" aria-controls="submenuPreferencias"
|
||||
onclick="<? $enDashboardPreferenecias ? '' : 'event.preventDefault(); window.location.href = \'/IMPORTADORES/preferencias/index\';' ?>">
|
||||
✅ Preferencias
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
<div class="collapse show" id="submenuPreferencias">
|
||||
<nav class="nav flex-column ms-3">
|
||||
<a href="/IMPORTADORES/preferencias/notificaciones"
|
||||
class="nav-link px-3 py-1 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/preferencias/notificaciones' ? 'active' : '' ?>">
|
||||
• Gestión de Notificaciones
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esConfiguracion || $esVistaBitacoras || $esVistaSeguridad): ?>
|
||||
<a href="/IMPORTADORES/preferencias/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
✅ Preferencias
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- SEGURIDAD -->
|
||||
<?php if ($esVistaSeguridad): ?>
|
||||
@@ -183,7 +227,7 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esConfiguracion || $esVistaBitacoras): ?>
|
||||
<?php elseif ($esConfiguracion || $esVistaBitacoras || $esVistaPreferencias): ?>
|
||||
<a href="/IMPORTADORES/seguridad/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
👮 Seguridad
|
||||
@@ -211,7 +255,7 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esConfiguracion || $esVistaSeguridad): ?>
|
||||
<?php elseif ($esConfiguracion || $esVistaSeguridad || $esVistaPreferencias): ?>
|
||||
<!-- Si estamos en configuración, pero no en bitácoras -->
|
||||
<a href="/IMPORTADORES/bitacoras/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
|
||||
Reference in New Issue
Block a user