예제 #1
0
파일: add.php 프로젝트: ASSASSINOR/WMS
    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);
}