<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
response.Charset="GB2312"
Dim NCheck:NCheck=true
%>
<!--#include file="cgi/Config.asp"-->
<%
Dim id:id=request("id")
if not mobj.testreg(id,"^\d{1,10}$") then response.End()

Dim act:act=request("act")
if act="savenote" then 
	guanliyuanbeizhu=request("guanliyuanbeizhu")
	if guanliyuanbeizhu<>"" then 
		mobj.crs rs
		rs.open "select admin_note from b2c_order_info where order_id="&id,dstr,1,3
		if rs.eof and rs.bof then 
			mobj.drs rs
			mobj.jscheck "订单不存在",1
		else
			rs("admin_note")=guanliyuanbeizhu
			rs.update
			mobj.drs rs
		end if
	end if
end if

mobj.crs rs
rs.open "select * from b2c_order_info where order_id="&id,dstr,1,1
if rs.eof and rs.bof then 
	mobj.drs rs
	response.End()
else
	
	order_status=rs("order_status")
	shipping_status=rs("shipping_status")
	pay_status=rs("pay_status")
	consignee=rs("consignee")
	
	address=rs("address")
	zipcode=rs("zipcode")
	tel=rs("tel")
	mobile=rs("mobile")
	
	best_time=rs("best_time")
	goods_amount=rs("goods_amount")
	
	
	add_time=rs("add_time")
	user_note=rs("user_note")
	pay_id=rs("pay_id")
	p_count=rs("p_count")
	best_time=rs("best_time")
	p_id=rs("p_id")
	p_qid=rs("p_qid")
	userip=rs("userip")
	admin_note=rs("admin_note")
	dinggouma=rs("dinggouma")
	lailu=rs("lailu")
	from_ad=rs("from_ad")
	deltype=rs("deltype")
	isdel=rs("isdel")
	deluser=rs("deluser")
	delusername=rs("delusername")
	deltime=rs("deltime")
	
	mobj.drs rs
	mobj.crs rs
	rs.open "select b2c_goods.g_name,b2c_qudao.q_name from b2c_goods,b2c_qudao where b2c_qudao.q_sn=b2c_goods.g_qudao and   b2c_goods.g_guid='"&p_id&"'",dstr,1,1
	if rs.eof and rs.bof then
		goods_name="此产品已经删除"
	else
		goods_name=rs("g_name")
		q_name=rs("q_name")
	end if
	mobj.drs rs
	
	
	
end if 


%>


<table id="tablehovered" width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableborder">


<tr>
	<th width="5%" noWrap="noWrap">订单基本信息</th>
  </tr>
  
  
<tr>
	<td width="5%" ><table width="100%" border="0" cellspacing="2" cellpadding="0">
	  <tr>
	    <td width="12%" height="30" align="right" bgcolor="#FFFFFF"><strong>订购产品：</strong></td>
	    <td colspan="3" bgcolor="#FFFFFF"><%=q_name%>（<%=goods_name%>）数量:<%=p_count%></td>
	    </tr>
        <tr>
	    <td width="12%" height="30" align="right" bgcolor="#FFFFFF"><strong>收货人：</strong></td>
	    <td colspan="3" bgcolor="#FFFFFF"><%=consignee%></td>
	    </tr>
	  <tr>
	    <td height="30" align="right" bgcolor="#FFFFFF"><strong>地址：</strong></td>
	    <td colspan="3" bgcolor="#FFFFFF"><%=address%>&nbsp;&nbsp;&nbsp;&nbsp;<strong>邮政编码</strong>：<%=zipcode%></td>
	    </tr>
	  <tr>
	    <td height="30" align="right" bgcolor="#FFFFFF"><strong>手机：</strong></td>
	    <td width="33%" bgcolor="#FFFFFF"><%=mobile%></td>
	    <td width="17%" align="right" bgcolor="#FFFFFF"><strong>电话：</strong></td>
	    <td width="38%" bgcolor="#FFFFFF"><%=tel%></td>
	    </tr>
	  <tr>
	    <td height="30" align="right" bgcolor="#FFFFFF"><strong>邮箱：</strong></td>
	    <td bgcolor="#FFFFFF">&nbsp;</td>
	    <td align="right" bgcolor="#FFFFFF"><strong>最佳送货时间：</strong></td>
	    <td bgcolor="#FFFFFF"><%=xmlobj.GetTxt(server.MapPath("/xml/sendType.xml"),best_time)%></td>
	    </tr>
		 <tr>
	    <td height="30" align="right" bgcolor="#FFFFFF"><strong>订单备注：</strong></td>
	    <td colspan="3" bgcolor="#FFFFFF">&nbsp;<%=user_note%></td>
	    </tr>
		 <tr>
	    <td height="30" align="right" bgcolor="#FFFFFF"><strong>下单时间：</strong></td>
	    <td bgcolor="#FFFFFF">&nbsp;<%=add_time%></td>
	    <td align="right" bgcolor="#FFFFFF"><strong>订单IP:</strong></td>
	    <td bgcolor="#FFFFFF">&nbsp;<%=userip%>（<%=GetAddress(userip)%>）</td>
	    </tr>
		
		 <tr>
	    <td height="30" align="right" bgcolor="#FFFFFF"><strong>订购码：</strong></td>
	    <td bgcolor="#FFFFFF">&nbsp;<%=dinggouma%></td>
	    <td align="right" bgcolor="#FFFFFF"><strong>广告来源:</strong></td>
	    <td bgcolor="#FFFFFF">&nbsp;<%=lailu%></td>
	    </tr>
        
		 <tr>
	    <td height="30" align="right" bgcolor="#FFFFFF"><strong>订单总金额：</strong></td>
	    <td bgcolor="#FFFFFF">&nbsp;<%=goods_amount+shipping_fee-bonus%></td>
	    <td align="right" bgcolor="#FFFFFF"><strong>付款方式：</strong></td>
	    <td bgcolor="#FFFFFF"><%=xmlobj.GetTxt(server.MapPath("/xml/payname.xml"),pay_id)%></td>
	    </tr>
    </table></td>
  </tr>


  
  <tr>
	<th width="5%" noWrap="noWrap">管理备注</th>
  </tr>

<tr>
	<td width="5%" ><table width="100%" border="0" cellspacing="2" cellpadding="0">
	
	  <tr>
	    <td height="30" align="right" bgcolor="#FFFFFF"><label>
	      <textarea name="guanliyuanbeizhu" cols="45" rows="3" id="guanliyuanbeizhu"><%=admin_note%></textarea>
	    </label></td>
	    <td width="50%" bgcolor="#FFFFFF"><label></label>
	   
	    <input name="submit" type="button" onClick="saveNote();"  value="保存管理员备注" /></td>
	    </tr>
    </table></td>
  </tr>
  
  <tr>
	<th width="5%" noWrap="noWrap">订单处理</th>
  </tr>

<tr>
	<td width="5%" ><table width="100%" border="0" cellspacing="2" cellpadding="0">
	  <tr>
	    <td height="30" align="center" bgcolor="#FFFFFF">
		
		<%
		if isdel=1 then
		response.Write("订单被【"&delusername&"】在【"&deltime&"】取消&nbsp;&nbsp;&nbsp;取消原因：") 
		response.Write(xmlobj.GetTxt(server.MapPath("/xml/calcel.xml"),deltype))
		else
		 %>
		<%
										select case order_status
											case 0
										%><a href="javascript:sureOrder('<%=id%>');" class="easyui-linkbutton">确认审单</a>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <a href="javascript:deleteorder('<%=id%>');" class="easyui-linkbutton">取消订单</a>&nbsp;&nbsp;&nbsp;&nbsp;
                                         
                                        <%
											case 1
											
											%>
                                        <%if shipping_status= 0 then %>
                                        <a href="javascript:fahuo('<%=id%>');" class="easyui-linkbutton">确认发货</a>
                                        
										
										<%end if%>
										
										 <%if shipping_status= 1 then 
										 
										 if pay_status=0 then 
										 %>
										 
										
                                        <a href="javascript:jiekuan('<%=id%>');" class="easyui-linkbutton">确认结款</a>
                                        
										
										<%
										end if
										end if%>
										
										
                                        &nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:deleteorder('<%=id%>');" class="easyui-linkbutton">取消订单</a>
                                        <%
											case 2
											case 3
											case 4
											case else
										end select
										
										
										end if%></td>
	    </tr>
    </table></td>
  </tr>
  
  

</table>
<div id="dialog_action" style="display:none;">
  <div style="background-color:#FFF;">
    	<table width="400" border="0" cellspacing="5" cellpadding="5">
  <tr>
    <td width="93" height="25" align="right">改价金额：</td>
    <td width="272" align="left"><label for="jiageValue"></label>
      <input type="text" name="textfield" id="jiageValue"  onkeyup="validatePices(this);"  /></td>
  </tr>
  <tr>
    <td height="25" align="right">改价类型：</td>
    <td align="left"><label for="jiageType"></label>
      <select name="select" id="jiageType">
        <option value="0">价格减少</option>
        <option value="1">价格增加</option>
      </select></td>
  </tr>
  <tr>
    <td height="25" align="right">&nbsp;</td>
    <td align="left"><input type="submit" name="button" id="button" value="提交" onclick="SureGaiJia();" /></td>
  </tr>
</table>

  </div>
</div>

