echo "Could not successfully run query ({$sql_final}) from DB: " . mysql_error(); exit; } $data['data'] = array(); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { array_push($data['data'], $row); } mysqli_close($conn); return $data; } $possible_url = array("get_app_list", "get_app", "get_locations", "filter_by"); $value = "An error has occurred"; if (isset($_GET["action"]) && in_array($_GET["action"], $possible_url)) { switch ($_GET["action"]) { case "get_app_list": $value = get_app_list(); break; case "get_app": if (isset($_GET["long"]) && isset($_GET["lat"])) { $value = get_app_by_id(); } else { $value = "Missing argument"; } break; case "get_locations": if (isset($_GET["loc"])) { $value = get_location_autofill($_GET["loc"]); } else { $value = "Missing argument"; } break;
echo delete_user($uid); break; case 'addUser': echo add_user(); break; case 'deliver_privilege': echo deliver_privilege(); break; case 'checkMailCanUse': echo check_mail_can_use(); break; case 'checkPhoneCanUse': echo check_phone_can_use(); break; case 'getAppList': echo get_app_list(); break; case 'changeAppStatus': echo change_app_status(); break; case 'flush': echo flush_app_list(); break; default: break; } } /* * 刷新应用 * @return int 成功返回1 其余返回0 * */