One Hat Cyber Team
Your IP :
104.23.243.59
Server IP :
172.67.218.182
Server :
Linux 128-201-239-36.cprapid.com 3.10.0-1160.41.1.el7.x86_64 #1 SMP Tue Aug 31 14:52:47 UTC 2021 x86_64
Server Software :
Apache
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
juscatamarca
/
www
/
campusjxj
/
helpers
/
Edit File:
functions.php
<?php declare(strict_types=1); require_once __DIR__ . '/../config/app.php'; function base_url(string $path = ''): string { $path = ltrim($path, '/'); return $path === '' ? BASE_URL : BASE_URL . '/' . $path; } function asset_url(string $path): string { return base_url('assets/' . ltrim($path, '/')); } function e(?string $value): string { return htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8'); } function redirect(string $path): void { header('Location: ' . base_url($path)); exit; } function set_flash(string $key, string $message): void { $_SESSION['flash'][$key] = $message; } function get_flash(string $key): ?string { if (!isset($_SESSION['flash'][$key])) { return null; } $message = $_SESSION['flash'][$key]; unset($_SESSION['flash'][$key]); return $message; } function current_user(): ?array { return $_SESSION['user'] ?? null; } function is_logged_in(): bool { return isset($_SESSION['user']) && isset($_SESSION['user']['role']); } function is_active_page(string $page, string $currentPage): string { return $page === $currentPage ? 'active' : ''; } function ui_role_label(string $role): string { switch ($role) { case 'admin': return 'Administrador'; case 'student': return 'Estudiante'; default: return ucfirst($role); } } function ui_status_label(string $status): string { switch ($status) { case 'active': return 'Activo'; case 'inactive': return 'Inactivo'; case 'blocked': return 'Bloqueado'; case 'draft': return 'Borrador'; case 'published': return 'Publicado'; case 'hidden': return 'Oculto'; case 'archived': return 'Archivado'; case 'enrolled': return 'Inscripto'; case 'completed': return 'Completado'; case 'dropped': return 'Dado de baja'; default: return ucfirst(str_replace('_', ' ', $status)); } }
Simpan