<!--#include file="conn.asp" -->

<% adm_power_page="4" %>
<!--#include file="admin_dn.asp" -->
<!--#include file="../inc/config.asp" -->
<!--#include file="../inc/mail_inc.asp" -->
<% dim mo1(12),da1(31),mo2(12),da2(31)
  if Trim(Request.QueryString("w"))="search" then
    select case Trim(Request.QueryString("act"))
	 case "userid"
	   adn_6_s_sql="select * from shop where userid='"&Trim(Request.Form("userid"))&"'"
	 case "bh"
	   adn_6_s_sql="select * from shop where bh="&Request.Form("bh")
	   
	 case "zf"
	   zf=false
	   kt=false
	   if request.form("zf")="yes" then zf=true
	   if request.form("kt")="yes" then kt=true
	   adn_6_s_sql="select * from shop where jf="&zf&" and sx="&kt
	   
	 case "dat"
	   zf=false
	   kt=false
	   if request.form("zf")="yes" then zf=true
	   if request.form("kt")="yes" then kt=true
	  da3=Trim(Request.Form("year1"))&"-"&Trim(Request.Form("month1"))&"-"&Trim(Request.Form("day1"))
      da4=Trim(Request.Form("year2"))&"-"&Trim(Request.Form("month2"))&"-"&Trim(Request.Form("day2"))
      adn_6_s_sql="select * from shop where  and jf="&zf&" and sx="&kt&" and dat between #"&da4&"# and #"&da3&"#"
	
	end select
	application.Lock()
  rs.open adn_6_s_sql,conn,2,3
   while not rs.eof 
   bh=rs("bh")
   rs.delete
  adn_6_d_sql="delete  from paget_shop where bh="&bh
  conn.execute(adn_6_d_sql)
 adn_6_d_sql="delete  from dns_shop where bh="&bh
 conn.execute(adn_6_d_sql)
 adn_6_d_sql="delete  from mail_shop where bh="&bh
 conn.execute(adn_6_d_sql)
 adn_6_d_sql="delete  from host_shop where bh="&bh
 conn.execute(adn_6_d_sql)
 adn_6_d_sql="delete  from other_shop where bh="&bh
 conn.execute(adn_6_d_sql)
    
 '删除相关表中的记录
   rs.movenext
   rs.update
   wend

   rs.close 
   
   application.UnLock()
   %>
   <script language="JavaScript" type="text/JavaScript">
alert("删除操作完成！！！");
</script>
   
   <%
  end if
  Response.Write(adn_6_s_sql)
  
  if Trim(Request.QueryString("w"))="send" then
     zf=false
	 kt=false
	 if request.form("zf")="yes" then zf=true
	 if request.form("kt")="yes" then kt=true
	   
      da3=Trim(Request.Form("year1"))&"-"&Trim(Request.Form("month1"))&"-"&Trim(Request.Form("day1"))
      da4=Trim(Request.Form("year2"))&"-"&Trim(Request.Form("month2"))&"-"&Trim(Request.Form("day2"))
      body=Trim(Request.Form("body"))
  
    adm_6_send_sql="select * from shop where jf="&zf&" and sx="&kt&" and dat between #"&da4&"# and #"&da3&"#"
	rs.open  adm_6_send_sql,conn,1,1
     while not rs.eof 
	 subject=Trim(Request.Form("subject"))
	  Order="编号:"&rs("bh")&"　产品名称为:"&rs("mc")
	  body=replace(Trim(Request.Form("body")),"\\ordercircumstance",Order)
	   s_send=s_send+1
	   call SendMail(rs("email"),subject,body)
	 rs.movenext
	 wend
	 rs.close
	%>
   <script language="JavaScript" type="text/JavaScript">
alert("邮件发送完成！！！");
</script>
   
   <%
  end if
 

 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>:::管理页面:::</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="4" topmargin="4">
<p><strong><font color="#FF0000">业务订单处理</font></strong></p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="2%" height="19">&nbsp;</td>
    <td width="98%"><p>&nbsp;</p>
      <p><strong><font color="#006600">删除订单操作</font></strong></p>
      <p>&nbsp;</p></td>
  </tr>
  <tr> 
    <td height="126">&nbsp;</td>
    <td valign="top">
<table width="100%" border="1" cellspacing="0" cellpadding="0"
bordercolorlight="" bordercolordark="ffffff">
        <tr> 
          <td height="32"> 
            <form name="form2" method="post" action="adm_6_handle.asp?w=search&act=userid">
              用户名: 
              <input name="userid" type="text" id="userid" size="10">
              <input type="submit" name="Submit2" value="删除">
              删除该用户的所有订单 </form> </td>
        </tr>
        <tr> 
          <td height="30">
<form name="form1" method="post" action="adm_6_handle.asp?w=search&act=bh">
              订单号: 
              <input name="bh" type="text" id="bh" value="0" size="10">
              <input type="submit" name="Submit22" value="删除">
              删除此订单 </form></td>
        </tr>
        <tr> 
          <td height="33">
<form name="form3" method="post" action="adm_6_handle.asp?w=search&act=zf">
              订单情况: 是否支付 
              <select name="zf" id="zf">
                <option value="yes">是</option>
                <option value="no" selected>否</option>
              </select>
              确认情况: 
              <select name="kt" id="kt">
                <option value="yes">是</option>
                <option value="no" selected>否</option>
              </select>
              <input type="submit" name="Submit222" value="删除">
            </form></td>
        </tr>
        <tr> 
          <td height="35"> 
            <form name="form2" method="post" action="adm_6_handle.asp?w=search&act=dat">
              <p>是否支付 
                <select name="zf" id="select11">
                  <option value="yes">是</option>
                  <option value="no" selected>否</option>
                </select>
                确认情况: 
                <select name="kt" id="select12">
                  <option value="yes">是</option>
                  <option value="no" selected>否</option>
                </select>
              </p>
              <p>提交时间 
                <input name="year1" type="text" id="year12" value="<%=year(now)%>" size="4">
                年 
                <select name="month1" id="select">
                  <% for i= 1 to 12
	  
 if i=month(now)-1 then
 mo1(i)="selected"
 else
 mo1(i)=""
 end if
	   %>
                  <option value="<%= i%>" <%= mo1(i) %>><%= i %></option>
                  <% next %>
                </select>
                月 
                <select name="day1" id="select2">
                  <% for i= 1 to 31 
	  if i=day(now) then
 da1(i)="selected"
 else
 da1(i)=""
 end if
 %>
                  <option value="<%= i%>" <%= da1(i) %>><%= i %></option>
                  <% next %>
                </select>
                日 <font color="#FF0000">至</font> 
                <input name="year2" type="text" id="year22" value="<%=year(now)%>" size="4">
                年 
                <select name="month2" id="select3">
                  <% for i= 1 to 12
	  
 if i=month(now) then
 mo1(i)="selected"
 else
 mo1(i)=""
 end if
	   %>
                  <option value="<%=i%>" <%= mo1(i) %>><%= i %></option>
                  <% next %>
                </select>
                月 
                <select name="day2" id="select4">
                  <% for i= 1 to 31 
	  if i=day(now) then
 da1(i)="selected"
 else
 da1(i)=""
 end if
 %>
                  <option value="<%= i%>" <%= da1(i) %>><%= i %></option>
                  <% next %>
                </select>
                日 <font color="#FF0000"> 
                <input type="submit" name="Submit2222" value="删除">
                </font></p>
            </form></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
    <td><p>&nbsp;</p>
      <p><strong><font color="#006600">订单发送邮件</font></strong></p>
      <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><table width="100%" border="1" cellspacing="0" cellpadding="0"
bordercolorlight="" bordercolordark="ffffff">
        <tr> 
          <td height="18"><form name="form4" method="post" action="adm_6_handle.asp?w=send">
              <table width="99%" height="118" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#EEF4F9" bordercolorlight="" bordercolordark="ffffff">
                <tr>
                  <td bgcolor="#F7F7F7">邮件主题:</td>
                  <td><input name="subject" type="text" id="subject" value="您好!!"></td>
                </tr>
                <tr> 
                  <td width="23%" bgcolor="#F7F7F7">是否支付:</td>
                  <td width="77%"><select name="zf" id="select5">
                      <option value="yes">是</option>
                      <option value="no" selected>否</option>
                    </select></td>
                </tr>
                <tr> 
                  <td bgcolor="#F7F7F7">确认情况:</td>
                  <td><select name="kt" id="select6">
                      <option value="yes">是</option>
                      <option value="no" selected>否</option>
                    </select></td>
                </tr>
                <tr> 
                  <td bgcolor="#F7F7F7">提交日期;</td>
                  <td><input name="year1" type="text" id="year13" value="<%=year(now)%>" size="4">
                    年 
                    <select name="month1" id="select7">
                      <% for i= 1 to 12
	  
 if i=month(now)-1 then
 mo1(i)="selected"
 else
 mo1(i)=""
 end if
	   %>
                      <option value="<%= i%>" <%= mo1(i) %>><%= i %></option>
                      <% next %>
                    </select>
                    月 
                    <select name="day1" id="select8">
                      <% for i= 1 to 31 
	  if i=day(now) then
 da1(i)="selected"
 else
 da1(i)=""
 end if
 %>
                      <option value="<%= i%>" <%= da1(i) %>><%= i %></option>
                      <% next %>
                    </select>
                    日<font color="#FF0000">至</font> <input name="year2" type="text" id="year23" value="<%=year(now)%>" size="4">
                    年 
                    <select name="month2" id="select9">
                      <% for i= 1 to 12
	  
 if i=month(now) then
 mo1(i)="selected"
 else
 mo1(i)=""
 end if
	   %>
                      <option value="<%=i%>" <%= mo1(i) %>><%= i %></option>
                      <% next %>
                    </select>
                    月 
                    <select name="day2" id="select10">
                      <% for i= 1 to 31 
	  if i=day(now) then
 da1(i)="selected"
 else
 da1(i)=""
 end if
 %>
                      <option value="<%= i%>" <%= da1(i) %>><%= i %></option>
                      <% next %>
                    </select>
                    日</td>
                </tr>
                <tr> 
                  <td bgcolor="#F7F7F7">邮件内容:</td>
                  <td> <p> 
                      <textarea name="body" cols="45" rows="6" id="body">您好：
  您在 订购了以下产品:
 \\ordercircumstance</textarea>
                      <font color="#FF0000">支持 html</font><br>
                      <font color="#FF0000">注;“\\Ordercircumstance”</font>这是表示订单的内容,如果您需要将订单发送给客户的话，请不要更改，你可以在后面加入你所要发送的邮件内容就可.</p></td>
                </tr>
                <tr> 
                  <td bgcolor="#F7F7F7">&nbsp;</td>
                  <td><input type="submit" name="Submit" value="发出邮件"></td>
                </tr>
              </table>
            </form></td>
        </tr>
      </table></td>
  </tr>
</table>
<p>&nbsp;</p>
<p><font color="#FF0000">注： </font>在删除订单时请注意,这是直接对数据据用户订单进行操作，删除后装不能恢复，所以在删除前请备份数据库.</p>
<p>在对订单发送邮件时,将会对订单数据库中满足条件的每一条记录的所有者邮箱发送一封邮件。</p>
</body>
</html>
