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

if($_POST['OrderID']!='')
{
	$OrderID = $_POST['OrderID'];
}
else
{
	$OrderID = $_GET['OrderID'];
}
 



?>




<link href="/skin/chahua2932/resources/css/constyle.css" type="text/css" rel="stylesheet" />



<div id="main">
<div class="inner">
	<div class="left"></div>
	
	<div class="right">
	    <ul class="maintitle">
			<li id="mainlink"><img src="/admin/share/up.png" align="absmiddle">确认收货 </li>
			<li class="tar"><a   href="javascript:location.replace(location.href);" title="刷新" >刷新本页</a> </li>
		</ul>
		<form method='post' action='../user/order_list.php'>
			快速搜索：<input type="text" name="keyword" class="inputbox">
		    <input type="submit" value="搜索" class="btn2">
			<span>
			   <a href='../user/order_list.php'>所有订单</a> -
			   <a href='../user/order_list.php?iStatus=1'>已交费</a> -
			   <a href='../user/order_list.php?iStatus=2'>已发货</a> -
			      <a href='../user/order_list.php?iStatus=3'>已完成</a> -
			   <a href='../user/order_list.php?iStatus=0'>不生效订单</a>
			</span>
		</form>
		
		<?




/****** 订单信息 ******/

	$sql="select * from `order` where OrderID='$OrderID'";
	$result=$DB->query($sql);
	$row=$DB->fetch_array($result);
	$dkey = GetHashKey('order'.$row[OrderID]);
	$ukey = GetHashKey('users'.$row[UserName]);


$UserName=$_SESSION['User_S'];

if($row[UserName] != $UserName){
 die("该订单不存在!非法操作!");
}
elseif($row[iStatus]==3)
{
 die("订单已完成,非法操作!");

}
else
{




$sql="update `order` set iStatus='3' where OrderID=$OrderID";
		  $DB->query($sql);
		  echo "<center><br><br>订单  <font color='blue'> $OrderID  </font>操作成功";
		  echo "<br><br><br>  <a href='/user/order_list.php'>返回</a></center>";
}

//输出


$db->close();
?>
 
	</div>


</div>
</div>

