requireAdmin(); $userModel = new User(); $horariosModel = new DiasHorarios(); $asignacionModel = new Asignacion(); $db = \Database::getInstance()->getConnection(); $totalUsuarios = count($userModel->getAll()); $totalAyudantes = count($userModel->getAyudantesActivos()); $totalHorarios = count($horariosModel->getAll()); $asignacionActual = $asignacionModel->getAsignacionActual(); $ayudantes = $userModel->getAyudantesActivos(); $horarios = $horariosModel->getAll(); $asignaciones = $asignacionModel->getTodasAsignaciones(); $html = PDFGenerator::getStyles(); $html .= PDFGenerator::getHeader('Reporte de Administración'); $html .= '
| Total Usuarios | Ayudantes Activos | Días Configurados | Turno Actual |
|---|---|---|---|
| ' . $totalUsuarios . ' | '; $html .= '' . $totalAyudantes . ' | '; $html .= '' . $totalHorarios . ' | '; $html .= '' . ($asignacionActual ? htmlspecialchars($asignacionActual['nombre']) : 'Sin asignar') . ' | '; $html .= '
| Nombre | Username | Estado | |
|---|---|---|---|
| ' . htmlspecialchars($u['nombre']) . ' | '; $html .= '' . htmlspecialchars($u['email']) . ' | '; $html .= '' . htmlspecialchars($u['username'] ?: '-') . ' | '; $html .= '' . ($u['activo'] ? 'Activo' : 'Inactivo') . ' | '; $html .= '
| Día | Hora Apertura | Hora Cierre | Estado |
|---|---|---|---|
| ' . ucfirst($h['dia_semana']) . ' | '; $html .= '' . date('H:i', strtotime($h['hora_apertura'])) . ' | '; $html .= '' . date('H:i', strtotime($h['hora_cierre'])) . ' | '; $html .= '' . ($h['activo'] ? 'Abierto' : 'Cerrado') . ' | '; $html .= '
| Semana Inicio | Semana Fin | Ayudante |
|---|---|---|
| ' . date('d/m/Y', strtotime($a['semana_inicio'])) . ' | '; $html .= '' . date('d/m/Y', strtotime($a['semana_fin'])) . ' | '; $html .= '' . htmlspecialchars($a['nombre']) . ' | '; $html .= '