cambios atorados
This commit is contained in:
@@ -73,10 +73,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td colspan="8" class="text-center">No hay agencias registradas aún.</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>Dashboard | Administrador</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
@@ -39,7 +38,7 @@
|
||||
|
||||
<!-- 📄 CONTENIDO -->
|
||||
<div class="content">
|
||||
<h4 class="mb-4">👥 Alta de Usuarios</h4>
|
||||
<h3 class="mb-4">👥 Alta de Usuarios</h3>
|
||||
<!-- FORMULARIO -->
|
||||
<div class="card p-4 mb-4 shadow-sm bg-white">
|
||||
<form action="/IMPORTADORES/administrador/guardar_usuario" method="POST">
|
||||
@@ -71,7 +70,7 @@
|
||||
<h4 class="mb-4">✅ Usuarios Activos</h4>
|
||||
<div class="card p-3 shadow-sm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover align-middle" id="tabla-activos">
|
||||
<table class="table table-striped table-hover align-middle" id="tabla-usuarios-activos">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>#</th>
|
||||
@@ -108,7 +107,7 @@
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#tabla-activos').DataTable({
|
||||
$('#tabla-usuarios-activos').DataTable({
|
||||
order: [],
|
||||
language: {
|
||||
url: 'https://cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
|
||||
|
||||
@@ -48,9 +48,9 @@
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-primary">Aprobar agencias</h5>
|
||||
<p>Aprueba las agencias que solicitaron un registro.</p>
|
||||
<a href="/IMPORTADORES/sistemas/aprobarAgencias"
|
||||
<a href="/IMPORTADORES/administrador/aprobarAgencias"
|
||||
class="btn btn-primary btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/sistemas/aprobarAgencias' ? 'active' : '' ?>">
|
||||
Ver bitácora</a>
|
||||
Ver agencias solicitantes</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -58,9 +58,9 @@
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-success">Alta de agencias</h5>
|
||||
<p>Da de alta manualmente una agencia.</p>
|
||||
<a href="/IMPORTADORES/sistemas/altaAgencias"
|
||||
<a href="/IMPORTADORES/administrador/altaAgencias"
|
||||
class="btn btn-success btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/sistemas/altaAgencias' ? 'active' : '' ?>">
|
||||
Nuevo agente
|
||||
Nueva agencia
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,9 +69,9 @@
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-info">Aprobar de usuarios</h5>
|
||||
<p>Aprueba los usuarios que solicitaron un registro.</p>
|
||||
<a href="/IMPORTADORES/sistemas/aprobarUsuarios"
|
||||
<a href="/IMPORTADORES/administrador/aprobarUsuarios"
|
||||
class="btn btn-info btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/sistemas/aprobarUsuarios' ? 'active' : '' ?>">
|
||||
Ver usuarios
|
||||
Ver usuarios solicitantes
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,9 +80,9 @@
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-indigo">Alta de usuarios</h5>
|
||||
<p>Da de alta manualmente a un usuario.</p>
|
||||
<a href="/IMPORTADORES/sistemas/altaUsuarios"
|
||||
<a href="/IMPORTADORES/administrador/altaUsuarios"
|
||||
class="btn btn-indigo btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/sistemas/altaUsuarios' ? 'active' : '' ?>">
|
||||
Nuevo agente
|
||||
Nuevo usuario
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -91,7 +91,7 @@
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-warning">Configuración</h5>
|
||||
<p>Administra los datos de tu agencia.</p>
|
||||
<a href="/IMPORTADORES/sistemas/configuracion"
|
||||
<a href="/IMPORTADORES/administrador/configuracion"
|
||||
class="btn btn-warning btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/sistemas/configuracion' ? 'active' : '' ?>">
|
||||
Configurar
|
||||
</a>
|
||||
|
||||
@@ -38,33 +38,87 @@
|
||||
<!-- 📄 CONTENIDO -->
|
||||
<div class="content px-4">
|
||||
<h3 class="mb-4">Administración de Agentes</h3>
|
||||
|
||||
<!-- FORMULARIO -->
|
||||
<form action="/IMPORTADORES/agencias/guardarAgente" method="POST" class="card p-4 mb-5 shadow-sm">
|
||||
<h5 class="mb-3">➕ Nuevo Agente</h5>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-4">
|
||||
<input name="nombre" class="form-control" placeholder="Nombre completo" required>
|
||||
<div class="card p-4 mb-4 shadow-sm bg-white">
|
||||
<form action="/IMPORTADORES/agencias/guardarAgente" method="POST">
|
||||
<h5 class="mb-3">➕ Nuevo Agente</h5>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-4">
|
||||
<input name="nombre" class="form-control" placeholder="Nombre completo" required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input name="email" type="email" class="form-control" placeholder="Correo electrónico" required>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<input name="password" type="password" class="form-control" placeholder="Contraseña" required>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select name="tipo_usuario" class="form-select" required>
|
||||
<option value="">Tipo</option>
|
||||
<option value="agente_aduanal">Agente Aduanal</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input name="email" type="email" class="form-control" placeholder="Correo electrónico" required>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<input name="password" type="password" class="form-control" placeholder="Contraseña" required>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select name="tipo_usuario" class="form-select" required>
|
||||
<option value="">Tipo</option>
|
||||
<option value="agente_aduanal">Agente Aduanal</option>
|
||||
</select>
|
||||
<div class="text-end mt-4">
|
||||
<button class="btn btn-success px-4">Registrar</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h4 class="mb-4">✅ Agentes Activos</h4>
|
||||
<div class="card p-3 shadow-sm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover align-middle" id="tabla-agentes-activos">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Nombre</th>
|
||||
<th>Correo</th>
|
||||
<th>Tipo</th>
|
||||
<th>Creado por</th>
|
||||
<th>Fecha Registro</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($agentes as $a): ?>
|
||||
<tr>
|
||||
<td><?= $a['id_usuario'] ?></td>
|
||||
<td><?= htmlspecialchars(decrypt($a['nombre'])) ?></td>
|
||||
<td><?= htmlspecialchars(decrypt($a['email'])) ?></td>
|
||||
<td><?= htmlspecialchars($a['tipo_usuario_sistema']) ?></td>
|
||||
<td><?= htmlspecialchars($a['creado_por']) ?></td>
|
||||
<td><?= isset($a['creado_en']) && $a['creado_en'] instanceof DateTime ? $a['creado_en']->format('Y-m-d H:i') : '' ?></td>
|
||||
<td>
|
||||
<?php if (in_array($a['tipo_usuario_sistema'], ['agente_aduanal'])): ?>
|
||||
<a href="/IMPORTADORES/vinculaciones/desvincularAgencia?id=<?= $a['id_relacion'] ?>&tipo=<?= $a['tipo_vinculacion'] ?>"
|
||||
class="btn btn-sm btn-danger"
|
||||
onclick="return confirm('¿Está seguro de que desea desvincular este usuario?')">
|
||||
Desvincular
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<span class="text-muted small">N/A</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="text-end mt-4">
|
||||
<button class="btn btn-success px-4">Registrar</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#tabla-agentes-activos').DataTable({
|
||||
order: [],
|
||||
language: {
|
||||
url: 'https://cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php if (isset($_GET['success'])): ?>
|
||||
<script>
|
||||
<?php if ($_GET['success'] === 'created'): ?>
|
||||
|
||||
@@ -43,10 +43,10 @@ include __DIR__ . '/../partials/sidebar_agente.php';
|
||||
<div class="row g-4">
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-primary">Importadores activos</h5>
|
||||
<h5 class="text-primary">Importadores vinculados</h5>
|
||||
<p>Consulta los que ya fueron autorizados.</p>
|
||||
<a href="/IMPORTADORES/agentes/activos"
|
||||
class="btn btn-primary btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/activos' ? 'active' : '' ?>">
|
||||
<a href="/IMPORTADORES/agentes/vinculados"
|
||||
class="btn btn-primary btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/vinculados' ? 'active' : '' ?>">
|
||||
Ver importadores
|
||||
</a>
|
||||
</div>
|
||||
@@ -63,17 +63,6 @@ include __DIR__ . '/../partials/sidebar_agente.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-info">Bitácora del sistema</h5>
|
||||
<p>Revisa los accesos y acciones recientes.</p>
|
||||
<a href="/IMPORTADORES/agentes/bitacora"
|
||||
class="btn btn-info btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/bitacora' ? 'active' : '' ?>">
|
||||
Ver bitácora
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-orange">Locaciones</h5>
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
<?php include __DIR__ . '/../partials/sidebar_agente.php'; ?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Dashboard | Agente Aduanal</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<style>
|
||||
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; }
|
||||
.sidebar { width: 220px; height: 100vh; background-color: #343a40; position: fixed; top: 0; left: 0; padding-top: 56px; z-index: 1040; }
|
||||
.sidebar .nav-link { font-weight: normal; color: white; transition: all 0.3s ease; }
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active { background-color: #495057; color: #fff; }
|
||||
.content { margin-top: 56px; padding: 40px 20px; position: relative; z-index: 1; background-color: #f4f6f9; transition: margin-left 0.3s ease; }
|
||||
.navbar { position: fixed; top: 0; width: 100%; z-index: 1050; }
|
||||
/* A partir de dispositivos medianos (>=768px), deja espacio lateral */
|
||||
@media (min-width: 768px) { .content { margin-left: 250px; /* Ancho del sidebar */ } }
|
||||
/* En móviles, sin margen lateral */
|
||||
@media (max-width: 767.98px) {
|
||||
.content { margin-left: 0; }
|
||||
.sidebar .nav-link { font-weight: normal; color: #343a40; background-color: transparent; }
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active { background-color: #e9ecef; color: #212529; }
|
||||
}
|
||||
.card { border-radius: 12px; }
|
||||
.table thead th { background: #343a40; color: #fff; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="content">
|
||||
<h4>📥 Solicitudes Pendientes</h4>
|
||||
|
||||
<div class="card p-3 shadow-sm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="tabla-pendientes">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Empresa</th>
|
||||
<th>RFC</th>
|
||||
<th>Correo</th>
|
||||
<th>Teléfono</th>
|
||||
<th>Fecha</th>
|
||||
<th>Archivo SAT</th>
|
||||
<th>Acción</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($solicitudes as $s): ?>
|
||||
<tr>
|
||||
<td><?= $s['request_id'] ?></td>
|
||||
<td><?= htmlspecialchars(decrypt($s['company_name'])) ?></td>
|
||||
<td><?= htmlspecialchars(decrypt($s['rfc'])) ?></td>
|
||||
<td><?= htmlspecialchars($s['email']) ?></td>
|
||||
<td><?= htmlspecialchars($s['phone']) ?></td>
|
||||
<td><?= $s['request_date'] ? $s['request_date']->format('Y-m-d H:i') : '' ?></td>
|
||||
<td>
|
||||
<?php if (!empty($s['opinion_file'])): ?>
|
||||
<a href="/IMPORTADORES/ver_opinion.php?file=<?= urlencode($s['opinion_file']) ?>" target="_blank" class="btn btn-sm btn-outline-secondary">Ver PDF</a>
|
||||
<?php else: ?>
|
||||
<span class="text-muted">No adjunto</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/IMPORTADORES/agentes/aprobar_solicitud?id=<?= $s['request_id'] ?>" class="btn btn-sm btn-success">Aprobar</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php include __DIR__ . '/../partials/sidebar_configuracion.php'; ?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Dashboard | Configuración</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet">
|
||||
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
|
||||
<style>
|
||||
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; }
|
||||
.sidebar { width: 220px; height: 100vh; background-color: #343a40; position: fixed; top: 0; left: 0; padding-top: 56px; z-index: 1040; }
|
||||
.sidebar .nav-link { font-weight: bold; color: white; transition: all 0.3s ease; }
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active { background-color: #495057; color: #fff; }
|
||||
.content { margin-top: 56px; padding: 40px 20px; position: relative; z-index: 1; background-color: #f4f6f9; transition: margin-left 0.3s ease; }
|
||||
.navbar { position: fixed; top: 0; width: 100%; z-index: 1050; }
|
||||
/* A partir de dispositivos medianos (>=768px), deja espacio lateral */
|
||||
@media (min-width: 768px) { .content { margin-left: 250px; /* Ancho del sidebar */ } }
|
||||
/* En móviles, sin margen lateral */
|
||||
@media (max-width: 767.98px) {
|
||||
.content { margin-left: 0; }
|
||||
.sidebar .nav-link { font-weight: normal; color: #343a40; background-color: transparent; }
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active { background-color: #e9ecef; color: #212529; }
|
||||
}
|
||||
.card { border-radius: 12px; }
|
||||
table.dataTable thead th { background: #343a40; color: #fff; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,30 +1,4 @@
|
||||
<?php
|
||||
// Aseguramos que el usuario esté autenticado
|
||||
if (!isset($_SESSION['usuario_id'])) {
|
||||
header('Location: /IMPORTADORES/login');
|
||||
exit;
|
||||
}
|
||||
|
||||
// Determinar el tipo de usuario
|
||||
$tipoUsuario = $_SESSION['tipo_usuario'] ?? 'importador';
|
||||
|
||||
// Incluir el sidebar correspondiente
|
||||
switch ($tipoUsuario) {
|
||||
case 'super_admin':
|
||||
include __DIR__ . '/../partials/sidebar_administrador.php';
|
||||
break;
|
||||
case 'admin_agencia':
|
||||
include __DIR__ . '/../partials/sidebar_agencia.php';
|
||||
break;
|
||||
case 'agente_aduanal':
|
||||
include __DIR__ . '/../partials/sidebar_agente.php';
|
||||
break;
|
||||
case 'importador':
|
||||
default:
|
||||
include __DIR__ . '/../partials/sidebar_importador.php';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<?php include __DIR__ . '/../partials/sidebar_configuracion.php'; ?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php include __DIR__ . '/../partials/sidebar_administrador.php'; ?>
|
||||
<?php include __DIR__ . '/../partials/sidebar_configuracion.php'; ?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php include __DIR__ . '/../partials/sidebar_configuracion.php'; ?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Dashboard | Configuración</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet">
|
||||
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
|
||||
<style>
|
||||
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; }
|
||||
.sidebar { width: 220px; height: 100vh; background-color: #343a40; position: fixed; top: 0; left: 0; padding-top: 56px; z-index: 1040; }
|
||||
.sidebar .nav-link { font-weight: bold; color: white; transition: all 0.3s ease; }
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active { background-color: #495057; color: #fff; }
|
||||
.content { margin-top: 56px; padding: 40px 20px; position: relative; z-index: 1; background-color: #f4f6f9; transition: margin-left 0.3s ease; }
|
||||
.navbar { position: fixed; top: 0; width: 100%; z-index: 1050; }
|
||||
/* A partir de dispositivos medianos (>=768px), deja espacio lateral */
|
||||
@media (min-width: 768px) { .content { margin-left: 250px; /* Ancho del sidebar */ } }
|
||||
/* En móviles, sin margen lateral */
|
||||
@media (max-width: 767.98px) {
|
||||
.content { margin-left: 0; }
|
||||
.sidebar .nav-link { font-weight: normal; color: #343a40; background-color: transparent; }
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active { background-color: #e9ecef; color: #212529; }
|
||||
}
|
||||
.card { border-radius: 12px; }
|
||||
table.dataTable thead th { background: #343a40; color: #fff; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -47,30 +47,30 @@
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-primary">Registro de usuarios</h5>
|
||||
<h5 class="text-success">Registro de usuarios</h5>
|
||||
<p>Ver registros de los usuarios.</p>
|
||||
<a href="/IMPORTADORES/bitacoras/usuarios"
|
||||
class="btn btn-primary btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/usuarios' ? 'active' : '' ?>">
|
||||
class="btn btn-success btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/usuarios' ? 'active' : '' ?>">
|
||||
Ver registro de usuarios
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-primary">Registro de agencias</h5>
|
||||
<h5 class="text-info">Registro de agencias</h5>
|
||||
<p>Ver registros de las agencias.</p>
|
||||
<a href="/IMPORTADORES/bitacoras/agencias"
|
||||
class="btn btn-primary btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/agencias' ? 'active' : '' ?>">
|
||||
class="btn btn-info btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/agencias' ? 'active' : '' ?>">
|
||||
Ver registro de agencias
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-primary">Mi actividad</h5>
|
||||
<h5 class="text-warning">Mi actividad</h5>
|
||||
<p>Ver mi actividad en la plataforma.</p>
|
||||
<a href="/IMPORTADORES/bitacoras/miAcceso"
|
||||
class="btn btn-primary btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/miAcceso' ? 'active' : '' ?>">
|
||||
class="btn btn-warning btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/miAcceso' ? 'active' : '' ?>">
|
||||
Ver mis accesos
|
||||
</a>
|
||||
</div>
|
||||
@@ -90,20 +90,20 @@
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-primary">Registro de vinculaciones</h5>
|
||||
<h5 class="text-success">Registro de vinculaciones</h5>
|
||||
<p>Ver las vinculaciones de mi agencia.</p>
|
||||
<a href="/IMPORTADORES/bitacoras/vinculaciones"
|
||||
class="btn btn-primary btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/vinculaciones' ? 'active' : '' ?>">
|
||||
class="btn btn-success btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/vinculaciones' ? 'active' : '' ?>">
|
||||
Ver actividad
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-primary">Mi actividad</h5>
|
||||
<h5 class="text-info">Mi actividad</h5>
|
||||
<p>Ver mi actividad en la plataforma.</p>
|
||||
<a href="/IMPORTADORES/bitacoras/miAcceso"
|
||||
class="btn btn-primary btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/miAcceso' ? 'active' : '' ?>">
|
||||
class="btn btn-info btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/miAcceso' ? 'active' : '' ?>">
|
||||
Ver mis accesos
|
||||
</a>
|
||||
</div>
|
||||
@@ -123,10 +123,10 @@
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-primary">Mi actividad</h5>
|
||||
<h5 class="text-success">Mi actividad</h5>
|
||||
<p>Ver mi actividad en la plataforma.</p>
|
||||
<a href="/IMPORTADORES/bitacoras/miAcceso"
|
||||
class="btn btn-primary btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/miAcceso' ? 'active' : '' ?>">
|
||||
class="btn btn-success btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/miAcceso' ? 'active' : '' ?>">
|
||||
Ver mis accesos
|
||||
</a>
|
||||
</div>
|
||||
@@ -146,10 +146,10 @@
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h5 class="text-primary">Mi actividad</h5>
|
||||
<h5 class="text-success">Mi actividad</h5>
|
||||
<p>Ver mi actividad en la plataforma.</p>
|
||||
<a href="/IMPORTADORES/bitacoras/miAcceso"
|
||||
class="btn btn-primary btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/miAcceso' ? 'active' : '' ?>">
|
||||
class="btn btn-success btn-sm mt-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/miAcceso' ? 'active' : '' ?>">
|
||||
Ver mis accesos
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php include __DIR__ . '/../partials/sidebar_configuracion.php'; ?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Dashboard | Configuración</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet">
|
||||
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
|
||||
<style>
|
||||
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; }
|
||||
.sidebar { width: 220px; height: 100vh; background-color: #343a40; position: fixed; top: 0; left: 0; padding-top: 56px; z-index: 1040; }
|
||||
.sidebar .nav-link { font-weight: bold; color: white; transition: all 0.3s ease; }
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active { background-color: #495057; color: #fff; }
|
||||
.content { margin-top: 56px; padding: 40px 20px; position: relative; z-index: 1; background-color: #f4f6f9; transition: margin-left 0.3s ease; }
|
||||
.navbar { position: fixed; top: 0; width: 100%; z-index: 1050; }
|
||||
/* A partir de dispositivos medianos (>=768px), deja espacio lateral */
|
||||
@media (min-width: 768px) { .content { margin-left: 250px; /* Ancho del sidebar */ } }
|
||||
/* En móviles, sin margen lateral */
|
||||
@media (max-width: 767.98px) {
|
||||
.content { margin-left: 0; }
|
||||
.sidebar .nav-link { font-weight: normal; color: #343a40; background-color: transparent; }
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active { background-color: #e9ecef; color: #212529; }
|
||||
}
|
||||
.card { border-radius: 12px; }
|
||||
table.dataTable thead th { background: #343a40; color: #fff; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php include __DIR__ . '/../partials/sidebar_configuracion.php'; ?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Dashboard | Configuración</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet">
|
||||
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
|
||||
<style>
|
||||
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; }
|
||||
.sidebar { width: 220px; height: 100vh; background-color: #343a40; position: fixed; top: 0; left: 0; padding-top: 56px; z-index: 1040; }
|
||||
.sidebar .nav-link { font-weight: bold; color: white; transition: all 0.3s ease; }
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active { background-color: #495057; color: #fff; }
|
||||
.content { margin-top: 56px; padding: 40px 20px; position: relative; z-index: 1; background-color: #f4f6f9; transition: margin-left 0.3s ease; }
|
||||
.navbar { position: fixed; top: 0; width: 100%; z-index: 1050; }
|
||||
/* A partir de dispositivos medianos (>=768px), deja espacio lateral */
|
||||
@media (min-width: 768px) { .content { margin-left: 250px; /* Ancho del sidebar */ } }
|
||||
/* En móviles, sin margen lateral */
|
||||
@media (max-width: 767.98px) {
|
||||
.content { margin-left: 0; }
|
||||
.sidebar .nav-link { font-weight: normal; color: #343a40; background-color: transparent; }
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active { background-color: #e9ecef; color: #212529; }
|
||||
}
|
||||
.card { border-radius: 12px; }
|
||||
table.dataTable thead th { background: #343a40; color: #fff; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -49,8 +49,8 @@
|
||||
</a>
|
||||
|
||||
<!-- USUARIOS ACTIVOS -->
|
||||
<a href="/IMPORTADORES/vinculaciones/usuariosVinculados"
|
||||
class="nav-link px-3 py-2 <?= str_contains($_SERVER['REQUEST_URI'], '/IMPORTADORES/vinculaciones/usuariosVinculados') ? 'active' : '' ?>">
|
||||
<a href="/IMPORTADORES/vinculaciones/vinculacionesAgencia"
|
||||
class="nav-link px-3 py-2 <?= str_contains($_SERVER['REQUEST_URI'], '/IMPORTADORES/vinculaciones/vinculacionesAgencia') ? 'active' : '' ?>">
|
||||
👥 Usuarios Vinculados
|
||||
</a>
|
||||
|
||||
@@ -90,8 +90,8 @@
|
||||
</a>
|
||||
|
||||
<!-- USUARIOS ACTIVOS -->
|
||||
<a href="/IMPORTADORES/vinculaciones/usuariosVinculados"
|
||||
class="nav-link px-3 py-2 <?= str_contains($_SERVER['REQUEST_URI'], '/IMPORTADORES/vinculaciones/usuariosVinculados') ? 'active' : '' ?>">
|
||||
<a href="/IMPORTADORES/vinculaciones/vinculacionesAgencia"
|
||||
class="nav-link px-3 py-2 <?= str_contains($_SERVER['REQUEST_URI'], '/IMPORTADORES/vinculaciones/vinculacionesAgencia') ? 'active' : '' ?>">
|
||||
✅ Usuarios Vinculados
|
||||
</a>
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@
|
||||
</a>
|
||||
|
||||
<!-- IMPORTADORES VINCULADOS -->
|
||||
<a href="/IMPORTADORES/agentes/activos"
|
||||
class="nav-link px-3 py-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/activos' ? 'active' : '' ?>">
|
||||
<a href="/IMPORTADORES/agentes/vinculados"
|
||||
class="nav-link px-3 py-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/vinculados' ? 'active' : '' ?>">
|
||||
🔗 Vinculados
|
||||
</a>
|
||||
|
||||
@@ -142,17 +142,42 @@
|
||||
🏠 Inicio
|
||||
</a>
|
||||
|
||||
<!-- IMPORTADORES ACTIVOS -->
|
||||
<a href="/IMPORTADORES/agentes/activos"
|
||||
class="nav-link px-3 py-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/activos' ? 'active' : '' ?>">
|
||||
✅ Importadores Activos
|
||||
<!-- IMPORTADORES VINCULADOS -->
|
||||
<a href="/IMPORTADORES/agentes/vinculados"
|
||||
class="nav-link px-3 py-2 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/agentes/vinculados' ? 'active' : '' ?>">
|
||||
🔗 Vinculados
|
||||
</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>
|
||||
<!-- Patentes -->
|
||||
<?php if ($esVistaPatente): ?>
|
||||
<?php $enDashboardPatente = $_SERVER['REQUEST_URI'] === '/IMPORTADORES/patente/dashboard'; ?>
|
||||
<a class="nav-link px-3 py-2 d-flex justify-content-between align-items-center <?= $esVistaPatente ? 'active' : '' ?>"
|
||||
href="<?= $enDashboardPatente ? '#submenuAgentesAduanales' : 'IMPORTADORES/patente/dashboard' ?>"
|
||||
<?= $enDashboardPatente ? 'data-bs-toggle="collapse"' : '' ?>
|
||||
role="button" aria-expanded="true" aria-controls="submenuAgentesAduanales"
|
||||
onclick="<?= $enDashboardPatente ? '' : 'event.preventDefault(); window.location.href = \'/IMPORTADORES/patente/dashboard\';' ?>">
|
||||
📑 Patentes
|
||||
<span class="badge bg-secondary">2</span>
|
||||
</a>
|
||||
<div class="collapse show" id="submenuAgentesAduanales">
|
||||
<nav class="nav flex-column ms-3">
|
||||
<a href="/IMPORTADORES/patente/lista"
|
||||
class="nav-link px-3 py-1 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/patente/lista' ? 'active' : '' ?>">
|
||||
• Ver Patentes
|
||||
</a>
|
||||
<a href="/IMPORTADORES/patente/alta"
|
||||
class="nav-link px-3 py-1 <?= str_contains($_SERVER['REQUEST_URI'], '/IMPORTADORES/patente/alta') ? 'active' : '' ?>">
|
||||
• Nueva Patente
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esVistaAgentes || $esVistaLocaciones): ?>
|
||||
<a href="/IMPORTADORES/patente/dashboard"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
📑 Patentes
|
||||
<span class="badge bg-secondary">2</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- LOCACIONES -->
|
||||
<?php if ($esVistaLocaciones): ?>
|
||||
@@ -185,37 +210,6 @@
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Patentes -->
|
||||
<?php if ($esVistaPatente): ?>
|
||||
<?php $enDashboardPatente = $_SERVER['REQUEST_URI'] === '/IMPORTADORES/patente/dashboard'; ?>
|
||||
<a class="nav-link px-3 py-2 d-flex justify-content-between align-items-center <?= $esVistaPatente ? 'active' : '' ?>"
|
||||
href="<?= $enDashboardPatente ? '#submenuAgentesAduanales' : 'IMPORTADORES/patente/dashboard' ?>"
|
||||
<?= $enDashboardPatente ? 'data-bs-toggle="collapse"' : '' ?>
|
||||
role="button" aria-expanded="true" aria-controls="submenuAgentesAduanales"
|
||||
onclick="<?= $enDashboardPatente ? '' : 'event.preventDefault(); window.location.href = \'/IMPORTADORES/patente/dashboard\';' ?>">
|
||||
📑 Patentes
|
||||
<span class="badge bg-secondary">2</span>
|
||||
</a>
|
||||
<div class="collapse show" id="submenuAgentesAduanales">
|
||||
<nav class="nav flex-column ms-3">
|
||||
<a href="/IMPORTADORES/patente/lista"
|
||||
class="nav-link px-3 py-1 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/patente/lista' ? 'active' : '' ?>">
|
||||
• Ver Patentes
|
||||
</a>
|
||||
<a href="/IMPORTADORES/patente/alta"
|
||||
class="nav-link px-3 py-1 <?= str_contains($_SERVER['REQUEST_URI'], '/IMPORTADORES/patente/alta') ? 'active' : '' ?>">
|
||||
• Nueva Patentes
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esVistaAgentes || $esVistaLocaciones): ?>
|
||||
<a href="/IMPORTADORES/patente/dashboard"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
📑 Patentes
|
||||
<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' : '' ?>">
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
<title>Dashboard | Agente Aduanal</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet">
|
||||
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<style>
|
||||
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; }
|
||||
@@ -31,33 +35,31 @@
|
||||
<body>
|
||||
|
||||
<div class="content">
|
||||
<h4>✅ Importadores Activos</h4>
|
||||
<h4>✅ Importadores Vinculados</h4>
|
||||
|
||||
<div class="card p-3 shadow-sm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="tabla-activos">
|
||||
<table class="table table-striped" id="tabla-importadores-vinculados">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Nombre</th>
|
||||
<th>Correo</th>
|
||||
<th>Fecha Registro</th>
|
||||
<th>RFC</th>
|
||||
<th>Teléfono</th>
|
||||
<th>Fecha de Vinculación</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($importadores as $i): ?>
|
||||
<?php foreach ($vinculados as $v): ?>
|
||||
<tr>
|
||||
<td><?= $i['id_usuario'] ?></td>
|
||||
<td><?= htmlspecialchars(($i['nombre'])) ?></td>
|
||||
<td><?= htmlspecialchars($i['email']) ?></td>
|
||||
<td><?= isset($i['creado_en']) && $i['creado_en'] instanceof DateTime ? $i['creado_en']->format('Y-m-d H:i') : '' ?></td>
|
||||
<td><?= $v['id_importador'] ?></td>
|
||||
<td><?= htmlspecialchars(decrypt($v['importador_nombre'])) ?></td>
|
||||
<td><?= htmlspecialchars($v['rfc']) ?></td>
|
||||
<td><?= htmlspecialchars($v['telefono']) ?></td>
|
||||
<td><?= isset($v['fecha_vinculacion']) && $v['fecha_vinculacion'] instanceof DateTime ? $v['fecha_vinculacion']->format('Y-m-d H:i') : '' ?></td>
|
||||
<td>
|
||||
<?php if (isset($i['activo']) && $i['activo'] == 1): ?>
|
||||
<a href="/IMPORTADORES/agentes/toggle_estado?id=<?= $i['id_usuario'] ?>&success=1" class="btn btn-sm btn-danger">Suspender</a>
|
||||
<?php else: ?>
|
||||
<a href="/IMPORTADORES/agentes/toggle_estado?id=<?= $i['id_usuario'] ?>&success=1" class="btn btn-sm btn-success">Activar</a>
|
||||
<?php endif; ?>
|
||||
<a href="/IMPORTADORES/agentes/desvincularAgente?id=<?= $v['id_relacion'] ?>" class="btn btn-sm btn-danger">Desvincular</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@@ -67,14 +69,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#tabla-importadores-vinculados').DataTable({
|
||||
order: [],
|
||||
language: {
|
||||
url: 'https://cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php if (isset($_GET['success'])): ?>
|
||||
<script>
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Estado actualizado',
|
||||
text: 'El estado del usuario se ha actualizado correctamente.',
|
||||
confirmButtonColor: '#198754'
|
||||
});
|
||||
<?php if ($_GET['success'] === 'unlinked'): ?>
|
||||
Swal.fire({ icon: 'success', title: 'Usuario desvinculado',
|
||||
text: 'El usuario se ha desvinculado correctamente.',
|
||||
confirmButtonColor: '#198754' });
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($_GET['error'])): ?>
|
||||
<script>
|
||||
<?php if ($_GET['error'] === 'unlinked_failed'): ?>
|
||||
Swal.fire({ icon: 'error', title: 'Desvinculación fallida', text: 'No se ha podido desvincular el usuario.', confirmButtonColor: '#dc3545' });
|
||||
<?php elseif ($_GET['error'] === 'invalid_id'): ?>
|
||||
Swal.fire({ icon: 'error', title: 'ID inválido', text: 'El identificador de la relación no es válido.', confirmButtonColor: '#dc3545' });
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -75,10 +75,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td colspan="8" class="text-center">No hay agencias registradas aún.</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php include __DIR__ . '/../partials/sidebar_agencia.php'; ?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Dashboard | Agencia Aduanal</title>
|
||||
@@ -45,6 +46,8 @@
|
||||
<th>Nombre</th>
|
||||
<th>RFC</th>
|
||||
<th>Teléfono</th>
|
||||
<th>Usuario</th>
|
||||
<th>Vinculación</th>
|
||||
<th>Fecha de Vinculación</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
@@ -57,9 +60,19 @@
|
||||
<td><?= htmlspecialchars(decrypt($v['importador_nombre'] ?? '')) ?></td>
|
||||
<td><?= htmlspecialchars($v['rfc'] ?? '') ?></td>
|
||||
<td><?= htmlspecialchars($v['telefono'] ?? '') ?></td>
|
||||
<td><?= htmlspecialchars($v['tipo_usuario_sistema'] ?? '') ?></td>
|
||||
<td><?= htmlspecialchars(ucfirst($v['tipo_vinculacion'] ?? '')) ?></td>
|
||||
<td><?= !empty($v['fecha_vinculacion']) ? $v['fecha_vinculacion']->format('Y-m-d H:i') : '' ?></td>
|
||||
<td>
|
||||
<a href="/IMPORTADORES/vinculaciones/desvincular?id=<?= $v['id_relacion'] ?>" class="btn btn-sm btn-danger">Desvincular</a>
|
||||
<?php if (in_array($v['tipo_usuario_sistema'], ['importador', 'agente_aduanal'])): ?>
|
||||
<a href="/IMPORTADORES/vinculaciones/desvincularAgencia?id=<?= $v['id_relacion'] ?>&tipo=<?= $v['tipo_vinculacion'] ?>"
|
||||
class="btn btn-sm btn-danger"
|
||||
onclick="return confirm('¿Está seguro de que desea desvincular este usuario?')">
|
||||
Desvincular
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<span class="text-muted small">N/A</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@@ -65,7 +65,7 @@
|
||||
<td><?= htmlspecialchars($v['direccion'] ?? '') ?></td>
|
||||
<td><?= !empty($v['fecha_vinculacion']) ? $v['fecha_vinculacion']->format('Y-m-d H:i') : '' ?></td>
|
||||
<td>
|
||||
<a href="/IMPORTADORES/vinculaciones/desvincularUsuario?id=<?= $v['id_relacion'] ?>" class="btn btn-sm btn-danger">Desvincular</a>
|
||||
<a href="/IMPORTADORES/importadores/desvincularUsuario?id=<?= $v['id_relacion'] ?>" class="btn btn-sm btn-danger">Desvincular</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
Reference in New Issue
Block a user