<!--#include file="../fy.Function.asp"-->
<!--#include file="../../fy_inc/cls_pageview.asp"-->
<!doctype html>
<html>
<head>
<meta charset="gb2312">
<title>fycms_Admin</title>
<link rel="stylesheet" type="text/css" href="../css/base.css">
<link rel="stylesheet" type="text/css" href="../css/content.css">
</head>
<body>
<% 
 If Not fycms.ChkAdmin() Then '超级管理员检测
	Call fycms.fycmsErr("")
 End If 
	Dim ShowErr
	IF Request.QueryString("Action") = "Del" Then'生成HTML
		Dim AdminID ,Sqllog
		AdminID = ChkNumeric(Request.QueryString("AdminID"))
		IF AdminID  <> 1 Then
			Sqllog = "Delete From admin_fy Where ID=" & AdminID
			Conn.Execute (Sqllog)		
			ShowErr = "删除管理员成功"
			set conn=nothing
		Else
			ShowErr = "默认管理员不允许删除"
		End If
 			Call fycms.alert(ShowErr,"fy.Admin.asp")
 		Response.end
	End IF
	
	IF Request.QueryString("Action") = "Lock" Then
		AdminID = ChkNumeric(Request.QueryString("AdminID"))
		Conn.execute("Update Admin_fy set Locked=1 where ID ="&AdminID&"")
		set conn=nothing
		ShowErr = "锁定成功"
  	 Call fycms.alert(ShowErr,"fy.Admin.asp")
		Response.end
	End IF
	
	
	IF Request.QueryString("Action") = "Unlock" Then
		AdminID = ChkNumeric(Request.QueryString("AdminID"))
		Conn.execute("Update Admin_fy set Locked=0 where ID ="&AdminID&"")
		set conn=nothing
		ShowErr = "解锁成功"
	 	 Call fycms.alert(ShowErr,"fy.Admin.asp")
		Response.end
	End IF
	
	
	Dim strLocalUrl
	strLocalUrl = request.ServerVariables("SCRIPT_NAME")
	
	Dim intPageNow
	intPageNow = request.QueryString("page")
	
	Dim intPageSize, strPageInfo
	intPageSize = 30
	
	Dim arrinfo, i
	Dim sql, sqlCount
	sql = "SELECT [ID], [Admin_Name], [SuperTF], [LoginTime], [LoginIP], [LoginNumber], [Locked]" & _
		" FROM [Admin_fy]"& _
		"ORDER BY [ID] DESC"
	sqlCount = "SELECT Count([ID])" & _
			" FROM [Admin_fy]"

		Dim clsRecordInfo
		Set clsRecordInfo = New Cls_PageView
		
			clsRecordInfo.intRecordCount = 2816
			clsRecordInfo.strSqlCount = sqlCount
			clsRecordInfo.strSql = sql
			clsRecordInfo.intPageSize = intPageSize
			clsRecordInfo.intPageNow = intPageNow
			clsRecordInfo.strPageUrl = strLocalUrl
			clsRecordInfo.strPageVar = "page"
		clsRecordInfo.objConn = Conn		
		arrinfo = clsRecordInfo.arrinfo
		strPageInfo = clsRecordInfo.strPageInfo
		Set clsRecordInfo = nothing
	 %>
<div class="content"> 
	<div class="breadnav">当前位置：<a href="#">后台首页</a> >> 模型管理</div>
    <div class="opers">
    	<a href="fy.AAdd.asp?Action=Add" class="btn">添加新管理员</a>
    </div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <thead>
      <tr>
      <th>模型ID </th><th>模型名称</th><th>表名</th><th>描述</th><th>状态</th><th>生成Html</th><th>操作</th>
	  </tr>
    </thead>
		 <%
		Dim bgColor
		If IsArray(arrinfo) Then
			For i = 0 to UBound(arrinfo, 2)
	%>
        <tr>
      <td align="center"  ><%= arrinfo(1,i) %></td>
      <td align="center"  >
	   <%IF arrinfo(2,i) = 1 Then echo "<font color=red>超级管理员</font>" Else echo "普通管理员" %>
      </td>
      <td align="center" ><%= arrinfo(3,i) %></td>
      <td align="center"  ><%= arrinfo(4,i) %></td>
      <td align="center" ><%= arrinfo(5,i) %></td>
      <td align="center" >
	   <%IF arrinfo(6,i) = 1 Then echo "<font color=red>已锁定</font>" Else echo "正常" %>
	  </td>
      <td align="center" >       
	  <a href="fy.AAdd.asp?Action=Edit&AdminID=<%= arrinfo(0,i) %>">修改 </a>｜
	  <% IF arrinfo(0,i) <> 1 Then  %>
	  <a href="fy.QX.ASP?AdminID=<%= arrinfo(0,i) %>"> 修改权限 </a>｜
	  <a href="?Action=Del&AdminID=<%= arrinfo(0,i) %>" onClick="return confirm('确认删除此管理员吗?')">删除 </a>｜
	  <%Else %>
	  <a href="#" disabled="disabled" class="disabled" > 修改权限 </a>｜
	  <a href="#" disabled="disabled" class="disabled">删除 </a>｜

	
	
	
	<% End If
	IF arrinfo(0,i) <> 1 Then
	IF  arrinfo(6,i) = 0 Then%>
	  <a href="?Action=Lock&AdminID=<%= arrinfo(0,i) %>"> 锁定</a>
	  <% Else %>
	  <a href="?Action=Unlock&AdminID=<%= arrinfo(0,i) %>"> 解锁</a>
		<% End IF
		End IF %>	  </td>
    </tr><% 
	Next
	End If
	%>
    </table>
    <div class="pagelist">
    <%= strPageInfo%>
   </div>






</div>
</body>
</html>
