<%
'if instr(session("btob_jk21.com_flag"),"71")=0 then
 '  response.redirect "../login.asp"
   'response.end
'end if
%>
<!--#include file ="../db_conn.asp"-->
<!--#include file="include/menu.asp"-->
<!--#include file="include/header.asp" -->
<%
if instr(session("bolma_manage_user_flag"),"42")=0 or session("bolma_manage_user_flag")="" then
   Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用，请<a href=../manage/login.asp><font color=#ff0000>管理员身份登陆</font></a>后进入。<br><li>您没有管理本页面的权限。"
   response.write Errmsg
   response.end
end if
if not isempty(request("selAnnounce")) then
   idlist=request("selAnnounce")
   if instr(idlist,",")>0 then
     dim idarr
     idArr=split(idlist)
     dim id
     for i = 0 to ubound(idarr)
       id=clng(idarr(i))
         call deleteannounce(id)
       next
   else
      call deleteannounce(clng(idlist))
   end if
end if 
dim totalPut
maxperpage=10   
dim CurrentPage
dim TotalPages
dim i,j
if not isempty(request("page")) then
   currentPage=cint(request("page"))
else
   currentPage=1
end if
dim rs
dim sql
set rs=server.createobject("adodb.recordset") 
sql="select * from admin_users order by ID"
rs.open sql,conn,1,1  
if rs.eof and rs.bof then 
   response.write "<p align='center'>对不起，没有您要查询的信息</p>" 
else 
   totalPut=rs.recordcount 
   if currentpage<1 then 
      currentpage=1 
   end if 
   if (currentpage-1)*MaxPerPage>totalput then 
      if (totalPut mod MaxPerPage)=0 then 
	 currentpage= totalPut \ MaxPerPage 
      else 
         currentpage= totalPut \ MaxPerPage + 1 
      end if 
   end if 
   if currentPage=1 then 
      showContent
   else 
      if (currentPage-1)*MaxPerPage<totalPut then 
         rs.move  (currentPage-1)*MaxPerPage 
         dim bookmark 
         bookmark=rs.bookmark 
         showContent
      else 
         currentPage=1 
         showContent
      end if 
   end if 
   rs.close 
end if 
set rs=nothing
sub showContent 
%>
<br>
<Form name="search" method="POST" action="admin_list.asp">
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
 <tr height=25>
   <td align="left" class="f11">系统管理员管理(点击用户名进行相应操作)--</td>
   <td align="right"><a href="admin_user_ok.asp?action=add"><font color=#ff0000>添加管理员</font></a></td>
 </tr>
</table>
<table width="700" border=0 align="center" cellPadding=4 cellSpacing=1>
  <tr height=28 bgcolor="#99ccff"> 
    <td width="8%" align="center">ID号</td>
    <td width="25%" align="center">用户名</td>
    <td width="25%" align="center">密码</td>
    <td width="20%" align="center">最后登录时间</td>
    <td width="20%" align="center">最后登录IP</td>
    <td width="12%" align="center"><input type='submit' value='删除' class=smallInput></td>
  </tr>
<%do while not rs.eof%>
  <tr height="28" bgcolor="#ffffff"> 
    <td width="8%"  align="center"><font face="Arial"><b><%=rs("id")%></b></font></td>
    <td width="25%" align="center"><a href="admin_user_ok.asp?id=<%=rs("id")%>"><%=rs("username")%></a></td>
    <td width="25%" align="center"><%=rs("password")%></td>
    <td width="30%" align="center"><%=rs("LastLogin")%></td>
    <td width="20%" align="center"><%=rs("LastLoginIP")%></td>
    <td width="12%" align="center"><input class=smallInput type='checkbox' name='selAnnounce' value='<%=cstr(rs("id"))%>'></td>
  </tr>
 <% I=I+1
    IF I>=MaxPerPage then exit do
    RS.movenext
    LOOP
 %>
<tr><td colspan="7" height="35"><%showpage totalput,MaxPerPage,"system_admi.asp"%></td></tr>
</table>
<%
end sub
function showpage(totalnumber,maxperpage,filename) 
    dim n 
    if totalnumber mod maxperpage=0 then 
       n= totalnumber \ maxperpage 
    else 
       n= totalnumber \ maxperpage+1 
    end if     
   if CurrentPage<2 then 
       response.write "<center>" 
       response.write "<table border=0 width=700  cellspacing=0 cellpadding=0 bgcolor=#99ccff>" 
       response.write "<tr height=25>"
       response.write "<td align='left'>"
       response.write "共<font color=#ff6600><b>"&n&"</b></font>页&nbsp;第<font color=#ff6600><b>"&CurrentPage&"</b></font>页&nbsp;共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条相关信息</td>" 
       response.write "<td align='right'>"
       response.write "【最前页】【上一页】" 
  else 
       response.write "<center>" 
       response.write "<table border=0 width=700  cellspacing=0 cellpadding=0 bgcolor=#99ccff>"
       response.write "<tr height=25>"
       response.write "<td align='left'>"
       response.write "共<font color=#ff6600><b>"&n&"</b></font>页&nbsp;第<font color=#ff6600><b>"&CurrentPage&"</b></font>页&nbsp;共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条相关信息</td>" 
       response.write "<td align='right'>"
       response.write "【<a href="&filename&"?page=1>最前页</a>】" 
       response.write "【<a href="&filename&"?page="&CurrentPage-1&">上一页</a>】&nbsp;" 
 end if 
  if n-currentpage<1 then 
       response.write "【下一页】【最后页】" 
  else 
      response.write "【<a href="&filename&"?page="&(CurrentPage+1)&">"
      response.write "下一页</a>】【<a href="&filename&"?page="&n&">最后页</a>】" 
  end if 
  response.write "</td>"
  response.write "</tr>"
  response.write "</form>"
  response.write "</table>"
end function
sub deleteannounce(id)
    dim rs,sql
    set rs=server.createobject("adodb.recordset")
    sql="delete from [admin_users] where id="&cstr(id)
    conn.execute sql
End sub
%>