seccion expediente electronico

This commit is contained in:
2025-05-21 10:58:02 -06:00
parent d10d68f607
commit f7ba0e3381
91 changed files with 876 additions and 28 deletions

73
views/expediente/ver.php Normal file
View File

@@ -0,0 +1,73 @@
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>📂 Ver Expediente</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>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<style>
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; }
.content { margin-top: 56px; padding: 40px 20px; background-color: #f4f6f9; }
@media (min-width: 768px) { .content { margin-left: 250px; } }
.file-icon { margin-right: 8px; }
</style>
</head>
<body>
<?php include __DIR__ . '/../partials/sidebar_importador.php'; ?>
<div class="content">
<h4>📂 Archivos del Expediente</h4>
<div class="card p-4 bg-white shadow-sm">
<?php if (empty($archivos)): ?>
<p>No hay archivos subidos para esta solicitud.</p>
<?php else: ?>
<div class="mb-3">
<a href="/IMPORTADORES/expediente/descargar_zip/<?= $id_solicitud ?>" class="btn btn-outline-dark">📦 Descargar todo en ZIP</a>
</div>
<table class="table table-hover table-bordered">
<thead class="table-light">
<tr>
<th>Archivo</th>
<th>Tipo</th>
<th>Tamaño (KB)</th>
<th>Subido por</th>
<th>Fecha</th>
<th>Acciones</th>
</tr>
</thead>
<tbody>
<?php foreach ($archivos as $file): ?>
<tr>
<td>
<?php
$icon = 'fa-file';
$ext = strtolower(pathinfo($file['nombre_archivo'], PATHINFO_EXTENSION));
if (in_array($ext, ['pdf'])) $icon = 'fa-file-pdf text-danger';
elseif (in_array($ext, ['jpg', 'jpeg', 'png'])) $icon = 'fa-file-image text-info';
elseif (in_array($ext, ['doc', 'docx'])) $icon = 'fa-file-word text-primary';
elseif (in_array($ext, ['xls', 'xlsx'])) $icon = 'fa-file-excel text-success';
elseif (in_array($ext, ['zip', 'rar'])) $icon = 'fa-file-archive text-warning';
?>
<i class="fas <?= $icon ?> file-icon"></i>
<?= htmlspecialchars($file['nombre_archivo']) ?>
</td>
<td><?= htmlspecialchars($file['tipo_archivo']) ?></td>
<td><?= number_format($file['tamano_archivo'], 2) ?></td>
<td><?= htmlspecialchars($file['creado_por']) ?></td>
<td><?= $file['creado_en']->format('Y-m-d H:i') ?></td>
<td class="d-flex gap-2">
<a href="/IMPORTADORES/expediente/ver_archivo/<?= $file['id'] ?>" class="btn btn-sm btn-outline-secondary" target="_blank">👁 Ver</a>
<a href="/IMPORTADORES/<?= $file['ruta_archivo'] ?>" download class="btn btn-sm btn-outline-primary">⬇ Descargar</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<a href="/IMPORTADORES/expediente/index" class="btn btn-secondary mt-3">← Volver</a>
</div>
</div>
</body>
</html>