コード例 #1
0
ファイル: ajax.php プロジェクト: itri980112/dashboard
            echo '{"status":"ERROR","data":{"reason":"already existed","code":1}}';
        }
    }
    if ($json['type'] == "deleteStarBrand") {
        $d = $json['data'];
        if (checkStarBrand($conn, $_SESSION['user_id'], $d['bid']) > 0) {
            deleteStarBrand($conn, $_SESSION['user_id'], $d['bid']);
            echo '{"status":"OK","data":{"code":0}}';
        } else {
            echo '{"status":"ERROR","data":{"reason":"the star brand doesn\'t exist","code":1}}';
        }
    }
    if ($json['type'] == "addStarStore") {
        $d = $json['data'];
        if (checkStarStore($conn, $_SESSION['user_id'], $d['store_id']) == 0) {
            addStarStore($conn, $_SESSION['user_id'], $d['store_id']);
            echo '{"status":"OK","data":{"code":0}}';
        } else {
            echo '{"status":"ERROR","data":{"reason":"already existed","code":1}}';
        }
    }
    if ($json['type'] == "deleteStarStore") {
        $d = $json['data'];
        if (checkStarStore($conn, $_SESSION['user_id'], $d['store_id']) > 0) {
            deleteStarStore($conn, $_SESSION['user_id'], $d['store_id']);
            echo '{"status":"OK","data":{"code":0}}';
        } else {
            echo '{"status":"ERROR","data":{"reason":"the star store doesn\'t exist","code":1}}';
        }
    }
}
コード例 #2
0
ファイル: ajax.php プロジェクト: kaogaau/Dashboard
            echo '{"status":"ERROR","data":{"reason":"already existed","code":1}}';
        }
    }
    if ($json['type'] == "deleteStarBrand") {
        $d = $json['data'];
        if (checkStarBrand($conn, $d['uid'], $d['bid']) > 0) {
            deleteStarBrand($conn, $d['uid'], $d['bid']);
            echo '{"status":"OK","data":{"code":0}}';
        } else {
            echo '{"status":"ERROR","data":{"reason":"the star brand doesn\'t exist","code":1}}';
        }
    }
    if ($json['type'] == "addStarStore") {
        $d = $json['data'];
        if (checkStarStore($conn, $d['uid'], $d['store_id']) == 0) {
            addStarStore($conn, $d['uid'], $d['store_id']);
            echo '{"status":"OK","data":{"code":0}}';
        } else {
            echo '{"status":"ERROR","data":{"reason":"already existed","code":1}}';
        }
    }
    if ($json['type'] == "deleteStarStore") {
        $d = $json['data'];
        if (checkStarStore($conn, $d['uid'], $d['store_id']) > 0) {
            deleteStarStore($conn, $d['uid'], $d['store_id']);
            echo '{"status":"OK","data":{"code":0}}';
        } else {
            echo '{"status":"ERROR","data":{"reason":"the star store doesn\'t exist","code":1}}';
        }
    }
}