Files
MVE/views/expediente/ver.php
2025-05-27 10:03:50 -06:00

75 lines
3.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>📂 Ver Expediente</title>
<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>
<a href="/IMPORTADORES/expediente/subir/<?= $id_solicitud ?>" class="btn btn-success"> Subir archivos</a>
<?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>