<?
session_start();
require_once "../init.php";
require_once "../authority.inc.php";

$OrderID = $_GET['OrderID'];
$key = $_GET['key'];
$op = $_GET['op'];
$backUrl = $_GET['backUrl'];

if(!CheckHashKey('order'.$OrderID, $key)) {
   $DB->close();
   die("非法入侵");
}
$OpArr = array("pay"=>"交费","doit"=>"生效","refund"=>"退款","redo"=>"重复提交","delete"=>"删除");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><?=$OpArr[$op]?>订单</title>
<LINK href="../share/style.css" rel=stylesheet>
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/style.css" />

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<? include "../share/top.php"?>
<table width="100%" border="0" cellpadding="1" cellspacing="1">
  <tr>
    <td><? include "order_nav.inc.php"?></td>
  </tr>
  <tr>
    <td height="3" bgcolor="#555555"></td>
  </tr>
  <tr>
    <td valign="top" align="center">
        <table width="100%"  border="0" cellpadding="5" cellspacing="1" bgcolor="#DDDDDD">
          <tr align="center" bgcolor="#EEEEEE">
            <td><?=$OpArr[$op]?>订单</td>
          </tr>
          <tr bgcolor="#FFFFFF" height="300">
            <td bgcolor="#FFFFFF" align='center'>
			<?
				$order = new Order($OrderID);

				if($op=="delete") $result=$order->Delete();
				if($op=="pay") $result=$order->Pay();
				if($op=="doit") $result=$order->Doit();
				if($op=="refund") $result=$order->Refund();
				if($op=="redo") $result=$order->Redo();
				if($result == 1){
					echo "订单".$OrderID.$OpArr[$op]."成功<br><br>";
					echo $order->Message;
				}else{
					echo $order->ErrorMsg;
				}
				echo "<br><br> <a href='".$backUrl."'>[返回]</a>";
			?>
            </td>
        </table>
     </td>
  </tr>
</table>
<? 
$DB->close();
include "../share/bottom.php";
?>
</body>
</html>