diff --git a/managment/www/api.php b/managment/www/api.php index c318b6d..63c5008 100644 --- a/managment/www/api.php +++ b/managment/www/api.php @@ -129,20 +129,12 @@ if ($action == "set") quit(); } } -else if ($action == "get-job") +else if ($action == "get-job" && isset($_POST["type"]) && $_POST["type"] != "") { get_lock($con); - if (isset($_POST["additional-type"]) && $_POST["additional-type"] != "") - { - $sql = "SELECT id FROM tile WHERE status_id = (SELECT id FROM status WHERE name = 'pending') OR status_id = (SELECT id FROM status WHERE name = ?) ORDER BY parent_id LIMIT 1"; - $stmt = $con->prepare($sql); - $stmt->bind_param("s", $_POST["additional-type"]); - } - else - { - $sql = "SELECT id FROM tile WHERE status_id = (SELECT id FROM status WHERE name = 'pending') ORDER BY parent_id LIMIT 1"; - $stmt = $con->prepare($sql); - } + $sql = "SELECT id FROM tile WHERE status_id = (SELECT id FROM status WHERE name = ?) ORDER BY parent_id LIMIT 1"; + $stmt = $con->prepare($sql); + $stmt->bind_param("s", $_POST["type"]); $stmt->execute(); $result = $stmt->get_result(); $stmt->close();