From c4657e4509733699c0f26a3c900bab47e915d5a0 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sun, 23 Apr 2023 10:51:37 +0200 Subject: Updated 5 files and added 2 files (automated) --- pages/api/fronter.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'pages/api/fronter.php') diff --git a/pages/api/fronter.php b/pages/api/fronter.php index 9ef5571..9f70fdc 100644 --- a/pages/api/fronter.php +++ b/pages/api/fronter.php @@ -105,6 +105,21 @@ switch ($type) { break; + case "bottom": + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } + + $day = $list[$date]; + + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } + + moveElement($list[$date], $index, count($list[$date]) - 1); + + break; + case "up": if (!isset($index) || trim($index) === "" || !is_integer($index)) { if ($index !== null) peh_error("Invalid index", 400); @@ -120,6 +135,21 @@ switch ($type) { break; + case "top": + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } + + $day = $list[$date]; + + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } + + moveElement($list[$date], $index, 0); + + break; + default: peh_error("Invalid type name", 400); break; -- cgit