<!--#include file="check.asp"-->
<%

Call hrPower(2.4,0)
dim action
action=request.QueryString("action")
if action="reback" then
num=request("num")
set rs=server.CreateObject("adodb.recordset")
set rss=server.CreateObject("adodb.recordset")
rs.open "select * from [MirMoUrl1] Where num='"&num&"' and flag=2",conn,1,3
		  if not rs.eof then		  	
	rss.open "select * from [L_woool] Where id='"&Rs("codenum")&"' ",conn,1,3
		  if not rss.eof then	
			Rs("flag")=0
			Rs("svrip")=Rss("ip")
			Rs("svrport")=Rss("post")
			Rs("postkey")=Rss("wkey")
			'Rs("sendDate")=now()
			Rs.update
			Rs.close
		  end if
		  end if
response.write "<script language='JavaScript'>{window.alert('操作成功');window.location='"&Request.ServerVariables("HTTP_REFERER")&"';}</script>"
response.End()
end if



action=request.QueryString("action")
if action="reback1" then
num=request("num")
username=request.form("name")
response.write username
set rs=server.CreateObject("adodb.recordset")
set rss=server.CreateObject("adodb.recordset")
rs.open "select * from [MirMoUrl1] Where num='"&num&"' and flag=2",conn,1,3
		  if not rs.eof then		  	
	rss.open "select * from [L_woool] Where id='"&Rs("codenum")&"' ",conn,1,3
		  if not rss.eof then
			Rs("flag")=0
			'Rs("sendDate")=now()
			Rs("username")=username
			Rs("svrip")=Rss("ip")
			Rs("svrport")=Rss("post")
			Rs("postkey")=Rss("wkey")
			Rs.update
			Rs.close
		  end if
		  end if
response.write "<script language='JavaScript'>{window.alert('操作成功');window.location='"&Request.ServerVariables("HTTP_REFERER")&"';}</script>"
response.End()
end if




action=request.QueryString("action")
if action="fasong" then
num=request("num")

response.write "<tr align=center>"
response.write "定单号："&num&"<br>"
response.write "输入要修改成的玩家账号"
response.write "</tr>"
response.write "<form action='?action=reback1&num="&num&"' method='post' name='form1' id='form1'>"
response.write "<input tabindex='1' size='24' name='name' value='' type='name' maxlength='20' />"
response.write "<input tabindex='1' type='submit' name='Submit' value='确认无误 提交修改发送' >"
response.write "</form>"
response.End()
end if


Nowpage=cint(request.QueryString("page"))
id=cint(request.QueryString("id"))
startdate=request("startdate")
zhuangt=request("zhuangt")
if startdate="" or isnull(startdate) then startdate=date()
enddate=request("enddate")
if enddate="" or isnull(enddate) then enddate=date()
wanjia=request("wanjia")
numid=request("numid")
codenum=request("codenum")


%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>发送定单</title>
<link href="images/main.css" rel="stylesheet" type="text/css" media="all" />
<script src="js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script>var   AutoRefresh=setTimeout('window.location.href=window.location.href',30000);</script>
</head>
<!--#include file="top.asp"-->

<script language="javascript">
try{
    var nav="H03";
    var subnav="L0303";
	
    document.getElementById(nav).className="current";
    document.getElementById(subnav).className="first current";
    document.getElementById(subnav).parentNode.parentNode.style.display="block";

}catch(e){
	document.getElementById("H03").className="current";
}
</script>
<div id="systime"><p id="servertime"></p></div>
<div id="mainBody" >

<div class="space">&nbsp;</div>
<div class="list">

<script   language="JavaScript">   
  function   ValidateInput()   
  {   

      document.form2.submit();   
      document.form2.Submit.disabled=true;   
  }   
  </script> 

<table class="listtable">
             <form name="form2" method="get" action="fasong.asp">
<tr>
              <td height="30" colspan="8" align="center"><input name="action" type="hidden" value="search">
分区ID&nbsp;&nbsp;
                <input name="codenum" type="text" class="inputbox" id="codenum" value="<%=codenum%>" size="10">
玩家名&nbsp;&nbsp;
                <input name="wanjia" type="text" class="inputbox" id="wanjia" value="<%=wanjia%>" size="10">
&nbsp;&nbsp;&nbsp;开始时间&nbsp;&nbsp;
<input name="startdate" type="text" class="inputbox" id="startdate" size="10" value="<%=startdate%>" onClick="WdatePicker()" readonly>
&nbsp;&nbsp;&nbsp;&nbsp;结束时间&nbsp;&nbsp;
<input name="enddate" type="text" class="inputbox" id="enddate" value="<%=enddate%>" size="10" onClick="WdatePicker()" readonly> 
&nbsp;&nbsp;&nbsp;&nbsp;订单号&nbsp;&nbsp;
<input name="numid" type="text" class="inputbox" id="numid" value="<%=numid%>" size="20">
&nbsp;&nbsp;&nbsp;&nbsp;发送状态&nbsp;&nbsp;
	<select size="1" name="zhuangt" class="inputbox">
		<option value=""  selected>全部</option>
		<option value="1" >成功</option>
		<option value="2" >失败</option>  
	</select>
<input type="button" name="Submit" onClick="JavaScript:ValidateInput();" value="立即查询" id="Submit" /></td>
             </td>
			 
              </tr></form>
</table>



<table class="listtable">
  <thead>
    <tr>
	  <th scope="col">ID</th>
	  <th scope="col">游戏分区</th>
            <th scope="col">玩家名</th>
            <th scope="col">状态</th>
            <th scope="col">操作时间</th>
            <th scope="col">数量</th>
            <th scope="col">金额</th>
            <th scope="col">订单号</th>
            <!--<th scope="col">ip/端口/密钥</th>-->
            <th scope="col">信息</th>
            <th scope="col">发送次数</th>
            <th scope="col">操作</th>
    </tr>
  </thead>
  <tbody> 



           <%
		  

		   searchstr=""
		   if zhuangt<>"" then searchstr="flag='"&zhuangt&"'"



		   if isdate(startdate) then 
		      if not searchstr="" then searchstr=searchstr+" and "
 		     'searchstr=searchstr+"sendDate >= '"&startdate&"'"
			searchstr=searchstr+"datediff(d,sendDate,'"&startdate&"')<=0"
		   end if

		   if isdate(enddate) then 
		      if not searchstr="" then searchstr=searchstr+" and "
 		      'searchstr=searchstr+"sendDate <= '"&enddate&"'"
 		     	 searchstr=searchstr+"datediff(d,sendDate,'"&enddate&"')>=0"
		   end if

			if wanjia<>"" then 
		      if not searchstr="" then searchstr=searchstr+" and "
 		      searchstr=searchstr+"userName='"&wanjia&"'"
		   end if

			if codenum<>"" then 
		      if not searchstr="" then searchstr=searchstr+" and "
 		      searchstr=searchstr+"codenum='"&codenum&"'"
		   end if

			if numid<>"" then 
		      if not searchstr="" then searchstr=searchstr+" and "
 		      searchstr=searchstr+"Num like '%"&numid&"%'"
		   end if





		   if not searchstr="" then searchstr=" where "+searchstr	
		   if request("action")="search" then 
		   			set Rs=GrateRs("Select * from MirMoUrl1"&searchstr&" order by id desc",1)
		   		else
					set Rs=GrateRs("Select * from MirMoUrl1"&searchstr&" order by id desc",1)

		   end if









		   Rs.PageSize=61
		   if not Rs.eof then 
		   If Nowpage=0 then Nowpage=1
		   Rs.AbsolutePage=Nowpage 
		   i=1
		   do while not Rs.eof and i<=Rs.pagesize
		   %>
<%if i mod 2 =0 then%>
         <tr class="listtr1" >
<%else%>
         <tr class="listtr2" >
<%end IF%>
              <td><%=Rs("id")%></td>
              <td><%=Rs("codeNum")%></td>
              <td><%=Rs("userName")%></td>
              <td><%=Rs("flag")%></td>
              <td><%=Rs("sendDate")%></td>
              <td><%=Rs("payMoney")%></td>
              <td><%=Rs("Money")%></td>
              <td><%=Rs("num")%></td>
              <!--<td><%=Rs("svrip")%>/<%=Rs("svrport")%>/<%=Rs("postkey")%></td>-->
              <td><%=Rs("message")%></td>
              <td><%=Rs("fasong")%></td>
              <td><a href="?action=reback&num=<%=Rs("num")%>" onClick="return confirm('确定执行操作吗？')">重发</a> / 
              <a href="fasong.asp?action=fasong&num=<%=Rs("num")%>" target="_blank">改名重送</a>



	  <%

	num=rs("num")
	set rsd=server.CreateObject("adodb.recordset")
	rsd.open "select * from mobile1 where num='"&num&"'",conn,1,1
	if rsd.eof or rsd.bof then
response.write "<font color=blue无</font>"
	'result="<font color=blue>定单失败 无发货记录</font>"
	else

response.write "<font color=blue>有</font>"

	end if

%>
</td>

            </tr>
			<%
		   i=i+1
		   Rs.movenext
		   loop
		  %>
<tr onmouseover="this.oldcolor=this.style.backgroundColor;this.style.backgroundColor='infobackground'" onmouseout="this.style.backgroundColor=this.oldcolor" style="color:#284775;background-color:White;">
              <td height="26" colspan="9">&nbsp;<strong>翻页: :</strong>
                <%
  myurl="fasong.asp?action=search&zhuangt="&zhuangt&"&startdate="&startdate&"&enddate="&enddate&"&wanjia="&wanjia&"&codenum="&codenum&"&numid="&numid&"&"
  response.write("共："&Rs.recordcount&"条记录，共:"&Rs.PageCount&"页,"&Rs.PageSize&"条/页,第"&NowPage&"页&nbsp;")
  response.write("<a href='"&myurl&"page=1'>"&"首页</a>&nbsp;")
  if NowPage>1 then response.write("<a href='"&myurl&"page="&Nowpage-1&"'>上一页</a>&nbsp;")
  if NowPage<Rs.PageCount then response.write("<a href='"&myurl&"page="&Nowpage+1&"'>下一页</a>&nbsp;")
  response.write("<a href='"&myurl&"page="&Rs.PageCount&"'>尾页</a>&nbsp;")
		%>
                &nbsp;</td>
            </tr>
			  <%else%>
<tr onmouseover="this.oldcolor=this.style.backgroundColor;this.style.backgroundColor='infobackground'" onmouseout="this.style.backgroundColor=this.oldcolor" style="color:#284775;background-color:White;">
              <td height="26" colspan="9">对不起,无记录!</td>
              </tr>
			  <%end if%>
        

          </table>
       </td>
      </tr>
	  

    </table></td>
  </tr>
</table>
</body>
</html>
<%
call DBConnEnd
%>