Bitácoras

This commit is contained in:
2025-06-27 10:29:31 -06:00
parent 5a9b77a624
commit 20e0f24f22
11 changed files with 419 additions and 52 deletions

View File

@@ -40,7 +40,7 @@
<div class="card p-3 shadow-sm">
<div class="table-responsive">
<table class="table table-striped" id="tabla-registros-agencias">
<thead>
<thead class="table-dark">
<tr>
<th>ID</th>
<th>Nombre</th>
@@ -53,9 +53,9 @@
<?php foreach ($registros as $r): ?>
<tr>
<td><?= htmlspecialchars($r['id_agencia'] ?? '') ?></td>
<td><?= htmlspecialchars(decrypt($r['nombre'] ?? '')) ?></td>
<td><?= htmlspecialchars(decrypt($r['nombre_agencia'] ?? '')) ?></td>
<td><?= htmlspecialchars($r['accion'] ?? '') ?></td>
<td><?= htmlspecialchars(decrypt($r['realizado_por'] ?? '')) ?></td>
<td><?= htmlspecialchars(decrypt($r['nombre'] ?? '')) ?></td>
<td><?= htmlspecialchars($r['fecha'] ? $r['fecha']->format('Y-m-d H:i:s') : '') ?></td>
</tr>
<?php endforeach; ?>

View File

@@ -40,7 +40,7 @@
<div class="card p-3 shadow-sm">
<div class="table-responsive">
<table class="table table-striped" id="tabla-logins">
<thead>
<thead class="table-dark">
<tr>
<th>ID</th>
<th>Nombre</th>

View File

@@ -35,8 +35,52 @@
<body>
<div class="content">
<h4 class="mb-4">👥 Acceso de Usuarios</h4>
<h4 class="mb-4">👥 Mi Actividad</h4>
<div class="card p-3 shadow-sm">
<div class="table-responsive">
<table class="table table-striped" id="tabla-logins-usuario">
<thead class="table-dark">
<tr>
<th>ID</th>
<th>Nombre</th>
<th>Correo</th>
<th>IP</th>
<th>Fecha</th>
<th>Estatus</th>
<th>Detalles</th>
</tr>
</thead>
<tbody>
<?php foreach ($registros as $r): ?>
<tr>
<td><?= htmlspecialchars($r['id'] ?? '') ?></td>
<td><?= htmlspecialchars(decrypt($r['nombre'] ?? '')) ?></td>
<td><?= htmlspecialchars($r['email'] ?? '') ?></td>
<td><?= htmlspecialchars($r['ip'] ?? '') ?></td>
<td><?= $r['fecha']->format('Y-m-d H:i:s') ?></td>
<td>
<?= $r['exito'] == 1 ? 'Éxito' : 'Fallido' ?>
</td>
<td><?= htmlspecialchars($r['detalle']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#tabla-logins-usuario').DataTable({
order: [],
language: {
url: 'https://cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
}
});
});
</script>
</body>
</html>

View File

@@ -33,7 +33,7 @@
</style>
</head>
<body>
<div class="content">
<h4 class="mb-4">🛠️ Cambios de Usuario</h4>

View File

@@ -33,6 +33,52 @@
</style>
</head>
<body>
<div class="content">
<h4 class="mb-4">🔗 Vinculaciones</h4>
<div class="card p-3 shadow-sm">
<div class="table-responsive">
<table class="table table-striped align-middle" id="tabla-bitacora-vinculaciones">
<thead class="table-dark">
<tr>
<th>#</th>
<th>Usuario</th>
<th>Acción</th>
<th>Aprobado por</th>
<th>Fecha</th>
</tr>
</thead>
<tbody>
<?php foreach ($registros as $r): ?>
<tr>
<td><?= htmlspecialchars($r['id_relacion']) ?></td>
<td><?= htmlspecialchars(decrypt($r['nombre_importador'])) ?></td>
<td>
<span class="badge bg-<?= $r['accion'] === 'Vinculación' ? 'success' : 'danger' ?>">
<?= $r['accion'] ?>
</span>
</td>
<td><?= htmlspecialchars(decrypt($r['nombre_aprobador'] ?? '')) ?></td>
<td><?= $r['fecha'] instanceof DateTime ? $r['fecha']->format('Y-m-d H:i') : htmlspecialchars($r['fecha']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#tabla-bitacora-vinculaciones').DataTable({
order: [],
language: {
url: 'https://cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
}
});
});
</script>
</body>
</html>

View File

@@ -123,10 +123,20 @@
</div>
<div class="col-md-4">
<div class="card shadow-sm p-3">
<h5 class="text-success">Mi actividad</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-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-info">Mi actividad</h5>
<p>Ver mi actividad en la plataforma.</p>
<a href="/IMPORTADORES/bitacoras/miAcceso"
class="btn btn-success 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>

View File

@@ -33,6 +33,54 @@
</style>
</head>
<body>
<div class="content">
<h4 class="mb-4">👥 Acceso de Usuarios</h4>
<div class="card p-3 shadow-sm">
<div class="table-responsive">
<table class="table table-striped" id="tabla-logins">
<thead class="table-dark">
<tr>
<th>ID</th>
<th>Nombre</th>
<th>Correo</th>
<th>IP</th>
<th>Fecha</th>
<th>Estatus</th>
<th>Detalles</th>
</tr>
</thead>
<tbody>
<?php foreach ($registros as $r): ?>
<tr>
<td><?= htmlspecialchars($r['id_usuario'] ?? '') ?></td>
<td><?= htmlspecialchars(decrypt($r['nombre'] ?? '')) ?></td>
<td><?= htmlspecialchars($r['email'] ?? '') ?></td>
<td><?= htmlspecialchars($r['ip'] ?? '') ?></td>
<td><?= $r['fecha']->format('Y-m-d H:i:s') ?></td>
<td>
<?= $r['exito'] == 1 ? 'Éxito' : 'Fallido' ?>
</td>
<td><?= htmlspecialchars($r['detalle']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#tabla-logins').DataTable({
order: [],
language: {
url: 'https://cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
}
});
});
</script>
</body>
</html>

View File

@@ -33,6 +33,52 @@
</style>
</head>
<body>
<div class="content">
<h4 class="mb-4">🔗 Vinculaciones</h4>
<div class="card p-3 shadow-sm">
<div class="table-responsive">
<table class="table table-striped align-middle" id="tabla-vinculaciones-usuario">
<thead class="table-dark">
<tr>
<th>#</th>
<th>Agencia</th>
<th>Acción</th>
<th>Aprobado por</th>
<th>Fecha</th> <!-- vinculación // desvinculación -->
</tr>
</thead>
<tbody>
<?php foreach ($registros as $r): ?>
<tr>
<td><?= htmlspecialchars($r['id_relacion']) ?></td>
<td><?= htmlspecialchars(decrypt($r['nombre_agencia'])) ?></td>
<td>
<span class="badge bg-<?= $r['accion'] === 'Vinculación' ? 'success' : 'danger' ?>">
<?= $r['accion'] ?>
</span>
</td>
<td><?= htmlspecialchars(decrypt($r['nombre_aprobador'] ?? '')) ?></td>
<td><?= $r['fecha'] instanceof DateTime ? $r['fecha']->format('Y-m-d H:i') : htmlspecialchars($r['fecha']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#tabla-vinculaciones-usuario').DataTable({
order: [],
language: {
url: 'https://cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
}
});
});
</script>
</body>
</html>