File manager - Edit - /home/webtrixia/appvetta.webtrixia.com/index.php
Back
<?php define('ROOT', __DIR__); require ROOT.'/config/config.php'; require ROOT.'/src/helpers/Core.php'; require ROOT.'/src/controllers/controllers.php'; // Always log errors, only display in dev error_reporting(E_ALL); ini_set('log_errors', 1); if (defined('APP_ENV') && APP_ENV==='development') { ini_set('display_errors', 1); } else { ini_set('display_errors', 0); } Auth::start(); $uri = rtrim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH),'/') ?: '/'; $method = $_SERVER['REQUEST_METHOD']; function jsonOut($data) { header('Content-Type: application/json; charset=utf-8'); echo json_encode($data, JSON_UNESCAPED_UNICODE); exit; } set_exception_handler(function($e) { header('Content-Type: application/json; charset=utf-8'); http_response_code(500); echo json_encode(['ok'=>false,'msg'=>'Server error: '.$e->getMessage()], JSON_UNESCAPED_UNICODE); exit; }); $routes = [ 'GET' => [ '/' => fn() => header('Location:/login'), '/login' => fn() => AuthCtrl::showAuth('login'), '/register' => fn() => AuthCtrl::showAuth('register'), '/install' => fn() => View::render('shared/install'), '/logout' => fn() => AuthCtrl::logout(), '/dashboard' => fn() => (Auth::require() && Dashboard::show()), '/notifications/list' => fn() => jsonOut(Notifications::list()), '/notifications/unread' => fn() => jsonOut(Notifications::unread()), '/reminders/list' => fn() => jsonOut(ReminderCenter::list()), '/admin/clinic/gallery' => fn() => jsonOut(Admin::clinicGallery()), '/clinic/view' => fn() => ClinicView::show(), '/clinic/search' => fn() => jsonOut(ClinicSearch::search()), '/clinic/doctors' => fn() => jsonOut(ClinicDoctors::list()), '/admin/clinic/vets' => fn() => jsonOut(AdminExtra::getClinicVets()), '/appointments/slots' => fn() => jsonOut(Appointments::slots()), '/pets/health' => fn() => jsonOut(Pets::getHealth()), '/pets/transfer/status' => fn() => jsonOut(PetTransfer::status()), '/clinic/working-hours' => fn() => jsonOut(Appointments::getWorkingHours()), '/clinic/schedule-exceptions' => fn() => jsonOut(Appointments::getScheduleExceptions()), '/appointments/clinic-slots' => fn() => jsonOut(Appointments::clinicSlots()), '/appointments/toggle-busy' => fn() => jsonOut(Appointments::toggleBusy()), '/clinic/working-hours/save' => fn() => jsonOut(Appointments::saveWorkingHours()), '/appointments/owner-list' => fn() => jsonOut(Appointments::ownerList()), '/chat/load' => fn() => jsonOut(Chat::load()), '/chat/unread' => fn() => jsonOut(Chat::unread()), '/chat/conversations' => fn() => jsonOut(Chat::conversations()), '/community/feed' => fn() => jsonOut(Community::feed()), '/community/profile' => fn() => jsonOut(Community::profile()), '/community/comments' => fn() => jsonOut(Community::comments()), '/pdf/passport' => fn() => PdfPassport::generate(), '/family/list' => fn() => jsonOut(FamilyAccess::list()), '/family/invites' => fn() => jsonOut(FamilyAccess::listInvites()), ], 'POST' => [ '/auth/login' => fn() => jsonOut(AuthCtrl::login()), '/auth/register' => fn() => jsonOut(AuthCtrl::register()), '/pets/store' => fn() => jsonOut(Pets::store()), '/pets/update' => fn() => jsonOut(Pets::update()), '/pets/health/save' => fn() => jsonOut(Pets::saveHealth()), '/pets/transfer/generate' => fn() => jsonOut(PetTransfer::generate()), '/pets/transfer/claim' => fn() => jsonOut(PetTransfer::claim()), '/pets/transfer/cancel' => fn() => jsonOut(PetTransfer::cancel()), '/pets/delete' => fn() => jsonOut(Pets::delete()), '/family/share' => fn() => jsonOut(FamilyAccess::share()), '/family/invite/create' => fn() => jsonOut(FamilyAccess::createInvite()), '/family/invite/claim' => fn() => jsonOut(FamilyAccess::claimInvite()), '/family/invite/revoke' => fn() => jsonOut(FamilyAccess::revokeInvite()), '/family/remove' => fn() => jsonOut(FamilyAccess::remove()), '/records/store' => fn() => jsonOut(Records::store()), '/records/list' => fn() => jsonOut(Records::list()), '/access/request' => fn() => jsonOut(Access::request()), '/access/approve' => fn() => jsonOut(Access::approve()), '/access/reject' => fn() => jsonOut(Access::reject()), '/access/revoke' => fn() => jsonOut(Access::revoke()), '/cards/activate' => fn() => jsonOut(Cards::activate()), '/profile/update' => fn() => jsonOut(Profile::update()), '/profile/password' => fn() => jsonOut(Profile::password()), '/profile/photo' => fn() => jsonOut(Profile::photo()), '/clinic/profile/update' => fn() => jsonOut(ClinicProfile::update()), '/clinic/working-hours/save' => fn() => jsonOut(Appointments::saveWorkingHours()), '/clinic/schedule-exceptions/save' => fn() => jsonOut(Appointments::saveScheduleException()), '/clinic/schedule-exceptions/delete' => fn() => jsonOut(Appointments::deleteScheduleException()), '/clinic/gallery/upload' => fn() => jsonOut(ClinicProfile::galleryUpload()), '/clinic/team/assign' => fn() => jsonOut(ClinicTeam::assign()), '/clinic/team/create' => fn() => jsonOut(ClinicTeam::create()), '/clinic/team/remove' => fn() => jsonOut(ClinicTeam::remove()), '/appointments/book' => fn() => jsonOut(Appointments::book()), '/appointments/cancel' => fn() => jsonOut(Appointments::cancel()), '/appointments/toggle-busy' => fn() => jsonOut(Appointments::toggleBusy()), '/appointments/clinic-update' => fn() => jsonOut(Appointments::clinicUpdate()), '/appointments/add-slots' => fn() => jsonOut(Appointments::addSlots()), '/appointments/delete-slot' => fn() => jsonOut(Appointments::deleteSlot()), '/appointments/clinic-list' => fn() => jsonOut(Appointments::clinicList()), '/chat/send' => fn() => jsonOut(Chat::send()), '/community/post' => fn() => jsonOut(Community::createPost()), '/community/story' => fn() => jsonOut(Community::createStory()), '/community/react' => fn() => jsonOut(Community::toggleReaction()), '/community/comment' => fn() => jsonOut(Community::createComment()), '/community/follow' => fn() => jsonOut(Community::toggleFollow()), '/notifications/read' => fn() => jsonOut(Notifications::read()), '/reminders/store' => fn() => jsonOut(ReminderCenter::store()), '/reminders/staff-store' => fn() => jsonOut(ReminderCenter::staffStore()), '/reminders/complete' => fn() => jsonOut(ReminderCenter::complete()), '/reminders/cancel' => fn() => jsonOut(ReminderCenter::cancel()), '/admin/cards/gen' => fn() => jsonOut(Admin::genCards()), '/admin/cards/delete' => fn() => jsonOut(Admin::deleteCard()), '/admin/cards/delete-batch' => fn() => jsonOut(Admin::deleteBatch()), '/admin/clinic/add' => fn() => jsonOut(Admin::addClinic()), '/admin/clinic/edit' => fn() => jsonOut(Admin::editClinic()), '/admin/clinic/status' => fn() => jsonOut(Admin::clinicStatus()), '/admin/clinic/gallery/delete' => fn() => jsonOut(Admin::clinicGalleryDelete()), '/admin/user/role' => fn() => jsonOut(Admin::setRole()), '/admin/user/ban' => fn() => jsonOut(Admin::banUser()), '/admin/user/premium' => fn() => jsonOut(Admin::setPremium()), '/admin/clinic/assign-user' => fn() => jsonOut(Admin::setRole()), '/admin/clinic/remove-vet' => fn() => jsonOut(AdminExtra::removeVetFromClinic()), '/admin/clinic/delete' => fn() => jsonOut(AdminExtra::deleteClinic()), ], ]; $handler = $routes[$method][$uri] ?? null; if ($handler) { try { $handler(); } catch (Throwable $ex) { header('Content-Type: application/json; charset=utf-8'); http_response_code(500); echo json_encode([ 'ok' => false, 'msg' => $ex->getMessage(), 'file' => APP_ENV==='development' ? basename($ex->getFile()).':'.$ex->getLine() : null, ], JSON_UNESCAPED_UNICODE); exit; } } else { http_response_code(404); View::render('shared/404'); }
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0 |
proxy
|
phpinfo
|
Settings