Preparando proyecto para migración a repositorio MVE

This commit is contained in:
2025-10-23 08:48:00 -06:00
parent b1b9e4a77c
commit d0af739ce2
75 changed files with 15875 additions and 4022 deletions

View File

@@ -7,104 +7,123 @@
<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>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<!-- Animate.css para animaciones adicionales -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<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; }
.card { border-radius: 12px; }
/* Animaciones personalizadas */
.card-hover { transition: all 0.3s ease; cursor: pointer; }
.card-hover:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15) !important; }
.btn-pulse { animation: pulse 2s infinite; }
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
.fade-in-up { animation: fadeInUp 0.8s ease-out; }
@keyframes fadeInUp {
from { opacity: 0; transform: translateY(30px); }
to { opacity: 1; transform: translateY(0); }
}
/* Responsive animations */
@media (max-width: 768px) { .card-hover:hover { transform: translateY(-4px) scale(1.01); } }
/* Efecto de glow para elementos activos */
.btn.active { box-shadow: 0 0 20px rgba(var(--bs-primary-rgb), 0.5); }
/* Animación para el título */
.title-glow { text-shadow: 0 0 10px rgba(0, 123, 255, 0.3); }
/* Efecto para botones */
.btn-animated { transition: all 0.3s ease; position: relative; overflow: hidden; }
.btn-animated:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); }
.btn-animated::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); transition: left 0.5s; }
.btn-animated:hover::before { left: 100%; }
.table th, .table td { vertical-align: middle; }
.folder-icon { color: #f0ad4e; font-size: 1.2rem; }
body { font-family: 'Segoe UI', sans-serif; background-color: #f6f8fb; }
.content { margin-top: 56px; padding: 32px 20px; background-color: #f6f8fb; }
@media (min-width: 768px) { .content { margin-left: var(--sidebar-width, 280px); } }
.ped-code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; letter-spacing: .5px; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .5rem; border-radius: 999px; font-size: .78rem; border: 1px solid #e5e7eb; background: #f8fafc; color: #334155; }
.kpi-card { border: 1px solid #e9ecef; border-radius: 12px; background: #fff; }
.file-card { border: 1px solid #eef1f5; border-radius: 12px; background:#fff; transition: box-shadow .2s ease, transform .2s ease; }
.file-card:hover { box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.08); transform: translateY(-2px); }
.file-icon { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: #f1f5f9; }
.toolbar .btn { border-radius: 10px; }
</style>
</head>
<body>
<div class="content">
<h4 class="mb-4 animate__animated animate__fadeInDown title_glow">📂 Archivos del Expediente</h4>
<div class="card p-4 bg-white shadow-sm card-hover position-relative h-auto fade-in-up">
<?php if (empty($archivos)): ?>
<p>No hay archivos subidos para esta solicitud.</p>
<a href="/IMPORTADORES/expediente/subir/<?= $id_solicitud ?>" class="btn btn-success mt-auto w-auto btn-animated"> Subir archivos</a>
<?php
$archCount = count($archivos ?? []);
$totalSize = 0; foreach(($archivos ?? []) as $a){ $totalSize += (float)($a['tamano_archivo'] ?? 0); }
$displayCode = $pedimento['pedimento_display'] ?? ($pedimento_id ?? '');
?>
<?php else: ?>
<div class="mb-3">
<a href="/IMPORTADORES/expediente/descargar_zip/<?= $id_solicitud ?>" class="btn btn-outline-dark mt-auto w-auto btn-animated">📦 Descargar todo en ZIP</a>
<div class="content">
<div class="d-flex flex-wrap align-items-center justify-content-between mb-3">
<div>
<div class="text-muted small">Pedimento</div>
<h3 class="ped-code mb-1"><?= htmlspecialchars($displayCode) ?></h3>
<div class="d-flex flex-wrap gap-2">
<span class="chip"><i class="fa-solid fa-warehouse"></i><?= htmlspecialchars($pedimento['aduana'] ?? '-') ?></span>
<span class="chip"><i class="fa-id-badge"></i><?= htmlspecialchars($pedimento['patente'] ?? '-') ?></span>
<span class="chip"><i class="fa-regular fa-calendar"></i><?= htmlspecialchars($pedimento['anio'] ?? '-') ?></span>
<?php if (!empty($pedimento['rfc_importador'])): ?>
<span class="chip"><i class="fa-solid fa-building"></i><?= htmlspecialchars($pedimento['rfc_importador']) ?></span>
<?php endif; ?>
</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 class="toolbar d-flex flex-wrap gap-2 align-items-center">
<input id="searchFiles" type="search" class="form-control" placeholder="Buscar por nombre o tipo">
<?php if (isset($pedimento_id)): ?>
<a href="/IMPORTADORES/expediente/subir_pedimento/<?= (int)$pedimento_id ?>" class="btn btn-success"><i class="fa-solid fa-upload me-1"></i> Subir</a>
<a href="/IMPORTADORES/expediente/descargar_zip_pedimento/<?= (int)$pedimento_id ?>" class="btn btn-outline-dark"><i class="fa-solid fa-box-archive me-1"></i> ZIP</a>
<?php else: ?>
<a href="/IMPORTADORES/expediente/subir/<?= $id_solicitud ?>" class="btn btn-success"><i class="fa-solid fa-upload me-1"></i> Subir</a>
<a href="/IMPORTADORES/expediente/descargar_zip/<?= $id_solicitud ?>" class="btn btn-outline-dark"><i class="fa-solid fa-box-archive me-1"></i> ZIP</a>
<?php endif; ?>
<a href="/IMPORTADORES/expediente/index" class="btn btn-secondary">← Volver</a>
</div>
</div>
<div class="row g-3 mb-4">
<div class="col-6 col-md-3">
<div class="kpi-card p-3">
<div class="text-muted">Archivos</div>
<div class="h5 mb-0"><?= (int)$archCount ?></div>
</div>
</div>
<div class="col-6 col-md-3">
<div class="kpi-card p-3">
<div class="text-muted">Tamaño total</div>
<div class="h5 mb-0"><?= number_format($totalSize, 2) ?> KB</div>
</div>
</div>
</div>
<?php if (empty($archivos)): ?>
<div class="p-4 bg-white border rounded-3 text-center">
No hay archivos subidos para este expediente.
</div>
<?php else: ?>
<div class="row" id="gridFiles">
<?php foreach ($archivos as $file):
$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';
$fecha = $file['creado_en'] instanceof DateTime ? $file['creado_en']->format('Y-m-d H:i') : '';
?>
<div class="col-12 col-md-6 col-xl-4 file-item" data-key="<?= htmlspecialchars(($file['nombre_archivo'] ?? '').' '.($file['tipo_archivo'] ?? '')) ?>">
<div class="file-card p-3 h-100">
<div class="d-flex align-items-start gap-3 mb-2">
<div class="file-icon"><i class="fas <?= $icon ?>"></i></div>
<div class="flex-grow-1">
<div class="fw-semibold"><?= htmlspecialchars($file['nombre_archivo']) ?></div>
<div class="text-muted small">Tipo: <?= htmlspecialchars($file['tipo_archivo']) ?> · <?= number_format($file['tamano_archivo'], 2) ?> KB</div>
<div class="text-muted small">Subido por <?= htmlspecialchars($file['creado_por']) ?> · <?= $fecha ?></div>
</div>
</div>
<div class="d-flex gap-2">
<a href="/IMPORTADORES/expediente/ver_archivo/<?= $file['id'] ?>" class="btn btn-sm btn-outline-secondary" target="_blank"><i class="fa-regular fa-eye"></i></a>
<a href="/IMPORTADORES/<?= $file['ruta_archivo'] ?>" download class="btn btn-sm btn-outline-primary"><i class="fa-solid fa-download"></i></a>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<script>
(function(){
const q = document.getElementById('searchFiles');
const items = Array.from(document.querySelectorAll('#gridFiles .file-item'));
function apply(){
const term = (q?.value || '').toLowerCase();
items.forEach(it => {
const key = (it.getAttribute('data-key')||'').toLowerCase();
it.style.display = !term || key.includes(term) ? '' : 'none';
});
}
q?.addEventListener('input', apply);
apply();
})();
</script>
</body>
</html>