<?php

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


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

switch($act){
    case 'order_pay':
        order_pay();
        break;
    case 'order_send':
        order_send();
        break;
}

function order_pay(){
    $order_number = $_GET['order_number'];
    
    $pay = OOrder::pay($order_number);
    
    if($pay){
        Session::Set('success','订单支付成功！');

    }else{
        Session::Set('error','订单支付失败');
    }
    
}

function order_send(){
    $order_number = $_POST['order_number'];
    $express_no = $_POST['express_no'];
    OOrder::send($order_number,$express_no);
    $order_info = Table::Fetch('order_info', $order_number,'order_number');
    echo state($order_info['state']);
    echo "<br />".$order_info['express_no'];
}?>
