$check = getimagesize($_FILES["edit_addi_food_image"]["tmp_name"]); if ($check !== false) { $file_path = $target_dir . $file['name']; move_uploaded_file($file['tmp_name'], $file_path); $image = $file['name']; //call function to modify Additional Food updateAdditionalFood($name, $cost, $keys, $image, $id); } } else { updateAdditionalFoodWithoutImage($name, $cost, $keys, $id); } //return updated data if (isset($_POST['special'])) { $row = addiFoodFull(); } else { $row = addiFood(); } $resp = $row; echo json_encode($resp); } elseif (isset($_POST['newSetMenuTitle'])) { // add set menu $title = $_POST['newSetMenuTitle']; $items = $_POST['newSetMenuItems']; $cost = $_POST['newSetMenuCost']; insertNewSetItems($title, $items, $cost); $row = setMenu(); $resp = $row; echo json_encode($resp); } elseif (isset($_POST['setMenuKey'])) { //delete set menu $key = $_POST['setMenuKey'];
function getAllAdditionalFood() { $addiFood = addiFood(); return $addiFood; }
function additionalFood() { $addiFood = addiFood(); return $addiFood; }