<!--#include virtual="/config/config.asp" -->
<!--#include virtual="/config/uercheck.asp" -->
<%
function txt2Sig(strSig)
	select case trim(strSig)
	  case "eq"
		 txt2Sig="="
	  case "gt"
		 txt2Sig=">"
	   case "ge"
		 txt2Sig=">="
	   case "lt"
		 txt2Sig="<"
	   case "le"
		 txt2Sig="<="
	   case "ne"
		 txt2Sig="<>"
	   case "$"
		 txt2Sig="Like"
	end select
end function
function getsqlstring(str,cond,svalue)
	sqlstr11=""
	strno=""
	if cond="Like" then
		strno="%"
	end if
	select Case trim(str)
		 case "u_name"
		 	sqlstr11=" and "& str& " "  & cond & " " & "'" & strno &  trim(svalue)  & strno & "'"
         case "s_date" 
		 	if not isdate(svalue) then url_return "日期格式错误",-1
		 	sqlstr11=" and "& str& " "  & cond & " "  & "'" & strno &  trim(svalue)  & strno & "'"
         case "s_money" 
		 if not isnumeric(svalue) then url_return "金额格式错误",-1
		 	sqlstr11=" and "& str& " "  & cond & " "  & "'" & strno &  trim(svalue)  & strno & "'"
        
	end select
	getsqlstring=sqlstr11
end function
conn.open constr
Sql="Select C_AgentType,ModeD from Fuser Where u_id=" & Session("u_sysid") & " and l_ok=True"
Rs.open Sql,conn,1,1
if Rs.eof then url_return "请先申请成为VCP",-1
rs.close


pageNo=requesta("pageNo")

searchValue=requesta("searchValue")
searchItem=requesta("searchItem")
condition=requesta("condition")
if searchValue<>"" then
	cond=txt2Sig(condition)
	otherhrefstr="&searchItem="&searchItem&"&condition="&condition&"&searchValue="&searchValue
	newsqlstring = getsqlstring(searchItem,cond,searchValue)
end if
sql="select b.u_name,a.* from (vcp_settleList a inner join userdetail b on a.s_userid=b.u_id) where s_userid="& session("u_sysid") & newsqlstring &" order by s_date desc"

rs.open sql,conn,1,1
		 if not isNumeric(pageNo) then pageNo=1
		 if pageNo<1 then PageNo=1
		 pageSizes=15
		 Rs.pageSize=pageSizes
		 pageCounts=Rs.pageCount
		 sUsers=Rs.RecordCount
		
		 if clng(pageNo)>clng(pageCounts) then pageNo=pageCounts
		 if not Rs.eof then Rs.AbsolutePage=pageNo
		 forstr1=clng(pageNo)-5
		 forstr2=clng(pageNo)+5
		 if forstr1<1 then forstr1=1
		 if forstr2>pageCounts then forstr2=pageCounts
		 pagestr=""

		 for ii=forstr1 to forstr2
		 	if clng(ii)<>clng(pageNo) then
				pagestr=pagestr & "<a href='"&request("script_name")&"?pageNo="& ii & otherhrefstr &"'>"& ii & "</a> "
			else
				pagestr=pagestr &"<b><font color=red>"& ii &"</font></b> "
			end if
		 next

		 if forstr1>1 then lookother1="<a href='"&request("script_name")&"?pageNo="& (forstr1-(1+5)) & otherhrefstr &"'><b>...</b></a> "
		 if forstr1<pageCounts then lookother2="<a href='"&request("script_name")&"?pageNo="& (forstr2+(1+5)) & otherhrefstr &"'><b>...</b></a> "

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="../css/Admin_Style.css" rel=stylesheet>
<body leftmargin='2' topmargin='0' marginwidth='0' marginheight='0'>

<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1'>
  <tr class='topbg'>
    <td height='30' align="center" ><strong>VCP用户管理</strong></td>
  </tr>
</table>
<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
  <tr class='tdbg'>
    <td width='91' height='30' align="center" >&nbsp;</td>
    <td width="771">尊敬的 
                  <%if ModeD then 
														Response.write "D"
													else
														Response.write "C"
													end if%>
                  <%=name%>模式合作伙伴，您好！(<a href="vcp_Edit.asp">修改资料</a>)</td>
  </tr>
</table><br>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bordercolordark="#ffffff" class="border">
<form name=form1 action="<%=request("script_name")%>" method=post >
<tr align="center">
<td nowrap="nowrap" class="Title"><span class="STYLE1"><strong>序号</strong></span></td>
<td class="Title"><span class="STYLE1"><strong>结算时间</strong></span></td>
<td class="Title"><span class="STYLE1"><strong>结算金额</strong></span></td>
</tr>
<%
if not rs.eof then
	cur=1
	do while not rs.eof and cur<=pageSizes
		u_name=rs("u_name")
		s_date=formatDateTime(rs("s_date"),2)
		s_money=rs("s_money")
%>
<tr>
<td class="tdbg"><%=cur%></td>
<td class="tdbg"><%=s_date%></td>
<td class="tdbg"><%=s_money%></td>
</tr>
<%
	rs.movenext
	cur=cur+1
	loop
end if
rs.close
%>
<tr>
    <td colspan=9 align="center" nowrap="nowrap" class="tdbg">
    <a href="<%=request("script_name")%>?pageNo=1<%=otherhrefstr%>">首页</a>&nbsp;
    <a href="<%=request("script_name")%>?pageNo=<%=clng(pageNo)-1%><%=otherhrefstr%>">上一页</a>&nbsp;
    <%=lookother1 & pagestr & lookother2%>&nbsp;
    <a href="<%=request("script_name")%>?pageNo=<%=clng(pageNo)+1%><%=otherhrefstr%>">下一页</a>&nbsp;
    <a href="<%=request("script_name")%>?pageNo=<%=pageCounts%><%=otherhrefstr%>">未页</a>
    总页数:<%=pageCounts%>&nbsp;
    总条数:<%=sUsers%></td>
</tr>
<tr>
    <td colspan=9 align="left" nowrap="nowrap" class="tdbg">

     <select name="searchItem">
         <option value="s_date" <% if searchItem="s_date" then Response.write " selected"%>>打款时间</option>
         <option value="s_money" <% if searchItem="s_money" then Response.write " selected"%>>打款金额</option>
     </select>
      <select name="condition">
          <option value="eq" <% if condition="eq" then Response.write " selected"%>>=</option>
          <option value="gt" <% if condition="gt" then Response.write " selected"%>>&gt;</option>
          <option value="ge" <% if condition="ge" then Response.write " selected"%>>&gt;=</option>
          <option value="lt" <% if condition="lt" then Response.write " selected"%>>&lt;</option>
          <option value="le" <% if condition="le" then Response.write " selected"%>>&lt;=</option>
          <option value="ne" <% if condition="ne" then Response.write " selected"%>>&lt;&gt;</option>
          <option value="$" <% if condition="$" then Response.write " selected"%>>包含</option>
     </select>
    <input name="searchValue" type="text" value="<%=SearchValue%>" size="20" maxlength="100">
    <input type="submit" value="查 询">
    <input type="button" value=" 返 回 " onClick="javascript:history.back();" />    </td>
</tr>
</form>
</table>
