File "consultar.php"
Full Path: C:/wamp64/www/Actas_Usuarios/views/ActaApp/consultar.php
File size: 3.25 KB
MIME-type: text/x-php
Charset: utf-8
<?php
$pageTitle = 'Consulta Actas App';
require __DIR__ . '/../layout/header.php';
?>
<h1>đ Consulta de Actas de Entrega</h1>
<h2>Aplicativos â Sanmarino</h2>
<?php if ($mensaje): ?>
<div class="alert alert-success"><?= $mensaje ?></div>
<?php endif; ?>
<div style="display:flex;justify-content:space-between;align-items:center;margin-top:20px;flex-wrap:wrap;gap:10px">
<span style="color:#777;font-size:.9rem">
Total: <strong><?= count($actas) ?></strong> acta(s)
</span>
<div style="display:flex;gap:10px">
<a href="index.php?page=acta_app" class="btn btn-primary">â Nueva acta</a>
<a href="index.php?page=dashboard" class="btn btn-secondary">â MenĂș</a>
</div>
</div>
<?php if (empty($actas)): ?>
<p style="text-align:center;color:#999;padding:50px 20px;font-style:italic">
No se han registrado actas aĂșn.
</p>
<?php else: ?>
<table>
<thead>
<tr>
<th>ID</th>
<th>Fecha</th>
<th>Empleado</th>
<th>Cédula</th>
<th>Cargo</th>
<th>Aplicaciones / Usuarios</th>
<th>EntregĂł</th>
<th style="text-align:center">AcciĂłn</th>
</tr>
</thead>
<tbody>
<?php foreach ($actas as $a): ?>
<?php
// Intentar leer usuarios desde JSON, si no usar columnas legacy
$usuarios = [];
if (!empty($a['UsuariosJSON'])) {
$decoded = json_decode($a['UsuariosJSON'], true);
if (is_array($decoded)) $usuarios = $decoded;
}
if (empty($usuarios) && !empty($a['UsuarioApp'])) {
$usuarios[] = [
'aplicacion' => $a['Aplicacion'] ?? '',
'usuario' => $a['UsuarioApp'],
'link' => ''
];
}
?>
<tr>
<td><?= (int)$a['IdActa'] ?></td>
<td><?= htmlspecialchars(date('d/m/Y H:i', strtotime($a['FechaCreacion']))) ?></td>
<td><?= htmlspecialchars($a['Nombre']) ?></td>
<td><?= htmlspecialchars($a['Cedula']) ?></td>
<td><?= htmlspecialchars($a['Cargo']) ?></td>
<td>
<?php foreach ($usuarios as $u): ?>
<div style="font-size:.85rem;margin-bottom:3px">
<strong><?= htmlspecialchars($u['aplicacion']) ?></strong>
â <span style="color:#555"><?= htmlspecialchars($u['usuario']) ?></span>
</div>
<?php endforeach; ?>
</td>
<td>
<?= htmlspecialchars($a['NombreEntrega']) ?><br>
<small style="color:#777"><?= htmlspecialchars($a['CargoEntrega']) ?></small>
</td>
<td style="text-align:center">
<a href="index.php?page=acta_app_ver&id=<?= (int)$a['IdActa'] ?>"
class="btn btn-primary" target="_blank">đ Ver Acta</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php require __DIR__ . '/../layout/footer.php'; ?>