File manager - Edit - /home/webtrixia/appvetta.webtrixia.com/uploads/check-vet2.php
Back
<?php define('ROOT', __DIR__); require ROOT.'/config/config.php'; require ROOT.'/src/helpers/Core.php'; require ROOT.'/src/controllers/controllers.php'; Auth::start(); $user = Auth::user(); if (!$user) { echo json_encode(['error' => 'not logged in']); exit; } $action = $_GET['action'] ?? ''; if ($action === 'book') { // Test booking echo "<h3>Test booking POST</h3>"; $_POST = [ 'clinic_id' => '1', 'pet_id' => '1', 'slot_id' => '1', 'title' => 'Тест', 'notes' => '', 'csrf' => $_SESSION['csrf'] ?? '' ]; $result = Appointments::book(); echo json_encode($result, JSON_UNESCAPED_UNICODE); } if ($action === 'health') { echo "<h3>Test health save POST</h3>"; $_POST = [ 'pet_id' => '1', 'food_brand' => 'Royal Canin тест', 'food_notes' => 'Тест бележки', 'likes' => 'Пиле', 'dislikes' => 'Лук', 'allergies' => '', 'conditions' => '', 'medications' => '', 'csrf' => $_SESSION['csrf'] ?? '' ]; $result = Pets::saveHealth(); echo json_encode($result, JSON_UNESCAPED_UNICODE); } if ($action === 'slots') { echo "<h3>Available slots for clinic 1</h3>"; $_GET['clinic_id'] = '1'; $_GET['date'] = date('Y-m-d'); $result = Appointments::slots(); echo json_encode($result, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); } echo "<br><br><a href='?action=book'>Test Book</a> | <a href='?action=health'>Test Health</a> | <a href='?action=slots'>Test Slots</a>";
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0 |
proxy
|
phpinfo
|
Settings