<!--#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"-->

<script language="JavaScript">
<!--
function winOpenA(url){
	window.open(url,'','height=320,width=365,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no')
}
// -->
</script>

<%

upline=Session("Usr_UserName")
range=ClearSQL(request("range"))
Nowpage=cint(request.QueryString("page"))

startdate=ClearSQL(request("startdate"))
enddate=ClearSQL(request("enddate"))

if startdate="" or isnull(startdate) then startdate=date()
if enddate="" or isnull(enddate) then enddate=date()


wanjia=ClearSQL(request("wanjia"))
numid=ClearSQL(request("numid"))
kaid=ClearSQL(request("kaid"))
'wooolid=ClearSQL(request("wooolid"))
wooolid=cint(request("wooolid"))
Pname = cint(Request("Pname"))



		   searchstr=""
		   dateparam="d"
		   if upline<>"" then searchstr=" upline='"&upline&"'"

		   if Pname<>"0" then
		   		if searchstr<>"" then searchstr = searchstr & " and "
				searchstr=searchstr&" port="&Pname&" "
		   end if
		   
	

		   if isdate(startdate) then 
		      if not searchstr="" then searchstr=searchstr+" and "
 		     searchstr=searchstr+"date >= '"&startdate&"'"
		   end if

		   if isdate(enddate) then 
		      if not searchstr="" then searchstr=searchstr+" and "
 		      searchstr=searchstr+"date <= '"&enddate&"'"
		   end if



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

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

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

			if wooolid<>"0" then 
		      if not searchstr="" then searchstr=searchstr+" and "
 		      searchstr=searchstr+"wooolid="&wooolid&""
			'else
		      'if not searchstr="" then searchstr=searchstr+" and "
 		      'searchstr=searchstr+"wooolid<>0"
		   end if		 
		   if not searchstr="" then searchstr=" where "+searchstr





%>



	<div id="mainborder">
		<div id="main">
			
		<h3 class="bigico bigico_calendar">全部订单记录</h3>
		<div class="vspace"></div>

		<form method="post" action="" id="ctl01">

<script src="/scripts/time.js" type="text/javascript"></script>

			<div>
				<select name="Pname" id="paymentChannel" style="width:115px;">
                              <%Call payoption(Pname)%>

</select> &nbsp;
				日期从 <input name="startdate" type="text" value="<%=startdate%>" <%=disabled%> id="fromDate" onclick="javascript:__calendar.setHook(this);" style="width:75px;" />
				到 <input name="enddate" type="text" value="<%=enddate%>" <%=disabled%> id="toDate" onclick="javascript:__calendar.setHook(this);" style="width:75px;" /> &nbsp;
				帐号ID <input name="wanjia" type="text" id="buyerOuterId" style="width:80px;" /> &nbsp;
				卡号 <input name="kaid" type="text" id="paymentChannelMemo" style="width:100px;" /> &nbsp;
				订单号 <input name="numid" type="text" id="paymentChannelMemo" style="width:100px;" /> &nbsp;
				<input type="submit" name="search" value="搜索" id="search" class="button" style="width:50px;" />
				<div class="vspace"></div>
			</div>
			

			<div class="gridwrap">
				<table class="fixed grid">
					<thead>

						<th width="110">时间</th>
						<th>分区 (#ID)</th>
						<th width="105">帐号ID</th>
						<th width="90">订单金额</th>
						<th width="110">支付方式</th>
						<th width="145">卡号/银行订单号</th>
						<th width="90">状态</th>

					</thead>
					


                <%

	
		   sqlInfo = "Select * from mobile1 "&searchstr&" order by id desc"
		'response.Write sqlInfo
		   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
		   %>
							<tr class="alt">
								<td><%=Rs("time")%></td>
								<td><%
						set wrs = GrateRs("select * from L_woool where ID="&rs("wooolID"),1)
						if wrs.recordcount<>0 then
						response.Write wrs("wooolName")&" (#"&wrs("id")&")"
						else response.write "<font color=red>服务已被删除</font>"
						end if
						%></td>
								<td><%=rs("number")%></td>
								<td><%=zero(formatnumber(rs("price")))%> <span class="gray">元</span></td>
								<td><%=rs("Pname")%></td>
								<td><%=rs("usercode")%></td>
								<td><%
if rs("stat")=1 or rs("stat2")=1 then 
response.write "<font color=blue>成功</font>" 
else 
response.write "<a title=""查看详细"" href=""javascript:var o=winOpenA('cps_order_detail.asp?ID="&rs("id")&"')""><font color=red>失败</font></a>" 
end if
%></td>
							</tr>
                <%
		   i=i+1
		   Rs.movenext
		   loop
		  %>
					

						
					<tr>
						<td colspan="7"><div id="p" class="p_left">
<%
  myurl="?range="&range&"&wooolid="&wooolid&"&pname="&pname&"&wanjia="&wanjia&"&numid="&numid&"&kaid="&kaid&"&startdate="&startdate&"&enddate="&enddate&"&"

  response.write("<div class=""p_navigates""><a class=""aspNetDisabled p_current"" href='"&myurl&"page=1'>"&"首页</a></div>")
  if NowPage>1 then response.write("<div class=""p_navigates""><a class=""aspNetDisabled p_current"" href='"&myurl&"page="&Nowpage-1&"'>上一页</a></div>")
  if NowPage<Rs.PageCount then response.write("<div class=""p_navigates""><a class=""aspNetDisabled p_current"" href='"&myurl&"page="&Nowpage+1&"'>下一页</a></div>")
  response.write("<div class=""p_navigates""><a class=""aspNetDisabled p_current"" href='"&myurl&"page="&Rs.PageCount&"'>尾页</a></div>")

  response.write("<div class=""p_stat"">页数: <span class=""p_counter"">"&NowPage&"</span>/<span class=""p_counter"">"&Rs.PageCount&"</span>")

  response.write("&nbsp; &nbsp;记录数: <span class=""p_counter"">"&Rs.recordcount&"</span></div><div class=""clear""></div>")
		%>
</div></td>
					</tr>


  
                <%else%>
					<tr id="zero">
	<td colspan="7" class="t3">没有符合条件的记录。</td>
</tr>

                        
   
                <%end if%>

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

</body>
</html>
