Vinculaciones multi-agencia

This commit is contained in:
2025-06-25 12:38:50 -06:00
parent a830e3a84a
commit c5c698dbe4
62 changed files with 5107 additions and 1454 deletions

View File

@@ -1,10 +1,3 @@
<?php
if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'agente_aduanal') {
header('Location: /IMPORTADORES/login');
exit;
}
?>
<style>
.nav .nav-link { font-weight: normal; color: white; transition: all 0.3s ease; }
.nav .nav-link:hover,
@@ -58,55 +51,12 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'agente_adu
🏠 Inicio
</a>
<!-- IMPORTADORES ACTIVOS -->
<!-- IMPORTADORES VINCULADOS -->
<a href="/IMPORTADORES/agentes/activos"
class="nav-link px-3 py-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/activos' ? 'active' : '' ?>">
✅ Importadores Activos
🔗 Vinculados
</a>
<!-- SOLICITUDES PENDIENTES -->
<a href="/IMPORTADORES/agentes/solicitudes_pendientes"
class="nav-link px-3 py-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/solicitudes_pendientes' ? 'active' : '' ?>">
📥 Solicitudes de Registro
</a>
<!-- BITÁCORA -->
<a href="/IMPORTADORES/agentes/bitacora"
class="nav-link px-3 py-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/bitacora' ? 'active' : '' ?>">
🕓 Bitácora
</a>
<!-- LOCACIONES -->
<?php if ($esVistaLocaciones): ?>
<?php $enDashboardLocaciones = $_SERVER['REQUEST_URI'] === '/IMPORTADORES/locaciones/lista'; ?>
<a class="nav-link px-3 py-2 d-flex justify-content-between align-items-center <?= $esVistaLocaciones ? 'active' : '' ?>"
href="<?= $enDashboardLocaciones ? '#submenuLocaciones' : '/IMPORTADORES/locaciones/lista' ?>"
<?= $enDashboardLocaciones ? 'data-bs-toggle="collapse"' : '' ?>
role="button" aria-expanded="true" aria-controls="submenuLocaciones"
onclick="<?= $enDashboardLocaciones ? '' : 'event.preventDefault(); window.location.href = \'/IMPORTADORES/locaciones/lista\';' ?>">
🗺️ Locaciones
<span class="badge bg-secondary">2</span>
</a>
<div class="collapse show" id="submenuLocaciones">
<nav class="nav flex-column ms-3">
<a href="/IMPORTADORES/locaciones/lista"
class="nav-link px-3 py-1 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/locaciones/lista' ? 'active' : '' ?>">
• Ver Locaciones
</a>
<a href="/IMPORTADORES/locaciones/alta"
class="nav-link px-3 py-1 <?= str_contains($_SERVER['REQUEST_URI'], '/locaciones/alta') ? 'active' : '' ?>">
• Agregar Locaciones
</a>
</nav>
</div>
<?php elseif ($esVistaAgentes || $esVistaPatente): ?>
<a href="/IMPORTADORES/locaciones/lista"
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
🗺️ Locaciones
<span class="badge bg-secondary">2</span>
</a>
<?php endif; ?>
<!-- Patentes -->
<?php if ($esVistaPatente): ?>
<?php $enDashboardPatente = $_SERVER['REQUEST_URI'] === '/IMPORTADORES/patente/dashboard'; ?>
@@ -138,6 +88,43 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'agente_adu
</a>
<?php endif; ?>
<!-- LOCACIONES -->
<?php if ($esVistaLocaciones): ?>
<?php $enDashboardLocaciones = $_SERVER['REQUEST_URI'] === '/IMPORTADORES/locaciones/lista'; ?>
<a class="nav-link px-3 py-2 d-flex justify-content-between align-items-center <?= $esVistaLocaciones ? 'active' : '' ?>"
href="<?= $enDashboardLocaciones ? '#submenuLocaciones' : '/IMPORTADORES/locaciones/lista' ?>"
<?= $enDashboardLocaciones ? 'data-bs-toggle="collapse"' : '' ?>
role="button" aria-expanded="true" aria-controls="submenuLocaciones"
onclick="<?= $enDashboardLocaciones ? '' : 'event.preventDefault(); window.location.href = \'/IMPORTADORES/locaciones/lista\';' ?>">
🗺️ Locaciones
<span class="badge bg-secondary">2</span>
</a>
<div class="collapse show" id="submenuLocaciones">
<nav class="nav flex-column ms-3">
<a href="/IMPORTADORES/locaciones/lista"
class="nav-link px-3 py-1 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/locaciones/lista' ? 'active' : '' ?>">
• Ver Locaciones
</a>
<a href="/IMPORTADORES/locaciones/alta"
class="nav-link px-3 py-1 <?= str_contains($_SERVER['REQUEST_URI'], '/locaciones/alta') ? 'active' : '' ?>">
• Agregar Locaciones
</a>
</nav>
</div>
<?php elseif ($esVistaAgentes || $esVistaPatente): ?>
<a href="/IMPORTADORES/locaciones/lista"
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
🗺️ Locaciones
<span class="badge bg-secondary">2</span>
</a>
<?php endif; ?>
<!-- CONFIGURACIÓN -->
<a href="/IMPORTADORES/configuracion"
class="nav-link px-3 py-2 <?= str_contains($_SERVER['REQUEST_URI'], '/configuracion') ? 'active' : '' ?>">
⚙️ Configuración
</a>
</nav>
</div>
@@ -161,12 +148,6 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'agente_adu
✅ Importadores Activos
</a>
<!-- SOLICITUDES PENDIENTES -->
<a href="/IMPORTADORES/agentes/solicitudes_pendientes"
class="nav-link px-3 py-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/solicitudes_pendientes' ? 'active' : '' ?>">
📥 Solicitudes de Registro
</a>
<!-- BITÁCORA -->
<a href="/IMPORTADORES/agentes/bitacora"
class="nav-link px-3 py-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/bitacora' ? 'active' : '' ?>">
@@ -235,5 +216,11 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'agente_adu
</a>
<?php endif; ?>
<!-- CONFIGURACIÓN -->
<a href="/IMPORTADORES/configuracion"
class="nav-link px-3 py-2 <?= str_contains($_SERVER['REQUEST_URI'], '/configuracion') ? 'active' : '' ?>">
⚙️ Configuración
</a>
</div>
</div>