<!-- #include file="include/onlogin.asp" -->
<!-- #include file="include/conn.asp" -->
<table width="100%" border="0" cellspacing="2">
  <tr>
    
    <td  class="b1" valign="top"> 
<% tit="<a href='admin_sql.asp'>执行SQL</a> | " & _
      "<a href='admin_datamanage.asp?action=BackupData'>备份数据库</a> | " & _
      "<a href='admin_datamanage.asp?action=CompressData'>压缩数据库</a> | " & _
      "<a href='admin_datamanage.asp?action=RestoreData'>恢复数据库</a>"
response.write header(2,tit)

response.write admin_bar("订单管理",1,"99%")
call main()
  const MaxPerPage=25
sub main()
if action="delip" then
	conn.execute("delete from User_ff_Csk_Soft_Html where payid in ("&request.form("delid")&")")
	response.write "删除成功！"
else
    if request("ok_no")=2 then
	conn.execute("update User_ff_Csk_Soft_Html set ok_no=2 where payid="&request("id"))
    end if
%>
      <table width="100%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
        <FORM name="myform" METHOD=POST ACTION="?action=delip">
          <tr> 
            <th width="100%" colspan=7 class="tdbg1">用户订单管理</th>
          </tr>
          <tr class="tdbg2"> 
            <td width="10%" align="center" height="20"><B> 订单号 </B></td>
            <td width="15%" align="center" height="20"><B>注册用户</B></td>
            <td width="15%" align="center" height="20"><B>电子邮件</B></td>
            <td width="15%" align="center" height="20"><B>手机号码</B></td>
            <td width="10%" align="center"><B>订单金额</B></td>
            <td width="10%" align="center"><B>订单处理</B></td>
            <td width="15%" align="center"><B>订单日期</B></td>
            <td width="10%" align="center"><B>选择</B><input type=checkbox value="on" name="chkall" onclick="CheckAll(this.form)"></td>
          </tr>
          <%
	dim currentpage,page_count,Pcount
	dim totalrec,endpage
	currentPage=request("page")
	if currentpage="" or not isInteger(currentpage) then
		currentpage=1
	else
		currentpage=clng(currentpage)
		if err then
			currentpage=1
			err.clear
		end if
	end if
	sql="select * from User_ff_Csk_Soft_Html order by tim desc"
	Set rs= Server.CreateObject("ADODB.Recordset")
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
%>
          <tr class="tdbg2"> 
            <td width="100%" colspan=4>还没有任何数据。</td>
          </tr>
          <%
	else
		rs.PageSize = MaxPerPage
		rs.AbsolutePage=currentpage
		page_count=0
		totalrec=rs.recordcount
		while (not rs.eof) and (not page_count = MaxPerPage)
%>
          <tr> 
            <td width="10%" align="center"><%=rs("payid")%></td>
            <td width="15%" align="center"><%=rs("username")%></td>
            <td width="15%" align="center"><%=rs("email")%></td>
            <td width="15%" align="center"><%=rs("handphone")%></td>
            <td width="10%" align="center"><%=rs("emoney")%></td>
            <td width="10%" align="center">
<%if rs("ok_no")=0 then response.write"<a href=""?ok_no=2&id="&rs("payID")&""" onclick=""{if(confirm('请慎重操作!!!确定设置成人工处理吗???')){return true;}return false;}""><span style=""text-decoration: overline""><u><font color=""#FF0000"">暂未处理</font></u></span></a>"
  if rs("ok_no")=1 then response.write"<font color=""#00FFFF"">系统处理</font>"
  if rs("ok_no")=2 then response.write"<font color=""#00FF00"">人工处理</font>"          
%>
            <td width="15%" align="center"><%=rs("tim")%></td>
            <td width="10%" align="center"> 
              <input type=checkbox name="delid" value="<%=cstr(rs("payID"))%>"></td>
          </tr>
          <%
		page_count = page_count + 1
		rs.movenext
		wend
%>
          <tr class="tdbg2"> 
            <td colspan=3 align=center>分页： 
              <%Pcount=rs.PageCount
	if currentpage > 4 then
	response.write "<a href=""?page=1"">[1]</a> ..."
	end if
	if Pcount>currentpage+3 then
	endpage=currentpage+3
	else
	endpage=Pcount
	end if
	for i=currentpage-3 to endpage
	if not i<1 then
		if i = clng(currentpage) then
        response.write " <font color=red>["&i&"]</font>"
		else
        response.write " <a href=""?page="&i&""">["&i&"]</a>"
		end if
	end if
	next
	if currentpage+3 < Pcount then 
	response.write "... <a href=""?page="&Pcount&""">["&Pcount&"]</a>"
	end if
%>
            </td>
            <td align=center> </td>
            <td align=center> </td>
            <td align=center> </td>
            <td align=center> </td>
            <td align=center> 
              <input type=submit name=submit value="删除">
              </td>
          </tr>
          <%
	end if
	rs.close
	set rs=nothing
%>
        </FORM>
      </table>
      <%
end if
end sub
%>
      <script language="JavaScript">
<!--
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
//-->
      </script>

<font color="#00ff00"><span style="background-color: #C0C0C0">
由管理员在后台确认处理的为&quot;人工处理&quot; </span></font><font color="#00ffff">
<span style="background-color: #C0C0C0">&nbsp;在线支付成功后的为“系统处理”&nbsp;&nbsp; </span>
</font><span style="text-decoration: overline; background-color: #C0C0C0"><u>
<font color="#ff0000">如果支付不成功的为&quot;暂未处理&quot;</font></u></span></p>

<%
 response.write admin_bar("",2,"99%")
function isInteger(para)
       on error resume next
       dim str
       dim l,i
       if isNUll(para) then 
          isInteger=false
          exit function
       end if
       str=cstr(para)
       if trim(str)="" then
          isInteger=false
          exit function
       end if
       l=len(str)
       for i=1 to l
           if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
              isInteger=false 
              exit function
           end if
       next
       isInteger=true
       if err.number<>0 then err.clear
end function%>