rozpracovane API a frontend pomocou Vue.js

This commit is contained in:
2025-04-13 01:37:24 +02:00
parent 6dce7184bd
commit ee4729b8ef
23 changed files with 1929 additions and 0 deletions

46
api.php Normal file
View File

@ -0,0 +1,46 @@
<?php
include_once 'config.php';
$action = $_REQUEST['action'];
switch ($action) {
default:
case 'help':
$result = help();
break;
case 'add':
$result = reportAdd($_REQUEST['title'], $_REQUEST['description'], $_REQUEST['status'], $_REQUEST['group'], $_REQUEST['priority']);
break;
case 'update':
$result = reportUpdate($_REQUEST['report_id'], $_REQUEST['title'], $_REQUEST['description'], $_REQUEST['status'], $_REQUEST['group'], $_REQUEST['priority']);
break;
case 'delete':
$result = reportDelete($_REQUEST['report_id']);
break;
case 'get':
$result = reportGet($_REQUEST['report_id']);
break;
case 'getall':
$result = reportGetAll($_REQUEST['status']);
break;
}
header('Content-Type: application/json');
echo json_encode($result);
exit;
function help() {
return [
'actions' => [
'help' => 'Show this help',
'add' => 'Add report',
'update' => 'Update report',
'delete' => 'Delete report',
'get' => 'Get report',
'getall' => 'Get all reports'
]
];
}
?>