Example #1
0
        } else {
            if ($action == "unblock") {
                $visit_date = array_number4key($_GET, "vdate");
                $err = srvc_book_unblock($visit_date);
            } else {
                if ($action == "query_block") {
                    $err = srvc_book_query_block(7 * 4, $result_arr);
                } else {
                    if ($action == "blockts") {
                        $visit_date = array_number4key($_GET, "vdate");
                        $visit_ts = array_number4key($_GET, "ts");
                        $err = srvc_book_block_timeslot($visit_date, $visit_ts);
                    } else {
                        if ($action == "unblockts") {
                            $visit_date = array_number4key($_GET, "vdate");
                            $visit_ts = array_number4key($_GET, "ts");
                            $err = srvc_book_unblock_timeslot($visit_date, $visit_ts);
                        } else {
                            // NO_IMPL
                            $err = BOOK_CODE_ERR_INVALID;
                        }
                    }
                }
            }
        }
    }
}
if (!IS_BOOK_OK($err)) {
    $trade_token = "";
    goto ERROR;
}
Example #2
0
    }
}
// by default, try to pay by wx
define("TOO_WX_PRICE_PER_PERSON_SMALL", 18800);
define("TOO_WX_PRICE_PER_PERSON_MED", 21800);
define("TOO_WX_PRICE_PER_PERSON_BIG", 25800);
define("TOO_WX_PRICE_PER_PERSON_DEFAULT", 100);
$count = $_GET["count"] + 0;
$discount_rate = 0.95;
$visit_day = $_GET["visit_day"];
$time_slot = $_GET["time_slot"];
$phone = $_GET["phone"];
$ttoken = $_GET["ttoken"];
$small_board = array_number4key($_GET, "small_b");
$medium_board = array_number4key($_GET, "medium_b");
$large_board = array_number4key($_GET, "large_b");
$board_count = $small_board + $medium_board + $large_board;
$small_price = TOO_WX_PRICE_PER_PERSON_SMALL;
$medium_price = TOO_WX_PRICE_PER_PERSON_MED;
$large_price = TOO_WX_PRICE_PER_PERSON_BIG;
$js_pay = "";
if ($count > 0 && $board_count > 0 && $small_price > 0 && $medium_price > 0 && $large_price > 0 && strlen($ttoken) > 16) {
    $total = $small_price * $small_board + $medium_price * $medium_board + $large_price * $large_board;
    // any discount?
    $total *= $discount_rate;
    $param = array("C" => "{$count}", "T" => "{$total}", "VD" => "{$visit_day}", "TS" => "{$time_slot}", "BS" => "{$small_board}", "BM" => "{$medium_board}", "BL" => "{$large_board}", "PH" => "{$phone}");
    $json = json_encode($param);
    // X大Y中Z小
    $board_tips = "";
    if ($large_board > 0) {
        $board_tips = $board_tips . "{$large_board}" . "大";