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

📄 fireadmin.asp

📁 通过使用Office的Access数据库与之关联
💻 ASP
📖 第 1 页 / 共 2 页
字号:
        <td bgcolor="#F3F3F3"><input name="GoUrl" type="text" id="GoUrl" value="<%=Rs_Info("Conf_ErrorUrl")%>" size="50" maxlength="255"  /></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td height="25" align="right" bgcolor="#F3F3F3" class="Font_14">警告提示信息:</td>
        <td bgcolor="#F3F3F3"><textarea name="AlertData" cols="50" rows="5" id="AlertData"><%=Rs_Info("Conf_AlertInfo")%></textarea>
          <span class="Font_9pt_888888">[请勿出现回车符]</span></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td width="180" height="25" align="right" bgcolor="#F3F3F3" class="Font_14">锁定IP提示信息:</td>
        <td width="579" bgcolor="#F3F3F3"><textarea name="LockIpData" cols="50" rows="5" id="LockIpData"><%=Rs_Info("Conf_LockInfo")%></textarea></td>
      </tr>
      <tr>
        <td height="26" colspan="2" align="center" bgcolor="#F3F3F3"><input name="ConfigSubmit" type="submit" id="ConfigSubmit" value="提交保存" /></td>
      </tr>
	  </form>
    </table>
	</td>
  </tr>
</table>
<%
    Else
	    Call ShowError()
	End If
End Sub



Sub ShowLog()
    Call redOpenData(0)
	
	Dim Songs,sPage,PageNum,sPageSize,RsCount,Rs_Info,Sql
	PageNum = 0
	sPageSize = 20 '分页条数
	RsCount = 0
	sPage = GetPage(Trim(Request.QueryString("page")))
	Songs = False
	
	Sql = "Select Fire_Id,Fire_QueryString,Fire_AddTime,Fire_Ip From [Tb_FireLog] Order By Fire_Id Desc"
	Set Rs_Info = Server.CreateObject("ADODB.Recordset") '创建记录集
	Rs_Info.Open Sql,FireConn,3,1
	
	If Not Rs_Info.Eof Then
	    Songs = True
		Rs_Info.PageSize = sPageSize
		PageNum = Rs_Info.PageCount
		
		If sPage > PageNum Then '判断是否大于最大页数
		    sPage = PageNum
		End If
		
		Rs_Info.AbsolutePage = sPage
		RsCount = Rs_Info.RecordCount
	End If
%>
<script language="javascript">
<!--
function ShowMore(theform,boxN) {
    if (CheckBoxChecked(theform,boxN)) {
	    theform.action = "?type=Admin&action=SubmitMore" ;
		theform.submit() ;
	}else{
	    alert('请选择您要查看的信息!') ;
	}
}

function DelSelectInfo(theform,boxN) {
    if (CheckBoxChecked(theform,boxN)) {
	    if (confirm("您确定要删除吗?信息删除后将无法还原数据!")) {
		    theform.action = "?type=Admin&action=DelLog" ;
		    theform.submit() ;
		}
	}else{
	    alert('请选择您要删除的信息!') ;
	}
}

function LockThisIp(theform,boxN) {
    if (CheckBoxChecked(theform,boxN)) {
	    if (confirm("您确定要锁定该IP地址吗?")) {
		    theform.action = "?type=Admin&action=LockTheIp" ;
		    theform.submit() ;
		}
	}else{
	    alert('请选择您要锁定的IP地址信息记录!') ;
	}
}
//-->
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="91">
	
	<table width="778" border="0" align="center" cellpadding="4" cellspacing="1">
      <form id="LogForm" name="LogForm" method="post" action="">
	  <tr bgcolor="#C2C2C2">
        <td width="59" height="20" align="center" bgcolor="#C2C2C2" class="Font_14">选 择 </td>
        <td width="373" align="center" bgcolor="#C2C2C2" class="Font_14">出 错 页</td>
        <td width="155" align="center" bgcolor="#C2C2C2" class="Font_14"> Ip 地址 </td>
        <td width="154" align="center" bgcolor="#C2C2C2" class="Font_14"> 时 间</td>
      </tr>
	  <%
	  If Songs Then
	      Dim i
		  For i = 1 To sPageSize
		      If Rs_Info.Eof Then Exit For
	  %>
      <tr bgcolor="#F3F3F3">
        <td align="center" bgcolor="#F3F3F3"><input name="Logid" type="checkbox" id="Logid" value="<%=Rs_Info("Fire_Id")%>" /></td>
        <td align="left" bgcolor="#F3F3F3"><%=Rs_Info("Fire_QueryString")%></td>
        <td align="center" bgcolor="#F3F3F3"><%=Rs_Info("Fire_Ip")%></td>
        <td align="center" bgcolor="#F3F3F3"><%=Rs_Info("Fire_AddTime")%></td>
      </tr>
	  <%
			  Rs_Info.MoveNext()
		  Next
	  %>
	  <tr>
        <td height="29" colspan="4" align="left"><input name="ShowInfo" type="button" id="ShowInfo" value="详细信息" onclick="ShowMore(this.form,'Logid');" />
          <input name="DelInfo" type="button" id="DelInfo" value="删除信息" onclick="DelSelectInfo(this.form,'Logid');" />
          <input name="LockIp" type="button" id="LockIp" value="锁定Ip地址" onclick="LockThisIp(this.form,'Logid');" /></td>
      </tr>
	  <%
	  Else
	  %>
      <tr>
        <td height="54" colspan="4" align="center">
                
        <%Call ShowError()%></td>
      </tr>
	  <%End IF%>
	  </form>
    </table>
	
	<%
	If PageNum > 1 Then
	    Dim pageMe
		pageMe = Globalfile & "?type=Admin&action=Log&" 
		
	%>
	<table width="778" border="0" align="center" cellpadding="4" cellspacing="1">
      <tr>
        <td align="right"><%Call sPageList(pageMe,sPage,PageNum,RsCount)%></td>
      </tr>
    </table>
	<%
	End If
	%>
	</td>
  </tr>
</table>
<%
End Sub

Sub ShowLogMoreInfo()
    Dim sbox,sArr,i
	sbox = Request.QueryString("id")
	
	sArr = Split(sbox,",")
	
	For i = 0 To Ubound(sArr)
	    sArr(i) = Trim(sArr(i))
		
		If Isnumeric(sArr(i)) Then
		    Call SubLogMoreInfo(sArr(i))
		End If
	Next
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><input name="submitBack" type="button" id="submitBack" value="返回上一页" onclick="javascript:history.back();" /></td>
  </tr>
</table>
<%
End Sub

Sub SubLogMoreInfo(numId)
    On Error Resume Next
	
	Call redOpenData(0)
	
	Dim Rs_Sub,Songs
	
	Set Rs_Sub = FireConn.Execute("Select log.*,kip.* From [Tb_FireLog] log Left Join [Tb_KillIp] kip On kip.Kill_IP = log.Fire_Ip Where log.Fire_Id = " & Cint(numId))
	
	If Not Rs_Sub.Eof Then
%>
<table width="100%" height="35" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>
	
	<table width="778" height="169" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#F3F3F3">
      
	  <tr>
        <td height="167" align="center">
<textarea name="Content" cols="80" rows="10" wrap="off" id="Content">
错误页面:<%=Rs_Sub("Fire_QueryString")%>  IP地址:<%=Rs_Sub("Fire_Ip")%>

============================= LOG信息 =============================

LOG编号:<%=Rs_Sub("Fire_Id")%> 记录时间:<%=Rs_Sub("Fire_AddTime")%>
其它信息:

<%=Rs_Sub("Fire_Other")%>
=========================== IP地址信息 ============================

IP编号:<%=Rs_Sub("Kill_Id")%> 记录时间:<%=Rs_Sub("Kill_Time")%>
锁定次数: <%=Rs_Sub("Kill_Count")%> 次 锁定状态: <%If Cint(Rs_Sub("Kill_Check")) = 1 Then Response.Write("锁定") Else Response.Write("无锁定") End If%>
</textarea></td>
      </tr>
	  
    </table><br />

	
	</td>
  </tr>
</table>
<%
    Else
	    Call ShowError()
	End If
End Sub

Sub ShowIpLock()
    Call redOpenData(0)
	
	Dim Songs,sPage,PageNum,sPageSize,RsCount,Rs_Info,Sql
	PageNum = 0
	sPageSize = 20 '分页条数
	RsCount = 0
	sPage = GetPage(Trim(Request.QueryString("page")))
	Songs = False
	
	Sql = "Select Kill_Id,Kill_IP,Kill_Check,Kill_Time,Kill_Count From [Tb_KillIp] Order By Kill_Id Desc"
	Set Rs_Info = Server.CreateObject("ADODB.Recordset") '创建记录集
	Rs_Info.Open Sql,FireConn,3,1
	
	If Not Rs_Info.Eof Then
	    Songs = True
		Rs_Info.PageSize = sPageSize
		PageNum = Rs_Info.PageCount
		
		If sPage > PageNum Then '判断是否大于最大页数
		    sPage = PageNum
		End If
		
		Rs_Info.AbsolutePage = sPage
		RsCount = Rs_Info.RecordCount
	End If
%>
<script language="javascript">
<!--
function LockIpAdress(theform,BoxN) {
    if (CheckBoxChecked(theform,BoxN)) {
	    if (confirm("您确定要锁定/取消锁定该IP地址吗?")) {
		    theform.action = "?type=Admin&action=LockTheIp2" ;
		    theform.submit() ;
		}
	}else{
	    alert('请选择您要锁定的IP记录!') ;
	}
}

function DelLockInfo(theform,BoxN) {
    if (CheckBoxChecked(theform,BoxN)) {
	    if (confirm("您确定要删除该信息吗?删除后数据将无法恢复!")) {
		    theform.action = "?type=Admin&action=DelLockInfo" ;
		    theform.submit() ;
		}
	}else{
	    alert('请选择您要删除的记录!') ;
	}
}
//-->
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="49">
	
	<table width="778" border="0" align="center" cellpadding="4" cellspacing="1">
      <form id="LockForm" name="LockForm" method="post" action="">
	  <tr>
        <td width="59" align="center" bgcolor="#C2C2C2" class="Font_14">选 择</td>
        <td width="233" align="center" bgcolor="#C2C2C2" class="Font_14">IP 地址</td>
        <td width="187" align="center" bgcolor="#C2C2C2" class="Font_14">时 间</td>
        <td width="150" align="center" bgcolor="#C2C2C2" class="Font_14">是否锁定</td>
        <td width="103" align="center" bgcolor="#C2C2C2" class="Font_14">锁定次数</td>
      </tr>
	  <%
	  If Songs Then
	      Dim i
		  For i = 1 To sPageSize
		      If Rs_Info.Eof Then Exit For
		  
	  %>
      <tr bgcolor="#F3F3F3">
        <td align="center" bgcolor="#F3F3F3"><input name="LockId" type="checkbox" id="LockId" value="<%=Rs_Info("Kill_Id")%>" /></td>
        <td align="center" bgcolor="#F3F3F3"><%=Rs_Info("Kill_IP")%></td>
        <td align="center" bgcolor="#F3F3F3"><%=Rs_Info("Kill_Time")%></td>
        <td align="center" bgcolor="#F3F3F3"><%If Cint(Rs_Info("Kill_Check")) = 1 Then Response.Write("锁定") Else Response.Write("<font color=""#FF0000"">否</font>") End If%></td>
        <td align="center" bgcolor="#F3F3F3"><%=Rs_Info("Kill_Count")%></td>
      </tr>
	  <%
	          Rs_Info.MoveNext()
		  Next
		  
		  Rs_Info.Close : Set Rs_Info = Nothing
	  %>
	  <tr>
        <td height="24" colspan="5" align="left">
		  <input name="Sub_LockIp" type="button" id="Sub_LockIp" value="取消/锁定" onclick="LockIpAdress(this.form,'LockId');" />
          <input name="Sub_Del" type="button" id="Sub_Del" value="删除信息" onclick="DelLockInfo(this.form,'LockId');" /></td>
      </tr>
	  <%
	  Else
	  %>
      <tr>
        <td height="33" colspan="5" align="center"><%Call ShowError()%></td>
      </tr>
	  <%
	  End If
	  %>
	  </form>
    </table>
	<%
	If PageNum > 1 Then
	    Dim pageMe
		pageMe = Globalfile & "?type=Admin&action=IpLock&" 
		
	%>
	<table width="778" border="0" align="center" cellpadding="4" cellspacing="1">
      <tr>
        <td align="right"><%Call sPageList(pageMe,sPage,PageNum,RsCount)%></td>
      </tr>
    </table>
	<%End If%>
	</td>
  </tr>
</table>
<%
End Sub

Sub ShowError()
%>
<table width="100%" height="46" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" class="Fonr_Red_14">对不起,当前无任何信息!</td>
  </tr>
</table>
<%
End Sub

Sub Admin_Default()
%>
<script language="javascript">
<!--
function CheckAdminLogin(theform) {
    var cp = /^[\w-]{4,32}$/ ;
	
	if (!cp.test(theform[0].value)) {
	    alert('您输入的密码不合法,请重新输入!') ;
		theform[0].value = "" ;
		theform[0].focus() ;
		return false ;
	}
	
	return true ;
}
//-->
</script>
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
  <form id="FireForm" name="FireForm" method="post" action="?type=Login" onsubmit="return CheckAdminLogin(this);">
  <tr>
    <td height="340" align="center"><table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#F3F3F3">
      <tr>
        <td height="32" colspan="2" align="left" class="Font_14">网页通用防火墙系统登陆 : </td>
        </tr>
      <tr>
        <td width="55%" height="48" align="right">请输入密码:
          <input name="PassWord" type="password" id="PassWord" size="25" maxlength="32" /></td>
        <td width="45%" align="left"><input type="submit" name="Submit" value="提交登陆" /></td>
      </tr>
    </table></td>
  </tr>
  </form>
</table>
<%
End Sub

Sub AdminLogout()
    Session("PassWord") = ""
	Response.Redirect(Globalfile)
End Sub

Sub sPageList(fUrl,fPage,fPageNum,fRsCount)
    Dim sLeftPage,sRightPage
	sLeftPage = fPage - 1
	sRightPage = fPage + 1
	
	Response.Write("当前<b>" & fPage & "</b>/" & fPageNum & "页 共" & fRsCount & "条记录 ")
	If fPage = 1 Then
		Response.Write("首页 上一页 <a href='" & fUrl & "page=" & sRightPage & "'>下一页</a> <a href='" & fUrl & "page=" & fPageNum & "'>尾页</a>")
	ElseIf fPage = fPageNum Then
	    Response.Write("<a href='" & fUrl & "page=1'>首页</a> <a href='" & fUrl & "page=" & sLeftPage & "'>上一页</a> 下一页 尾页")
	Else
	    Response.Write("<a href='" & fUrl & "page=1'>首页</a> <a href='" & fUrl & "page=" & sLeftPage & "'>上一页</a> <a href='" & fUrl & "page=" & sRightPage & "'>下一页</a> <a href='" & fUrl & "page=" & fPageNum & "'>尾页</a>")
	End If
	
	Response.Write(" <select name='ShowPage' id='ShowPage' onchange=""window.location='" & fUrl & "page=' + this.value ;"">")
	Dim fi
	For fi = 1 To fPageNum
	    If fPage = fi Then
		    Response.Write("<option value='" & fi & "' selected='selected'>第" & fi & "页</option>")
		Else
		    Response.Write("<option value='" & fi & "'>第" & fi & "页</option>")
		End If
	Next
	REsponse.Write("</select>")
End Sub

Function GetPage(fPage)
    If CheckEmpty(fPage) Then
	    GetPage = 1
		Exit Function
	End If
	
	If RegExpTest("^\d{1,8}$",fPage) Then
	    fPage = Cint(fPage)
		GetPage = fPage
	Else
	    GetPage = 1
	End If
End Function

Function CheckEmpty(fstrng)
    If IsNull(fstrng) Or IsEmpty(fstrng) Or fstrng = "" Then
	    CheckEmpty = True
	Else
	    CheckEmpty = False
	End If
End Function

Function RegExpTest(patrn, strng)  '正则表达式验证
    If CheckEmpty(strng) Then
	    RegExpTest = False
		Exit Function
	End If
	
	Dim regEx, retVal 
    Set regEx = New RegExp 
    regEx.Pattern = patrn 
    regEx.IgnoreCase = True 
    retVal = regEx.Test(strng) 
	
    RegExpTest = retVal '返回布尔值,不符合就返回false
	
	Set regEx = Nothing
End Function 
%>
</body>
</html>

⌨️ 快捷键说明

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