<!-- #include virtual = "/include/myopen.asp" -->
<%
	set RS = Server.CreateObject("ADODB.RecordSet")
	set RS1 = Server.CreateObject("ADODB.RecordSet")
	set RS2 = Server.CreateObject("ADODB.RecordSet")
%>
<%'判断用户是否登陆过
	IF Request.Cookies ("Admin_name") = "" OR Request.Cookies ("Admin_Pass") ="" THEN
	'没有登陆
	Response.Redirect ("/manage/Admin_Login.ASP")
	END IF
	IF REQUEST("HOME") <> "" THEN
	Response.Redirect ("/manage/default.asp")
	END IF

	DIM LK(500)
'删除
IF REQUEST("DEL") <> "" THEN
	PageNo = Request("PageNo1")
	CAOZUO = TRIM(REQUEST("CAOZUO"))
	POP = INSTR(CAOZUO,",")
		I = 0
		WHILE POP >0
			LK(I) = TRIM(MID(CAOZUO,1,POP-1))
			CAOZUO = TRIM(MID(CAOZUO,POP+1))
			POP=INSTR(CAOZUO,",")
			I = I + 1
		WEND
		LK(I)=TRIM(MID(CAOZUO,1))
	FOR J = 0 TO I
	'删除记录
				SQL = "DELETE * FROM ORDER_NAME WHERE ORDER_NO = '" & LK(J) & "'"
				CONN.Execute (SQL)
		
	NEXT
	Response.Redirect ("order_name.asp?PageNo=" & PageNo1 & "&search=all&order_no=" & request("order_no") & "&user_name=" & request("user_name") & "&true_name=" & request("true_name") & "&order_date1=" & request("order_date1") & "&order_date2=" & request("order_date2") & "")

END IF

'确认定单

IF REQUEST("SEND") <> "" THEN
	PageNo = Request("PageNo1")
	CAOZUO = TRIM(REQUEST("CAOZUO"))
	POP = INSTR(CAOZUO,",")
		I = 0
		WHILE POP >0
			LK(I) = TRIM(MID(CAOZUO,1,POP-1))
			CAOZUO = TRIM(MID(CAOZUO,POP+1))
			POP=INSTR(CAOZUO,",")
			I = I + 1
		WEND
		LK(I)=TRIM(MID(CAOZUO,1))
	FOR J = 0 TO I
	'删除记录
				SQL = "UPDATE ORDER_NAME SET SEND_STATUS = '收到' WHERE ORDER_NO = '" & LK(J) & "'"
				CONN.Execute (SQL)
				'发送邮件
		'			SQL1 = "SELECT * FROM ORDER_NAME WHERE ORDER_NO = '" & LK(J) & "'"
		'			RS1.Open SQL1,CONN,adOpenKeyset,adLockReadOnly
		'			IF RS1.RecordCount >0 THEN
		'				USER_NAME = RS1("USER_NAME")
		'				TURE_NAME = RS1("TURE_NAME")
		'				ORDER_DATE = RS1("ORDER_DATE")
		'				MONEY_NUM = RS1("MONEY_NUM")
		'				PAY_MODE = RS1("PAY_MODE")
		'			END IF
		'			RS1.Close 
		'			SQL2 = "SELECT EMAIL FROM MEMBER WHERE USER_NAME = '" & USER_NAME & "'"
		'			RS1.Open SQL2,CONN,adOpenKeyset ,adLockReadOnly
		'				YMEMAIL = RS1("EMAIL")
		'			RS1.Close 
		'Set myMail = Server.CreateObject("CDONTS.NewMail")
		'myMail.From = "webmaster@e24time.com"
		'myMail.To = YMEMAIL
		'myMail.Subject = "您的定单：" & LK(J) & "的汇款已经收到！请等待我们的"
		'Abody="订单号码： " & LK(J) & chr(13)
		'			Abody=Abody & "会员编号：" & USER_NAME & chr(13)
		'			Abody=Abody & "会员名称：" & TURE_NAME & chr(13)
		'			Abody=Abody & "总计价格：" & MONEY_NUM & "元" & CHR(13)
		'			Abody=Abody & "订购日期：" & ORDER_DATE & CHR(13)
		'			Abody=Abody & "付款状态：" & PAY_MODE & CHR(13)
		'			Abody=Abody & "请查收您的商品，具体商品详细清单请到网站查询！查询地址为：http://www.e24time.com/member/" & CHR(13)
		'			Abody=Abody & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13)
		'			Abody=Abody & "易丽公司 " & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13)
		'myMail.Body = ABody
		'myMail.Send
				
						
	NEXT
	Response.Redirect ("order_name.asp?PageNo=" & PageNo1 & "&search=all&order_no=" & request("order_no") & "&user_name=" & request("user_name") & "&true_name=" & request("true_name") & "&order_date1=" & request("order_date1") & "&order_date2=" & request("order_date2") & "")

END IF
'确认定单

IF REQUEST("SEND1") <> "" THEN
	PageNo = Request("PageNo1")
	CAOZUO = TRIM(REQUEST("CAOZUO"))
	POP = INSTR(CAOZUO,",")
		I = 0
		WHILE POP >0
			LK(I) = TRIM(MID(CAOZUO,1,POP-1))
			CAOZUO = TRIM(MID(CAOZUO,POP+1))
			POP=INSTR(CAOZUO,",")
			I = I + 1
		WEND
		LK(I)=TRIM(MID(CAOZUO,1))
	FOR J = 0 TO I
	'删除记录
				SQL = "UPDATE ORDER_NAME SET SEND_STATUS1 = '已发货' WHERE ORDER_NO = '" & LK(J) & "'"
				CONN.Execute (SQL)
				'发送邮件
		'			SQL1 = "SELECT * FROM ORDER_NAME WHERE ORDER_NO = '" & LK(J) & "'"
		'			RS1.Open SQL1,CONN,adOpenKeyset,adLockReadOnly
		'			IF RS1.RecordCount >0 THEN
		'				USER_NAME = RS1("USER_NAME")
		'				TURE_NAME = RS1("TURE_NAME")
		'				ORDER_DATE = RS1("ORDER_DATE")
		'				MONEY_NUM = RS1("MONEY_NUM")
		'				PAY_MODE = RS1("PAY_MODE")
		'			END IF
		'			RS1.Close 
		'			SQL2 = "SELECT EMAIL FROM MEMBER WHERE USER_NAME = '" & USER_NAME & "'"
		'			RS1.Open SQL2,CONN,adOpenKeyset ,adLockReadOnly
		'				YMEMAIL = RS1("EMAIL")
		'			RS1.Close 
		'Set myMail = Server.CreateObject("CDONTS.NewMail")
		'myMail.From = "webmaster@e24time.com"
		'myMail.To = YMEMAIL
		'myMail.Subject = "您的定单：" & LK(J) & "的商品已经发出！请查收"
		'Abody="订单号码： " & LK(J) & chr(13)
		'			Abody=Abody & "会员编号：" & USER_NAME & chr(13)
		'			Abody=Abody & "会员名称：" & TURE_NAME & chr(13)
		'			Abody=Abody & "总计价格：" & MONEY_NUM & "元" & CHR(13)
		'			Abody=Abody & "订购日期：" & ORDER_DATE & CHR(13)
		'			Abody=Abody & "付款状态：" & PAY_MODE & CHR(13)
		'			Abody=Abody & "请查收您的商品，具体商品详细清单请到网站查询！查询地址为：http://www.e24time.com/member/" & CHR(13)
		'			Abody=Abody & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13)
		'			Abody=Abody & "易丽公司 " & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13) & CHR(13)
		'myMail.Body = ABody
		'myMail.Send
				
						
	NEXT
	Response.Redirect ("order_name.asp?PageNo=" & PageNo1 & "&search=all&order_no=" & request("order_no") & "&user_name=" & request("user_name") & "&true_name=" & request("true_name") & "&order_date1=" & request("order_date1") & "&order_date2=" & request("order_date2") & "")

END IF


'查询定单
IF REQUEST("SEARCH") <> "" THEN	
	IF REQUEST("ORDER_NO") <> "" THEN
		AA = " AND ORDER_NO = '" & REQUEST("ORDER_NO") & "' "
	END IF
	IF REQUEST("ORDER_DATE1") <> "" THEN
		BB = " AND ORDER_DATE >= #" & REQUEST("ORDER_DATE1") & "# "
	END IF
	IF REQUEST("ORDER_DATE2") <> "" THEN
		CC = " AND ORDER_DATE < #" & REQUEST("ORDER_DATE2") & "# "
	END IF
	IF REQUEST("USER_NAME") <> "" THEN
		DDD = " AND USER_NAME = '" & REQUEST("USER_NAME") & "' "
	END IF
	IF REQUEST("TRUE_NAME") <> "" THEN
		EE = " AND TURE_NAME = '" & REQUEST("TRUE_NAME") & "' "
	END IF
	
		SQL = "SELECT * FROM ORDER_NAME WHERE ORDER_NO <> ''" & AA & BB & CC & DDD & EE & " ORDER BY ORDER_NO DESC"
		RS.Open SQL,CONN,adOpenKeyset ,adLockReadOnly
		IF RS.RecordCount >0 THEN
%>
<html>
<head>
<title>订单查询结果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.height {  line-height: 0.5pt}
td {  }
.word {  font-size: 9pt; color: #FFFFFF}
a:hover {  color: #CCFFCC; text-decoration: underline}
a {  text-decoration: none; color: #000066}
.border {  border-color: black #FF3300 black black; border-style: solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px}
-->
</style>
</head>

<body bgcolor="#FFFFFF">
<script language="javascript">
var lsdz = "";
function checkin()
{    
   if(confirm("你现在真的要删除您选择的记录吗?"))
      return true
   else
      return false;
}
</script>
<script language="javascript">
var lsdz = "";
function checkout()
{    
   if(confirm("这些定单编号将被确认！客户可以在网上查询其定单的付款情况"))
      return true
   else
      return false;
}
</script>
<div align="center">订 单 明 细 </div>
<form method="post" action="order_name.asp">
  <table width="750" border="1" cellspacing="0" cellpadding="1" align="center" bordercolorlight="#66CCFF" bordercolordark="#FFFFFF" bgcolor="#DFEFFF">
    <tr bgcolor="#99CCFF"> 
      <td width="46" class="word" height="23"> 
        <div align="center"><font color="#000000">选择</font> </div>
      </td>
      <td width="110" class="word" height="23"> 
        <div align="center"><font color="#000000">订单号</font></div>
      </td>
      <td width="95" class="word" height="23"> 
        <div align="center"><font color="#000000">用户名</font></div>
      </td>
      <td width="83" class="word" height="23"> 
        <div align="center"><font color="#000000">真实姓名</font></div>
      </td>
      <td width="91" class="word" height="23"> 
        <div align="center"><font color="#000000">金额 </font></div>
      </td>
      <td width="95" class="word" height="23"> 
        <div align="center"><font color="#000000">付款方式</font></div>
      </td>
      <td width="125" class="word" height="23"> 
        <div align="center"><font color="#000000">定货日期 </font></div>
      </td>
      <td width="71" class="word" height="23"> 
        <div align="center"><font color="#000000">付款状态</font></div>
      </td>
      <td width="71" class="word" height="23"><font color="#000000">发货状态</font></td>
      <td width="71" class="word" height="23"> 
        <div align="center"><font color="#0000FF">代理商</font></div>
      </td>
    </tr>
    <%
		'判断显示的总页数
			RS.MoveLast 
			RECO=RS.RecordCount 
			AA = RECO MOD 40
			IF AA = 0 THEN
			PAGE = INT(RECO/40)
			ELSE
			PAGE = INT(RECO/40)+1
			END IF
			RS.MoveFirst 
				'定位页数
				PageNo = Request("PageNo")
				if PageNo <> "" Then
				
				else
					PageNo=1
				
				End if
			RS.PageSize = 40	'每页一10条
			RS.AbsolutePage = PageNo
		RowCount = RS.PageSize
		Do While Not RS.EOF and RowCount > 0 
		
    %> 
    <tr> 
      <td width="46" class="word" height="15"> 
        <div align="center"> 
          <input type="checkbox" name="caozuo" value="<%=RS("ORDER_NO")%>">
        </div>
      </td>
      <td width="110" class="word" height="15"> 
        <div align="center"><a href="order_desc.asp?order_no=<%=RS("ORDER_NO")%>"><%=RS("ORDER_NO")%></a>&nbsp;</div>
      </td>
      <td width="95" class="word" height="15"> 
        <div align="center"><font color="#000000"><a href=member_detail.asp?id=<%=Rs("user_name")%>><%=RS("USER_NAME")%></a></font>&nbsp;</div>
      </td>
      <td width="83" class="word" height="15"> 
        <div align="center"><font color="#000000"><%=RS("TURE_NAME")%></font>&nbsp;</div>
      </td>
      <td width="91" class="word" height="15"> 
        <div align="center"><font color="#000000"><%=RS("MONEY_NUM")%></font>&nbsp;</div>
      </td>
      <td class="word" width="95" height="15"> 
        <div align="center"><font color="#000000"><%=RS("PAY_MODE")%></font>&nbsp;</div>
      </td>
      <td class="word" width="125" height="15"> 
        <div align="center"><font color="#000000"><%=RS("ORDER_DATE")%></font>&nbsp;</div>
      </td>
      <td class="word" width="71" height="15"> 
        <div align="center"><font color="#000000"><%=RS("SEND_STATUS")%></font>&nbsp;</div>
      </td>
      <td class="word" width="71" height="15"><font color="#000000"><%=RS("SEND_STATUS1")%></font></td>
      <td class="word" width="71" height="15"> 
        <div align="center"><font color="#000000"><%=RS("DL_USER")%></font></div>
      </td>
    </tr>
    <%
			RS.MoveNext
			RowCount = RowCount - 1
			Loop
			RS.Close 
			%> 
  </table>
  <div align="center"> 
    <input type="submit" name="del" value="订单删除" onClick="return checkin();">
    <input type="submit" name="send" value="确认收款" onClick="return checkout();">
    <input type="submit" name="send1" value="确认发货" onClick="return checkout();">
    <input type="button" name="close" value="关闭窗口" onClick="self.close();">
    <%
                IF INT(PageNo) >1 THEN
                %> <a href="order_name.asp?ture_name=<%=request("ture_name")%>&order_no=<%=request("order_no")%>&order_date1=<%=request("order_date1")%>&order_date2=<%=request("order_date2")%>&PageNo=<%=PageNo-1%>&search=all"> 
        上一页 </a> <%
                ELSE
                %> 上一页 <%
                END IF
                %> 
                <%
                IF INT(PageNo) <=INT(PAGE) AND INT(PageNo+1) <=INT(PAGE) THEN
                %> <a href="order_name.asp?ture_name=<%=request("ture_name")%>&order_no=<%=request("order_no")%>&order_date1=<%=request("order_date1")%>&order_date2=<%=request("order_date2")%>&PageNo=<%=PageNo+1%>&search=all"> 
        下一页 </a> <%
                ELSE
                %> 下一页 <%
                END IF
                %> 
  </div>
</form>
</body>
</html>


<%
ELSE
%>
没有记录
<%
END IF
END IF
%>