<!--#include file="conn.asp"--><%seo_title="Orders-"&sitename%>
<!--#include file="IncAsp/WrzcNethtml_top.asp"-->
<!-- #include file="IncAsp/WrzcNethtml_md5.asp" -->
<!--#include file="IncAsp/all_pay.asp"-->
<div align="center">
<table cellpadding="0" cellspacing="0" class="all_t1">
<tr><td class="all_l_td" valign="top">
<!--#include file="IncAsp/WrzcNethtml_log.asp"--><div class="d5"></div>
</td>
<td valign="top" class="all_c_td">

<%chkid(request("sub_id"))
if Request.Cookies("WrzcNethtml")("user_name")="" and Request.Cookies("WrzcNethtml")("guest")="" then
response.redirect "login.asp?comurl=orders.asp"
response.end
elseif Request.Cookies("WrzcNethtml")("user_name")<>"" then
user_name=Request.Cookies("WrzcNethtml")("user_name")
elseif Request.Cookies("WrzcNethtml")("guest")<>"" then
user_name=Request.Cookies("WrzcNethtml")("guest")
end if


if request("action")="zt" then
	sub_zt=request("sub_zt")
	if sub_zt<>"" then
		set rs=server.createobject("adodb.recordset")
		sql="select * from WrzcNethtml_sub where sub_name='"&user_name&"' and sub_id="&request("sub_id")
		rs.open sql,conn,1,3
		if rs.eof then
			response.write "Error!"
			response.end
		else
			if request("sub_zt")<=2 then
			rs("sub_zt")=sub_zt
				rs("sub_zt"&sub_zt)=DelStr(request("sub_zti"))
				rs("sub_date"&sub_zt)=now()
			end if
			rs.update
			response.redirect "submore.asp?sub_id="&request("sub_id")
			response.end
		end if
		rs.close
		set rs=nothing
	else
		response.redirect "submore.asp?sub_id="&request("sub_id")
		response.end
	end if
elseif request("action")="del" then
	set rs=server.createobject("adodb.recordset")
	sql="select * from WrzcNethtml_sub where sub_name='"&user_name&"' and sub_zt=0 and sub_id="&request("sub_id")
	rs.open sql,conn,1,3
	sub_number=rs("sub_number")
	rs.delete
	rs.update
	rs.close
	set rs=nothing
	set rs=server.createobject("adodb.recordset")
	sql="select * from WrzcNethtml_basket where sub_number='"&sub_number&"'"
	rs.open sql,conn,1,3
	do while not rs.eof 
	rs.delete
	rs.movenext
	loop
	rs.close
	set rs=nothing
	response.write "Done. <a href='javascript:window.close()'><font color=#ff0000>Close window.</font></a> "
	response.end
end if


set rs=server.createobject("adodb.recordset")
sql="select * from WrzcNethtml_sub where sub_name='"&user_name&"' and sub_id="&request("sub_id")
rs.open sql,conn,1,1
if rs.eof then
response.write "Error!"
response.end
rs.close
set rs=nothing
end if
user_name=rs("sub_name")
zt=rs("sub_zt")
sub_number=rs("sub_number")
zp_id=rs("zp_id")
zp_name=rs("zp_name")
zp_price=rs("zp_price")
zp_full=rs("zp_full")
sub_yunfei=rs("sub_yunfei")
sub_fapiao=rs("sub_fapiao")
sub_psname=rs("sub_psname")
usertype_name=rs("sub_usertype")
zhekou=rs("sub_zhekou")
if zhekou=100 then
zhekouyu="You Save:0%"
else
zhekouyu="You Save:"&zhekou&"%"
end if
quan_id=rs("quan_id")
quan_cash=rs("quan_cash")
quan_man=rs("quan_man")
quan_no=rs("quan_no")
quan_pass=rs("quan_pass")

fuhao=rs("fuhao")
hui=rs("hui")
danwei=rs("danwei")
bizhong=rs("bizhong")
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="useri"><tr> 
<td colspan="6" class="cartshowa">Order Number:<font color="#FF0000"><%=rs("sub_number")%><%sub_number=rs("sub_number")%></font>&nbsp;&nbsp;
Date:<font color="#808080"><%=rs("sub_date")%></font>&nbsp;&nbsp;
UserName:<%=rs("sub_name")%></td></tr>
<tr><td colspan="6" class="cartshow1">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td height="23">State:</td>
<td width="150" height="23"><%if rs("sub_zt")=0 then response.write "Invalid"%>
<%if rs("sub_zt")=1 then response.write "New Order"%>
<%if rs("sub_zt")=-1 then response.write "Waitting payment"%>
<%if rs("sub_zt")=2 then response.write "Payment Already"%>
<%if rs("sub_zt")=3 then response.write "Payment Receipted"%>
<%if rs("sub_zt")=4 then response.write "In Transit"%>
<%if rs("sub_zt")=5 then response.write "Finished"%>
<%i=rs("sub_zt")%></td>
<td height="23">Date:</td>
<td height="23" width="200"><%=rs("sub_date")%></td></tr>
<%if rs("sub_zt0")<>"" and rs("sub_date0")<>"" then%>
<tr><td height="23">Invalidate Time:</td><td width="150" height="23"><%=rs("sub_date0")%></td><td height="23">Description:</td><td height="23" width="200"><%=rs("sub_zt0")%></td></tr>
<%end if%>
<%if rs("sub_zt1")<>"" and rs("sub_date1")<>"" then%>
<tr><td height="23">Verify Time:</td><td width="150" height="23"><%=rs("sub_date1")%></td><td height="23">Description:</td><td height="23" width="200"><%=rs("sub_zt1")%></td></tr>
<%end if%>
<%if rs("sub_zt2")<>"" and rs("sub_date2")<>"" then%>
<tr><td height="23">Pay Time:</td><td width="150" height="23"><%=rs("sub_date2")%></td><td height="23">Description:</td><td height="23" width="200"><%=rs("sub_zt2")%></td></tr>
<%end if%>
<%if rs("sub_zt3")<>"" and rs("sub_date3")<>"" then%>
<tr><td height="23">Receipted Time:</td><td width="150" height="23"><%=rs("sub_date3")%></td><td height="23">Description:</td><td height="23" width="200"><%=rs("sub_zt3")%></td></tr>
<%end if%>
<%if rs("sub_zt4")<>"" and rs("sub_date4")<>"" then%>
<tr><td height="23">Shipping Time:</td><td width="150" height="23"><%=rs("sub_date4")%></td><td height="23">Description:</td><td height="23" width="200"><%=rs("sub_zt4")%></td></tr>
<%end if%>
<%if rs("sub_zt5")<>"" and rs("sub_date5")<>"" then%>
<tr><td height="23">Arrival time:</td><td width="150" height="23"><%=rs("sub_date5")%></td><td height="23">Description:</td><td height="23" width="200"><%=rs("sub_zt5")%></td></tr>
<%end if%>
</table>

<%if rs("sub_zt")<=1 then%>
<table border="0" cellspacing="0" cellpadding="0">
<form method="POST" name="myform" action="submore.asp?sub_id=<%=rs("sub_id")%>&action=zt" onsubmit="return checkForm()"><tr><td width="0">Modify:</td>
<td width="150">
	<%if rs("sub_zt")=1 or rs("sub_zt")=-1 then%>
		<select size="1" name="sub_zt" onChange="(clsm.innerHTML=this.options[this.selectedIndex].ids)">
		<option value="" ids="Description:">Change None</option>
		<option value="0" ids="Description:">Invalidate</option>
		<option value="2" ids="Payment time & way?:">Payment</option>
		</select>
		<%elseif rs("sub_zt")=0 then%>
		<select size="1" name="sub_zt" onChange="(clsm.innerHTML=this.options[this.selectedIndex].ids)">
		<option value="" ids="Description:">Change None</option>
		<option value="1" ids="Description:">validate</option>
		</select>
	<%end if%>
	</td>
	<td width="0" colspan="3"><span id="clsm">Description:</span></td>
	<td width="0" colspan="3"><input type="text" name="sub_zti" size="30" class=input></td>
	<td width="0"><input type="submit" value="Submit" name="submit1"></td></tr>
</form></table>
<script>
function checkForm()
{
	var selectedValue = document.all.myform.sub_zt.value;
	if (selectedValue == "")
		{
		alert("Please Select!");
		return false;
		}
}
</script>
<%end if%>
</td></tr>
<tr><td colspan="6" class="cartshowa">Name:<b><%=rs("sub_to")%></b></td></tr>
<tr><td colspan="6" class="cartshow1"><table border="0" width="600" cellspacing="0" cellpadding="0" id="table1">
<tr><td height="23" width="65%">Address:<%=rs("sub_adds")%> (<%=rs("sub_city")%>,<%=rs("sub_state")%>,<%=rs("sub_country")%>)</td>
	<td height="23">Postcode:<%=rs("sub_post")%></td></tr>
<tr><td height="23" width="65%">Email:<%=rs("sub_mail")%></td>
	<td height="23">Phone number:<%=rs("sub_tel")%></td></tr>
</table></td></tr>
<tr><td height="20" colspan="6" class="cartshowa">Payment:<%=rs("sub_payname")%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Shipping:<%=rs("sub_psname")%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Arrival date:<%=rs("sub_totime")%></td></tr>
<tr><td height="20" colspan="6" class="cartshow1"><table border="0" width="600" cellspacing="0" cellpadding="0" id="table1">
<%if fapiao=1 then%>
<tr><td height="20" width="50%">Invoice:<%if rs("sub_fapiao")=1 then%>Yes(Company:<%=rs("sub_taitou")%>)<%else%>No<%end if%></td></tr>
<%end if%>
<tr><td height="20" width="50%">Out of stock:<%if rs("sub_quehuo")=1 then%>Wait<%else%>Delete<%end if%></td></tr>
<tr><td height="20">Message:<%=rs("sub_other")%></td></tr></table></td></tr>
<tr><td colspan="6" class="cartshowa"> <b>Products</b></td></tr>
<tr><td align="center" class="cartshow0">Product</td>
	<td align="center" class="cartshow0">Price</td>
	<td align="center" class="cartshow0">Qty</td>
	<td align="center" class="cartshow0">Type</td>
	<td align="center" class="cartshow0">Total</td>
	<td align="center" class="cartshow0">Modify</td></tr>
<%set rsp=server.createobject("adodb.recordset")
sql="select * from WrzcNethtml_basket where sub_number='"&sub_number&"' and user_name='"&user_name&"' and basket_check=1"
rsp.open sql,conn,1,1
if rsp.eof then%>
<tr bgcolor="#FFFFFF"><td colspan="6" class="cartshow1" height="20"> <p align="center">No Data</p></td></tr>
<%else
i=0
do while not rsp.eof
i=i+1
%>
<tr><td align="center" class="cartshow<%=i mod 2%>">
	<a target="_blank" href="Product/Pro<%=rsp("hw_id")%>.html"><%=rsp("hw_name")%></a></td>
  <td align="center" class="cartshow<%=i mod 2%>"><%=fuhao%> <%=FormatNum(rsp("hw_price")*hui)%> <%=danwei%></td>
  <td align="center" class="cartshow<%=i mod 2%>"><%=rsp("basket_count")%></td>
  <td align="center" class="cartshow<%=i mod 2%>"><%=rsp("kxa")%>-<%=rsp("kxb")%></td>
  <td align="center" class="cartshow<%=i mod 2%>"><%=fuhao%> <%=FormatNum(rsp("basket_count")*rsp("hw_price")*hui)%><%=danwei%></td>
  <td align="center" class="cartshow<%=i mod 2%>"></td></tr>
<%totalcash=totalcash+rsp("hw_price")*rsp("basket_count")*hui
totaljifen=totaljifen+rsp("hw_jifen")*rsp("basket_count")
totalw=totalw+(rsp("basket_count")*trim(rsp("hw_weight")))
totaly=totaly+(rsp("basket_count")*trim(rsp("hw_yunfei")))
totalc=totalc+rsp("basket_count")
rsp.movenext
loop
rsp.close
set rsp=nothing%>

<%if totalcash*zhekou/100>=zp_full and zp_id>0 then
i=i+1%>
<tr><td align="center" class="cartshow<%=i mod 2%>">
	<a target="_blank" href="viewzp.asp?zp_id=<%=zp_id%>"><%=zp_name%></a></td>
  <td align="center" class="cartshow<%=i mod 2%>"><%=fuhao%> 0 <%=danwei%></td>
  <td align="center" class="cartshow<%=i mod 2%>">1</td>
  <td align="center" class="cartshow<%=i mod 2%>">Gift</td>
  <td align="center" class="cartshow<%=i mod 2%>"><%=fuhao%> 0 <%=danwei%></td>
  <td align="center" class="cartshow<%=i mod 2%>"></td></tr>
<%end if%>
<tr><td colspan="6" align="right" class="cartshow1">
<p style="line-height: 200%; margin-left:5px; margin-right:15px; margin-top:5px; margin-bottom:5px">
Total:<span class="price"><%=totalc%></span>&nbsp;Price:<span class="price"><%=fuhao%><%=FormatNum(totalcash)%><%=danwei%></span>&nbsp;&nbsp;
<font color="#0000FF"><%=usertype_name%></font>(<%=zhekouyu%>)<br>
Shipping:<%=sub_psname%>&nbsp;&nbsp;Shipping Fee:<%=fuhao%><%=sub_yunfei*hui%><%=danwei%><br>
<%if quan_id<>0 and quan_cash<>0 then%>
Discount Voucher(<%=quan_no%>) Save:<%=fuhao%><%=quan_cash*hui%><%=danwei%><br>
<%end if%>

Subtotal:<%totalcash=checkshui(totalcash*zhekou/100+sub_yunfei*hui-quan_cash*hui,shuidian,sub_fapiao)%><span class="price"><%=fuhao%> <%=FormatNum(totalcash)%> <%=danwei%></span>
<%if rs("sub_fapiao")=1 then%>
(Need Invoice Add <%=shuidian%>%)
<%end if%>
&nbsp;&nbsp;
You Score:<%=totaljifen%>
</p>
<%if rs("sub_zt")<=2 then%>
<!--#include file="IncAsp/WrzcNethtml_inpay.asp"-->
<%end if%>
</td></tr>
<tr><td colspan="6" align="center" class="cartshow0">
<%if zt=0 then%><a href="submore.asp?sub_id=<%=request("sub_id")%>&action=del">Delete</a><%end if%>&nbsp;&nbsp;
<a target="_blank" href="print.asp?sub_id=<%=request("sub_id")%>">Print</a></td></tr>
<%end if%>
</table>

<%rs.close
set rs=nothing%>

</td></tr></table></div>
<!--#include file="IncAsp/WrzcNethtml_copy.asp"-->