if ($action == "empty") {
     clearProduct($rowid);
     //清空列表
 } else {
     if ($action == "del") {
         delProduct($id);
         //删除产品
     } else {
         if ($action == "updatePrice") {
             $price = $_GET["price"];
             updateProductPrice($id, $price);
             //更新产品价格
         } else {
             if ($action == "updateAmount") {
                 $amount = $_GET["amount"];
                 updateProductAmount($id, $amount);
                 //更新产品数量
             } else {
                 if ($action == "updateZhekou") {
                     $zhekou = $_GET["zhekou"];
                     updateProductZhekou($id, $zhekou);
                     //更新产品数量
                 } else {
                     if ($action == "updateMoney") {
                         $jine = $_GET["jine"];
                         updateProductJine($id, $jine);
                         //更新产品数量
                     } else {
                         if ($action == "updateMemo") {
                             $beizhu = $_GET["beizhu"];
                             updateProductBeizhu($id, $beizhu);
Пример #2
0
<?php

include_once '../include/headers.php';
include_once '../include/dbutils.php';
include_once '../include/main.php';
include_once 'domain/orders.php';
db_connect();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $request_payload = file_get_contents('php://input');
    //var_dump($request_payload);
    $json = json_decode($request_payload);
    if (isset($_GET['update'])) {
        $value = updateInfo($json);
    } else {
        if (isset($_GET['validate'])) {
            $value = validate($json);
        } else {
            if (isset($_GET['updateProductAmount'])) {
                $value = updateProductAmount($json);
            } else {
                $value = changeStatus($json);
            }
        }
    }
    //return JSON array
    exit(json_encode($value));
}