<?php /** * Created by PhpStorm. * User: zhangchaojie * Date: 15/9/18 * Time: 上午10:28 */ require '../tool/ApiHelper.php'; require '../tool/InputHelper.php'; $id = ""; $apiHelper = new ApiHelper(); $apiHelper->log(__FILE__, $_POST); if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_POST["id"] == '') { echo json_encode(array("code" => "1", "msg" => "id is null")); return; } else { $id = input_helper($_POST["id"]); } $apiHelper->productDelete($id); }
<?php /** * Created by PhpStorm. * User: zhangchaojie * Date: 15/9/18 * Time: 上午10:42 */ require '../tool/ApiHelper.php'; require '../tool/InputHelper.php'; $keyword = ""; $apiHelper = new ApiHelper(); $apiHelper->log(__FILE__, $_POST); if ($_SERVER["REQUEST_METHOD"] == "POST") { $keyword = input_helper($_POST["keyword"]); $apiHelper->productQueryByKeyword($keyword); }
} else { $code = input_helper($_POST["code"]); } if ($_POST["count"] == '') { echo json_encode(array("code" => "1", "msg" => "count is null")); return; } else { $count = input_helper($_POST["count"]); } if ($_POST["price"] == '') { echo json_encode(array("code" => "1", "msg" => "price is null")); return; } else { $price = input_helper($_POST["price"]); } if ($_POST["charge"] == '') { echo json_encode(array("code" => "1", "msg" => "charge is null")); return; } else { $charge = input_helper($_POST["charge"]); } if (!is_numeric($count) || $count < 0) { echo json_encode(array("code" => "1", "msg" => "count is illegal")); return; } if (!is_float($price) && !is_numeric($price) || $price < 0) { echo json_encode(array("code" => "1", "msg" => "price is illegal")); return; } $apiHelper->deliveryAdd($orderid, $name, $code, $count, $price, $charge); }
<?php /** * Created by PhpStorm. * User: zhangchaojie * Date: 15/9/18 * Time: 上午10:43 */ require '../tool/ApiHelper.php'; require '../tool/InputHelper.php'; $id = ""; $apiHelper = new ApiHelper(); $apiHelper->log(__FILE__, $_POST); if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_POST["code"] == '') { echo json_encode(array("code" => "1", "msg" => "code is null")); return; } else { $code = input_helper($_POST["code"]); } $apiHelper->productQueryByCode($code); }
$code = input_helper($_POST["code"]); } if ($_POST["max"] == '') { echo json_encode(array("code" => "1", "msg" => "max is null")); return; } else { $max = input_helper($_POST["max"]); } if ($_POST["min"] == '') { echo json_encode(array("code" => "1", "msg" => "min is null")); return; } else { $min = input_helper($_POST["min"]); } $supplider = input_helper($_POST["supplider"]); $phone = input_helper($_POST["phone"]); $count = input_helper($_POST["count"]); if (!is_numeric($min) || $min < 0) { echo json_encode(array("code" => "1", "msg" => "min is illegal")); return; } if (!is_numeric($max) || $max < $min) { echo json_encode(array("code" => "1", "msg" => "max is illegal")); return; } if (!is_numeric($count) || $count < $min || $count > $max) { echo json_encode(array("code" => "1", "msg" => "count is illegal")); return; } $apiHelper->productChange($id, $name, $code, $count, $supplider, $phone, $max, $min); }
$version = ""; //log_helper(__FILE__, $_POST); $apiHelper = new ApiHelper(); $apiHelper->log(__FILE__, $_POST); if ($_SERVER["REQUEST_METHOD"] == "POST") { //强行升级策略 error_reporting(E_ALL ^ E_NOTICE); if ($_POST["version"] == '') { echo json_encode(array("code" => "1", "msg" => "Beta 1、Beta2版本已废弃,请手动更新最新版本")); return; } if ($_POST["account"] == '') { echo json_encode(array("code" => "1", "msg" => "account is null")); return; } else { $account = input_helper($_POST["account"]); } if ($_POST["password"] == '') { echo json_encode(array("code" => "1", "msg" => "password is null")); return; } else { $password = input_helper($_POST["password"]); } $apiHelper->login($account, $password); } function input_helper($data) { $data = stripslashes($data); $data = htmlspecialchars($data); return $data; }
if ($_POST["count"] == '') { $count = 0; } else { $count = input_helper($_POST["count"]); } if ($_POST["max"] == '') { echo json_encode(array("code" => "1", "msg" => "max is null")); return; } else { $max = input_helper($_POST["max"]); } if ($_POST["min"] == '') { echo json_encode(array("code" => "1", "msg" => "min is null")); return; } else { $min = input_helper($_POST["min"]); } if (!is_numeric($min) || $min < 0) { echo json_encode(array("code" => "1", "msg" => "min is illegal")); return; } if (!is_numeric($max) || $max < $min) { echo json_encode(array("code" => "1", "msg" => "max is illegal")); return; } if (!is_numeric($count) || $count < $min || $count > $max) { echo json_encode(array("code" => "1", "msg" => "count is illegal")); return; } $apiHelper->productAdd($name, $code, $count, $supplider, $phone, $max, $min); }