From 529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105 Mon Sep 17 00:00:00 2001 From: Minteck Date: Tue, 24 Aug 2021 15:38:16 +0200 Subject: Update --- Neutron-trunk/api/admin/calendar_delete.php | 64 +++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Neutron-trunk/api/admin/calendar_delete.php (limited to 'Neutron-trunk/api/admin/calendar_delete.php') diff --git a/Neutron-trunk/api/admin/calendar_delete.php b/Neutron-trunk/api/admin/calendar_delete.php new file mode 100644 index 0000000..edeb86d --- /dev/null +++ b/Neutron-trunk/api/admin/calendar_delete.php @@ -0,0 +1,64 @@ + +events as $stdClass) { + $pos = $pos + 1; + if (isset($stdClass->timestamp)) { + if ($stdClass->timestamp == $id) { + unset($json->events[$pos]->timestamp); + unset($json->events[$pos]->datestr); + unset($json->events[$pos]->name); + unset($json->events[$pos]->description); + } + } + } + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/caldb.json", json_encode($json, JSON_PRETTY_PRINT)); + require $_SERVER['DOCUMENT_ROOT'] . "/api/admin/cache_content_reset.php"; + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("ok"); +} else { + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("CalDb1: ParseError: Unable to open database, JSON parse failed. Data might be corrupted"); +} \ No newline at end of file -- cgit