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

📄 index.asp

📁 一个关于网站权限管理的经典例子,适合初学者
💻 ASP
字号:
<% Option explicit %>
<!-- #include file="./globals.inc" -->
<!-- #include file="./connects.inc" -->

<html>
<head>
  <title><%=sPageTitle%></title>
  <link href="./style/style.css" rel="stylesheet" type="text/css">
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  <meta http-equiv="Page-Enter" content="blendTrans(Duration=1.0)">
  <meta http-equiv="Page-Exit" content="blendTrans(Duration=1.0)">
</head>

<body topmargin=5 leftmargin=0 background="../images/bg.gif">

<table width="699" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td width="9"><img src="./images/left.gif" width="9" height="21"></td>
    <td background="./images/middle.gif"><b>权限管理</b></td>
    <td width="9"><img src="./images/right.gif" width="9" height="21"></td>
  </tr>
</table>
<table width="700" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#ffffff">
  <tr align="center" height=28>
    <td width="40"><b>排序号</b></td>
    <td width="40"><b>帐户ID</b></td>
    <td width="80"><b>帐户名</b></td>
    <td width="80"><b>帐户类型</b></td>
    <td width="80"><b>用户姓名</b></td>
    <td><b>已分配管理的栏目</b></td>
    <td width="60"><b>管理</b></td>
  </tr>
  <%
    Dim sSQL, rs1, sSQL9, rs9

    sSQL = "select * from tabAccountInfo order by f_i_orderid"
    Set rs1 = Server.CreateObject("ADODB.Recordset")
    rs1.open sSQL, sConn, 1, 1
    if rs1.eof and rs1.bof then
      response.end
    else
      while not rs1.eof
  %>
  <tr height=20>
    <td align="center">&nbsp;<%=rs1("f_i_orderid")%></td>
    <td align="center">&nbsp;<%=rs1("f_AccountId")%></td>
    <td>&nbsp;<%=rs1("f_AccountName")%></td>
    <td>&nbsp;<%=rs1("f_AccountType")%></td>
    <td>&nbsp;<%=rs1("f_UserName")%></td>
    <td>&nbsp;
    <%
      if rs1("f_AccountType")="administrator" then
        response.write "[所有栏目]"
      else
        sSQL9 = "select f_lanmuname from tabQXB where f_AccountName='" & rs1("f_AccountName") & "'"
        Set rs9 = Server.CreateObject("ADODB.Recordset")
        rs9.open sSQL9, sConn, 1, 1
        while not rs9.eof
          response.write rs9("f_lanmuname") & "; "
          rs9.movenext
        wend
        set rs9 = nothing
      end if
    %>
    </td>
    <td align="center">&nbsp;
    <%
       if rs1("f_AccountType")="administrator" then
         response.write "---"
       else
    %>
      <a href="EditQXB.asp?CurrentAccount=<%=rs1("f_AccountName")%>">管理…</a>
    <% end if%>
    </td>
  </tr>
  <%
        rs1.movenext
      wend
    end if
    Set rs1 = nothing
  %>
</table>

</body>
</html>

<!-
  作者:张庆
  zhangking@263.net
  2003.12.26
-->

⌨️ 快捷键说明

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