<%
if request.cookies("buyok")("admin")="" then response.write "<meta http-equiv='refresh' content='0;URL=../admin.asp'>"
%>
<!--#include file="../include/config.asp"-->

<script language=javascript src=../include/mouse.js></script>
<%
call aspsql()
action=trim(request("class"))
Set rs = conn.Execute("select * from hand") 
set rs=nothing
pages=30
%>
     <%
sub checkmanage(str)
Set mrs = conn.Execute("select * from manage where username='"&request.cookies("buyok")("admin")&"'")
if not (mrs.bof and mrs.eof) then
manage=mrs("manage")
if instr(manage,str)<=0 then
response.write "<script language='javascript'>"
response.write "alert('警告：您没有此项操作的权限！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
else
session("buyok_admin_login")=0
end if
else 
response.write "<script language='javascript'>"
response.write "alert('没有登陆，不能执行此操作！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
end if
set mrs=nothing
end sub
%>
<%call checkmanage("08")%>

<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../images/css.css" type=text/css rel=stylesheet>
<LINK href="../list/newhead.css" type=text/css rel=stylesheet>
<script language="JavaScript" type="text/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>

</HEAD><body bgcolor="#D9EAFC">
<center>
<%
action=request("action")
%>
<form action=hand5.asp method=post name="newslist">

		  <table height="5"><tr><td></td></tr></table>

  <table cellspacing=0 cellpadding=0 width=95% bgcolor=#FFFFFF border=0 class="new" align="center">
    <tbody>
      <tr> 
        <td width=98% valign=top> <TABLE cellSpacing=0 cellPadding=0 width=100% border=0 style="BORDER-RIGHT: #b1bfee 1px solid; BORDER-TOP: #b1bfee 1px solid; BORDER-LEFT: #b1bfee 1px solid; BORDER-BOTTOM: #b1bfee 1px solid" 
>
            <TBODY>
              <TR> 
                <TD bgColor=#f4f5fd height=30><font color="#000000">　<B><font color="#FF0000">&nbsp;汇款确认</font></B></font></TD>
              </TR>
            </TBODY>
          </TABLE>
		  <table height="5"><tr><td></td></tr></table>
          <table width="100%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
            <tr align="center" valign="middle">
              <td width="50" bgcolor="#f4f5fd"><strong>选 择</strong></td>
              <td height="30" bgcolor="#f4f5fd"><strong>订 单 号</strong></td>
              <td bgcolor="#f4f5fd"><strong>付款金额</strong></td>
              <td bgcolor="#f4f5fd"><strong>付款方式</strong></td>
              <td bgcolor="#f4f5fd"><strong>银行名称</strong></td>
            </tr>
            <%
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from hand order by NewsID desc"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write "<tr><td colspan=5 height=50 align=center bgcolor=#FFFFFF>暂时没有汇款确认</td></tr>"
else
rs.pageSize = pages '每页记录数
allPages = rs.pageCount	'总页数
page = Request("page")	'从浏览器取得当前页

'if是基本的出错处理

If not isNumeric(page) then page=1

if isEmpty(page) or clng(page) < 1 then
page = 1
elseif clng(page) >= allPages then
page = allPages 
end if
rs.AbsolutePage = page			'转到某页头部
do while not rs.eof and pages>0
%>
            <tr align="center" valign="middle">
              <td bgcolor="#FFFFFF"><input type='checkbox' value='<%=Cstr(rs("NewsId"))%>' name=id></td>
              <td height="30" bgcolor="#FFFFFF"><a href="hand55.asp?NewsId=<%=rs("NewsId")%>"><%=rs("hk1")%></a></td>
              <td bgcolor="#FFFFFF"><%=rs("hk2")%></td>
              <td bgcolor="#FFFFFF"> <%hk3=rs("hk3")
if hk3="1" then
%>
                在线支付 
                <% elseif hk3="2" then%>
                支付宝支付 
                <% elseif hk3="3" then%>
                银行电汇 
                <% elseif hk3="4" then %>
                邮局汇款 
                <% end if %> </td>
              <td bgcolor="#FFFFFF"><%=rs("hk4")%></td>
            </tr>
            <%
pages = pages - 1
rs.movenext
if rs.eof then exit do
loop

end if
%>
          </table></td>
      </tr>
  </table>
    <table width="95%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="30" colspan=15><input type='checkbox' name=chkall onclick='CheckAll(this.form)'>全选&nbsp;&nbsp;&nbsp;&nbsp;
	  <input type="submit" name="action" value="删除" onClick="{if(confirm('该操作不可恢复！\n\n确定删除选定的新闻？')){this.document.newslist.submit();return true;}return false;}"></td>
    </tr>
    <tr>
      <td colspan=5>      <%
call listpage()
%>
</td>
    </tr>
  </table>
</form>
<%

if action="删除" then
delid=replace(request("id")," ","")
call proddel()
end if

%>
</BODY>
</CENTER>

</HTML>
<%
sub listpage()
'if allpages<=1 then exit sub
response.write "<tr><td height=30> </td></tr><tr><td colspan=3 height=1 background=images/small/bgline.gif></td></tr>"
response.write "<tr><td align=center>"
response.write "<br>总计 "&RS.RecordCount&" 篇文章 &nbsp;"
if page = 1 then
response.write "<font color=darkgray>首页 前页</font>"
else
response.write "<a href=hand5.asp?class="&action&"&page=1>首页</a> <a href=hand5.asp?class="&action&"&page="&page-1&">前页</a>"
end if
if page = allpages then
response.write "<font color=darkgray> 下页 末页</font>"
else
response.write " <a href=hand5.asp?class="&action&"&page="&page+1&">下页</a> <a href=hand5.asp?class="&action&"&page="&allpages&">末页</a>"
end if
response.write " &nbsp; 第"&page&"页 共"&allpages&"页 </td></tr>"
end sub

rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<%
sub proddel()
	if delid="" or isnull(delid) then
	response.write "<script language='javascript'>"
	response.write "alert('操作失败，您什么也没有选择。');"
	response.write "location.href='javascript:history.go(-1)';"							
	response.write "</script>"	
	response.end
	else
		conn.execute("delete from hand where NewsId in ("&delid&")")
		if err.number<>0 then '错误处理
			response.write "数据库操作失败：" & err.description
			err.clear
		else		
			conn.close
			set conn=nothing

	response.write "<script language='javascript'>"
	response.write "alert('所选新闻已被删除，单击“确定”返回新闻列表！');"
	response.write "location.href='hand5.asp';"
	response.write "</script>"	
	response.end

		end if
	end if
end sub
%>