<!--#include file="../check.asp"--><!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>
<title>商户后台 - 发货失败记录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link type="text/css" rel="stylesheet" href="/css/reset.css" />
<link type="text/css" rel="stylesheet" href="/css/main.css" />
<link type="text/css" rel="stylesheet" href="/css/template_vendor.css" />
<script type="text/javascript" src="/scripts/common.js"></script>
<script type="text/javascript" src="/scripts/nav.js"></script>
<script type="text/javascript" src="/scripts/footerdock.js"></script>
</head>
<body>
<!--#include file="top.asp"-->


	<div id="mainborder">
		<div id="main">
			
		<h3 class="bigico bigico_calendar">发货失败记录</h3>
		<div class="vspace"></div>



<table width="100%" border="0" cellpadding="0" cellspacing="0" height="30">
<tr>
<td align="left"><font color='red'>注: 以下为发送失败列表, 请选择补发 (用户充值成功, 但没有领取到的主要原因是: 用户充值后, 没有等待页面返回充值成功的提示就关闭了充值页面造成的.)</font></td>
</tr>
</table>





<%


Action = Request("Action")



Select Case Action
	Case "reback"
	    Call reback()
	Case "reback1"
	    Call reback1()
	Case "gaiming"
	    Call gaiming()
	Case Else
	    Call Main()
End Select


Sub reback()
num=trim(YeSqlStr(request("num"),3))
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>"

end sub


Sub reback1()
num=trim(YeSqlStr(request("num"),3))
username=trim(YeSqlStr(request.form("wanjia"),3))
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='Failure.asp';}</script>"
end sub



Sub gaiming()
num=trim(YeSqlStr(request("num"),3))

set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [MirMoUrl1] Where num='"&num&"' and flag=2",conn,1,3
		  if not rs.eof then		  	
			odusername=Rs("username")
			Rs.close
		  end if

%>


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



	var e=document.form1;
	if (e.wanjia.value==""){
		alert("要修改的账号不能为空！");
		e.wanjia.focus();
		return;
	}


	if(confirm('确定操作吗...'))
	{
      document.form1.submit();   
      document.form1.Submit.disabled=true;   
	}
  }   
  </script>  

<form name="form1" method="post" action="?action=reback1&num=<%=num%>">



				<table class="grid">
					<tr>
						<td width="160" height="30">订单号:</td>
						<td><span><%=num%></td>


							</tr>
					<tbody id="inputs">
							<tr>
								<td height="30">当前账号:</td>
								<td><%=odusername%></td>
								</td>
							</tr>
							<tr>
								<td height="30">要修改的账号:</td>
								<td><input name="wanjia" type="text" maxlength="100" id="wanjia" style="width:200px;" onkeyup="value=value.replace(/[\W]/g,'')"  onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" /> <span class="gray"> * 请确认填写正确</span></td>
							</tr>
					</tbody>
						<tr>
							<td height="30">&nbsp;</td>
							<td>
								<div class="fl">
									<input type="button" name="Submit" value="修改发送" id="send" class="button" style="width:70px;" onClick="JavaScript:ValidateInput();"/>
									<input type="button" value="取消" style="width:70px" onclick="javascript:history.back();" class="button" />
<input name="a" type="hidden" id="a" value="sub">
<input name="wooolid" type="hidden" id="wooolid" value="1">
									&nbsp;
									</div>
								<div class="fl"></div>
								<div class="vspace clear"></div>
							</td>
						</tr>
					</table>
				</div>
			</form>





<%
end sub


Sub Main()
upline=Session("Usr_UserName")
Nowpage=cint(request.QueryString("page"))

%>
			<div class="clear"></div>

			<div cellpadding="5" cellspacing="0" class="gridwrap">
				<table class="grid">
					<thead>
						<th width="110">用户名</th>
						<th>充值金额</th>
						<th width="105">支付方式</th>
						<th width="115">分区</th>
						<th width="100">订单号</th>
						<th width="100">时间</th>
						<th width="200">操作</th>
					</thead>





                <%
		   if upline<>"" then searchstr="state<3 and upline='"&upline&"'"

		   if not searchstr="" then searchstr=" and "+searchstr	

		   sqlInfo = "Select *,(select Pname from [H_plist] where id=port) as Pname from mobile where num in(select num from MirMoUrl1 where num=num and flag=2) "&searchstr&" order by id desc"
		   set Rs=GrateRs(sqlInfo,1)
		   Rs.PageSize=15
		   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
		   	
				Rate = 0

		   %>




<tr class="alt">
<td><%=rs("number")%></td>
<td><%=rs("price")%> <span class="gray">元</span></td>
<td><%=rs("Pname")%></td>
<td><%
						set wrs = GrateRs("select wooolName from L_woool where ID="&rs("wooolID"),1)
						if wrs.recordcount<>0 then
						response.Write wrs("wooolName")
						else response.write "<font color=red>服务已被删除</font>"
						end if
						%></td>
<td><%=rs("num")%></td>
<td><%=Rs("regDate")&"&nbsp;"&Rs("regTime")%></td>
<%
set mrs = GrateRs("select message from MirMoUrl1 where num='"&Rs("num")&"'",1)
%>
<td><a href="#" onClick="window.alert('<%=mrs("message")%>')">信息</a>&nbsp;&nbsp;<a href="?action=reback&num=<%=Rs("num")%>" onClick="return confirm('确定执行操作吗？')">补发</a>&nbsp;&nbsp;<a href="?action=gaiming&num=<%=Rs("num")%>">改名补发</a></td>
</tr>







                <%
		   i=i+1
		   Rs.movenext
		   loop
		  %>

<table border="0" align="left" cellpadding="0" cellspacing="0">
<tr align="left">
<td><div>

<%
  myurl="?"
  response.write("共"&Rs.recordcount&"条记录&nbsp;页次"&NowPage&"/"&Rs.PageCount&"")
  response.write("&nbsp;<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;")
		%>


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


                <%else%>

				
					<tr id="zero">
	<td colspan="7" class="t3">暂无发货失败记录。</td>
</tr> 
  
                      

   
                <%end if
End Sub%>




				</table>
			</div>
	
		</div>
	</div>
</div>

</body>
</html>