<?php

require_once(dirname(dirname(__FILE__)) . '/app.php');
need_login();


$act = strval($_GET['act']);
if(empty($act)) $act = strval($_POST['act']);

switch($act){
    case 'express_get':
        express_get();
        break;
    case 'cart_del':
        cart_del();
        break;
    case 'cart_modiQuantity':
        cart_modiQuantity();
        break;
    case 'cart_sum':
        cart_sum();
        break;
}

function express_get(){
    $dest = isset($_GET['dest']) ? $_GET['dest'] : $_POST['dest'];
    $src =  isset($_GET['dest']) ? $_GET['src'] : $_POST['src'];
    $provider_id =  isset($_GET['provider_id']) ? $_GET['provider_id'] : $_POST['provider_id'];
    $express = OFare::getExpress($src,$dest);
    $html = "";
    foreach($express as $one){
        $html .= "<input name=\"express[".$provider_id."]\" type=\"radio\" value=\"".$one['id']."\" value1=\"".$one['base']."\" value2=\"".$one['add']."\" onclick=\"check_express(this)\" />";
        $html .= $one['name']."：首重".$one['base']."￥&nbsp;&nbsp;"."续重".$one['add']."￥<br />";
    }
    echo "<form>".$html."</form>";
}?>
