⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.asp

📁 就业信息服务网
💻 ASP
字号:
<%
IF not(Session("KEY")="1" or session("KEY")="2") THEN
   response.redirect "../login.asp"
   response.end
END IF
%>
<!--#include file="dbconn.asp"-->
<!--#include file="../config.asp"-->
<link rel="stylesheet" type="text/css" href="../main.css">
<body bgcolor="#4473A5" marginheight=0 marginwidth=0 leftmargin=0>
<%
   dim totalPut   
   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
   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 
   set rs=server.createobject("adodb.recordset") 
   sql="select * from admin order by userID"
   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 
%>
<center>
<Form name="search" method="POST" action="default.asp">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="400" style="border-collapse: collapse" bordercolor="#111111">
<TBODY>    
  <TR>    
    <TD align=left><img border="0" src="../images/userlist.gif"></td>
<%if Session("KEY")="1" then%>
    <td align=right><a href="add.asp"><img border=0 alt="增加用户" src="../images/adduser.gif"></a></td>
<%else%>
    <td align=right><img border=0 alt="你不是超级管理员无权使用此项" src="../images/adduser.gif"></a></td>
<%end if%>
  </TR>
</TBODY>
</TABLE><br><br>
<center>
<TABLE border="0" cellspacing="1" width="600" cellpadding="4" bgcolor="#efefef">
  <TR height=25 bgcolor="#235497"> 
    <TD width="45" align="center"><font color="#FFFFFF"><b>ID号</b></font></td>
    <TD width="150" align="center"><font color="#FFFFFF"><b>用户名</b></td>
    <TD width="150" align="center"><font color="#FFFFFF"><b>密码</b></td>
    <TD width="235" align="center"><font color="#FFFFFF"><b>管理权限</b></td>
    <TD width="75" align="center"><font color="#FFFFFF"><b>修改</b></td>
    <TD width="75" align="center"><font color="#Ff6600"><input type='submit' value='删除'></td>
  </TR>
<%do while not rs.eof%>
  <TR height="20" bgcolor="#ffffff"> 
    <TD width="45"  align="center"><font face="Arial"><b><%=rs("userid")%></b></font></td>
    <TD width="150" align="center"><%=rs("username")%></td>
    <%if Session("KEY")="1" then%>
    <TD width="150" align="center"><%=rs("password")%></td>
    <%else%>
    <TD width="150" align="center">********</td>
    <%end if%>
    <%if rs("oskey")=1 then%>
    <TD width="235" align="center">超级管理员</td>
    <%else%>
    <TD width="235" align="center">普通管理员</td>
    <%end if%>
    <%if Session("KEY")="1" then%>
    <TD width="75" align="center"><a href=edit.asp?userid=<%=rs("userid")%>><img alt="修改信息" border="0" src="../images/edit.gif"></a></td>
    <%else%>
    <TD width="75" align="center"><img alt="你不是超级管理员,不能修改此项改信息" border="0" src="../images/edit.gif"></a></td>
    <%end if%> 
    <%if Session("KEY")="1" then%>
    <TD width="75" align="center"><input type='checkbox' name='selAnnounce' value='<%=cstr(rs("userid"))%>'></td>
    <%else%>
    <TD width="75" align="center"><input type='checkbox' name='selAnnounce' value='<%=cstr(rs("userid"))%>' Disabled></td>
    <%end if%> 
  </TR>
 <% I=I+1
    IF I>=MaxPerPage then exit do
    RS.movenext
    LOOP
 %>
<TR><TD colspan="6" bgcolor="#ffffff"><%showpage totalput,MaxPerPage,"default.asp"%></TD></TR>
</TABLE>
</CENTER>
<%
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=600  cellspacing=0 cellpadding=0>" 
       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=600  cellspacing=0 cellpadding=0>"
       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] where userid="&cstr(id)
  conn.execute sql
   if err.Number<>0 then
     err.clear
     response.write "删 除 失 败 !<br>"
   end if
End sub
%>
</CENTER>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="100%">
    <div align="center">
      <center>
      <table border="0" cellpadding="4" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="610" bgcolor="#FFFFFF">
        <tr>
          <td width="600">
          <p style="line-height: 200%">系统超级管理员:1 (可以录入、修改和删除信息以及管理用户。)<br>
   系统普通管理员:2 (可以录入、修改信息,不能进行删除操作。)</td>
        </tr>
      </table>
      </center>
    </div>
    <p><br>
 </td>
  </tr>
</table>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -