implementovane ulozenie do backend presuvanie reportov v dashboad

This commit is contained in:
2025-05-04 16:32:33 +02:00
parent c82df663df
commit eab71c2c4d
4 changed files with 120 additions and 17 deletions

18
api.php
View File

@ -16,10 +16,14 @@ switch ($action) {
$result = array('report_id' => $report_id);
break;
case 'update':
$result = reportUpdate($_REQUEST['report_id'], $_REQUEST['title'], $_REQUEST['description'], $_REQUEST['status'], $_REQUEST['group'], $_REQUEST['priority']);
$suc = reportUpdate($_REQUEST['report_id'], $_REQUEST['title'], $_REQUEST['description'], $_REQUEST['status'], $_REQUEST['group'], $_REQUEST['priority']);
if ($suc === false) $error = 'Update failed';
$result = array('processed' => $suc);
break;
case 'delete':
$result = reportDelete($_REQUEST['report_id']);
$suc = reportDelete($_REQUEST['report_id']);
if ($suc === false) $error = 'Update failed';
$result = array('processed' => $suc);
break;
case 'get':
$result = reportGet($_REQUEST['report_id']);
@ -30,6 +34,16 @@ switch ($action) {
case 'getallgrouped':
$result = reportGetAllGrouped($_REQUEST['status']);
break;
case 'updateordnum':
$suc = reportUpdateOrdnum($_REQUEST['ordnums']);
if ($suc === false) $error = 'Update Ordnum failed';
$result = array('processed' => $suc);
break;
case 'updatestatus':
$suc = reportUpdateStatus($_REQUEST['report_id'], $_REQUEST['status']);
if ($suc === false) $error = 'Update Status failed';
$result = array('processed' => $suc);
break;
}
header('Content-Type: application/json');