$resp = array(); if (isset($_POST['updatedVat'])) { $vat = $_POST['updatedVat']; updateVat($vat); } elseif (isset($_POST['updateCost'])) { $cost = $_POST['updateCost']; updateExtraCost($cost); } elseif (isset($_POST['ID'])) { $shift = $_POST['updShift']; $time = $_POST['updTime']; $id = $_POST['ID']; updateSchedule($shift, $time, $id); } elseif (isset($_POST['updFeature'])) { $feature = $_POST['updFeature']; $id = $_POST['featureID']; updateFeature($feature, $id); } elseif (isset($_POST['advantageID'])) { $id = $_POST['advantageID']; $adv = $_POST['updAdvantage']; updateAdvantage($adv, $id); } elseif (isset($_POST['addNewShift'])) { $shift = $_POST['addNewShift']; $time = $_POST['addNewTime']; addSchedule($shift, $time); $id = getScheduleID($shift, $time); echo $id; } elseif (isset($_POST['scheduleID'])) { $id = $_POST['scheduleID']; deleteSchedule($id); } elseif (isset($_POST['addNewFeature'])) { $desc = $_POST['addNewFeature'];
$features[$i]["feature_id"] = 0; $features[$i]["not_like_it"] = 0; $features[$i]["like_it"] = 0; $features[$i] = getFeatureByName($new_features[$i]); if ($features[$i] == NULL) { insertFeature($new_features[$i]); $features[$i]["feature_id"] = $app->lastInsertId(); } echo "<!-- Update like status for the feature. -->\n"; echo "<!-- Like: " . $new_likes[$i] . " -->"; if ($new_likes[$i] == "yes") { $features[$i]["like_it"] += 1; } elseif ($new_likes[$i] == "no") { $features[$i]["not_like_it"] += 1; } updateFeature($features[$i]); echo "<!-- Insert comment -->"; echo "<!-- Comment: " . $new_comments[$i] . " -->"; if ($new_comments[$i] != "none") { $comments[$i]["genre_id"] = NULL; $comments[$i]["review_id"] = NULL; $comments[$i]["survey_id"] = NULL; $comments[$i]["game_id"] = $game_id; $comments[$i]["content"] = $new_comments[$i]; $comments[$i]["feature_id"] = $features[$i]["feature_id"]; insertComment($comments[$i]); } echo "<!-- Link feature with game -->"; if (checkGamesFeatures($game_id, $features[$i]["feature_id"]) == NULL) { linkGamesFeatures($game_id, $features[$i]["feature_id"]); }