%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Response.Buffer = True Response.ExpiresAbsolute = Now() - 1 Response.Expires = 0 Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "No-Cache" Server.ScriptTimeOut = 1800 %> <% '版本号 Const sysVersion = "2.9.3" '页面标题 Const systemPageTitle = "isP-CMS中央管理平台" '打开关闭系统验证码 Const useSiteManageCode = false '系统验证码 Const SiteManageCode = "ssss" '打开关闭随机验证码 Const useCheckCode = false '系统开始日期,关系到日志查询的开始日期 Const startdate = "2010-10-22" '页面刷新频率,单位ms Const refreshRate = 10000 '打开关闭 菜单管理 和 设备管理 Const showAdmin = false '打开关闭 用户管理 Const showUserAdmin = false '打开关闭用户日志,开启此项须确保数据库中有t_user_log表存在 Const useUserLog = false '日志报表选项============================================= '是否允许多项选择 Const multiple = false '允许多项选择时限制同时选择数量 Const reportNum = 3 '选择日期限制 Const dateLimit = 5 '默认是否开启报警音 Const openSound = true '是否开启短信查询 Const allowSmsSearch = true '是否开启电话查询 Const allowTelSearch = true '是否开启Email查询 Const allowEmailSearch = false '是否打开历史记录查询 Const allowHistoryDataSearch = false Dim Action, ComeUrl Dim FoundErr, ErrMsg Dim strFiles, tUsed dim strInstallDir Dim regEx, Match, Match2, Matches, Matches2 Set regEx = New RegExp regEx.IgnoreCase = True regEx.Global = True regEx.MultiLine = True ComeUrl = FilterJs(Trim(Request("ComeUrl"))) If ComeUrl = "" Then ComeUrl = FilterJs(Trim(Request.ServerVariables("HTTP_REFERER"))) End If Action = ReplaceBadChar(Trim(Request("Action"))) Dim DatePart_D, DatePart_Y, DatePart_M, DatePart_W, DatePart_H, DatePart_Now DatePart_D = "'d'" DatePart_Y = "'yyyy'" DatePart_M = "'m'" DatePart_W = "'ww'" DatePart_H = "'h'" DatePart_Now = "Now()" Dim FileName, strFileName, MaxPerPage, CurrentPage, totalPut Dim SearchType, strField, Keyword If Request("page") <> "" Then CurrentPage = oCLng(Request("page")) Else CurrentPage = 1 End If If request("MaxPerPage")<>"" and IsNumeric(request("MaxPerPage")) then MaxPerPage = Fix(CDbl(request("MaxPerPage"))) else MaxPerPage = 20 end if Call OpenConn Dim UserTrueIP UserTrueIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR") If UserTrueIP = "" Then UserTrueIP = Request.ServerVariables("REMOTE_ADDR") UserTrueIP = ReplaceBadChar(UserTrueIP) Function GetRndPassword(PasswordLen) Dim Ran, i, strPassword strPassword = "" For i = 1 To PasswordLen Randomize Ran = CInt(Rnd * 2) Randomize If Ran = 0 Then Ran = CInt(Rnd * 25) + 97 strPassword = strPassword & UCase(Chr(Ran)) ElseIf Ran = 1 Then Ran = CInt(Rnd * 9) strPassword = strPassword & Ran ElseIf Ran = 2 Then Ran = CInt(Rnd * 25) + 97 strPassword = strPassword & Chr(Ran) End If Next GetRndPassword = strPassword End Function Function CheckBadChar(strChar) Dim strBadChar, arrBadChar, i strBadChar = "@@,+,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & ",--" arrBadChar = Split(strBadChar, ",") If strChar = "" Then CheckBadChar = False Else For i = 0 To UBound(arrBadChar) If InStr(strChar, arrBadChar(i)) > 0 Then CheckBadChar = False Exit Function End If Next End If CheckBadChar = True End Function Function ReplaceBadChar(strChar) If strChar = "" Or IsNull(strChar) Then ReplaceBadChar = "" Exit Function End If Dim strBadChar, arrBadChar, tempChar, i strBadChar = "+,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ",--" arrBadChar = Split(strBadChar, ",") tempChar = strChar For i = 0 To UBound(arrBadChar) tempChar = Replace(tempChar, arrBadChar(i), "") Next tempChar = Replace(tempChar, "@@", "@") ReplaceBadChar = tempChar End Function Dim ScriptName ScriptName = Trim(Request.ServerVariables("SCRIPT_NAME")) UserTrueIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR") If UserTrueIP = "" Then UserTrueIP = Request.ServerVariables("REMOTE_ADDR") UserTrueIP = ReplaceBadChar(UserTrueIP) Function GetScriptName() Dim ScriptName ScriptName = Trim(Request.ServerVariables("SCRIPT_NAME")) If InStr(ScriptName, "?") > 0 Then ScriptName = Left(ScriptName, InStr(ScriptName, "?")) End If GetScriptName = ScriptName End Function Function GetPostString() Dim PostString, PostItem PostString = "" If Request.Form <> "" Then PostString = PostString & "Request.Form" For Each PostItem In Request.Form PostString = PostString & PostItem & "=" & Request.Form(PostItem) & "&" Next If Right(PostString, 1) = "&" Then PostString = Left(PostString, Len(PostString) - 1) End If If Request.QueryString <> "" Then If PostString <> "" Then PostString = PostString & vbCrLf PostString = PostString & "Request.QueryString" For Each PostItem In Request.QueryString PostString = PostString & PostItem & "=" & Request.QueryString(PostItem) & "&" Next If Right(PostString, 1) = "&" Then PostString = Left(PostString, Len(PostString) - 1) End If GetPostString = PostString End Function Function oCLng(ByVal str1) If IsNumeric(str1) Then oCLng = Fix(CDbl(str1)) Else oCLng = 0 End If End Function Public Sub ShowJS_Main(ItemName) Response.Write "" & vbCrLf End Sub Function oHTMLEncode(ByVal fString) If IsNull(fString) Or Trim(fString) = "" Then oHTMLEncode = "" Exit Function End If fString = Replace(fString, ">", ">") fString = Replace(fString, "<", "<") fString = Replace(fString, Chr(32), " ") fString = Replace(fString, Chr(9), " ") fString = Replace(fString, Chr(34), """) fString = Replace(fString, Chr(39), "'") fString = Replace(fString, Chr(13), "") fString = Replace(fString, Chr(10) & Chr(10), "
")
fString = Replace(fString, Chr(10), "
")
oHTMLEncode = fString
End Function
Function ShowPage(sfilename, totalnumber, MaxPerPage, CurrentPage, ShowTotal, ShowAllPages, strUnit, ShowMaxPerPage)
Dim TotalPage, strTemp, strUrl, i
If totalnumber = 0 Or MaxPerPage = 0 Or IsNull(MaxPerPage) Then
ShowPage = ""
Exit Function
End If
If totalnumber Mod MaxPerPage = 0 Then
TotalPage = totalnumber \ MaxPerPage
Else
TotalPage = totalnumber \ MaxPerPage + 1
End If
If CurrentPage > TotalPage Then CurrentPage = TotalPage
strTemp = ""
If ShowTotal = True Then
strTemp = strTemp & "共 " & totalnumber & " " & strUnit & " "
End If
If ShowMaxPerPage = True Then
strUrl = JoinChar(sfilename) & "MaxPerPage=" & MaxPerPage & "&"
Else
strUrl = JoinChar(sfilename)
End If
If CurrentPage = 1 Then
strTemp = strTemp & "首页 | 上一页 |"
Else
strTemp = strTemp & "首页 |"
strTemp = strTemp & " 上一页 | "
End If
strTemp = strTemp & " "
If ShowAllPages = True Then
Dim Jmaxpages
If (CurrentPage - 4) <= 0 Or TotalPage < 10 Then
Jmaxpages = 1
Do While (Jmaxpages < 10)
If Jmaxpages = CurrentPage Then
strTemp = strTemp & "" & Jmaxpages & " "
Else
If strUrl <> "" Then
strTemp = strTemp & "" & Jmaxpages & " "
End If
End If
If Jmaxpages = TotalPage Then Exit Do
Jmaxpages = Jmaxpages + 1
Loop
ElseIf (CurrentPage + 4) >= TotalPage Then
Jmaxpages = TotalPage - 8
Do While (Jmaxpages <= TotalPage)
If Jmaxpages = CurrentPage Then
strTemp = strTemp & "" & Jmaxpages & " "
Else
If strUrl <> "" Then
strTemp = strTemp & "" & Jmaxpages & " "
End If
End If
Jmaxpages = Jmaxpages + 1
Loop
Else
Jmaxpages = CurrentPage - 4
Do While (Jmaxpages < CurrentPage + 5)
If Jmaxpages = CurrentPage Then
strTemp = strTemp & "" & Jmaxpages & " "
Else
If strUrl <> "" Then
strTemp = strTemp & "" & Jmaxpages & " "
End If
End If
Jmaxpages = Jmaxpages + 1
Loop
End If
End If
If CurrentPage >= TotalPage Then
strTemp = strTemp & "| 下一页 | 尾页"
Else
strTemp = strTemp & " | 下一页 |"
strTemp = strTemp & " 尾页"
End If
If ShowMaxPerPage = True Then
strTemp = strTemp & " " & strUnit & "/页"
Else
strTemp = strTemp & " " & MaxPerPage & "" & strUnit & "/页"
End If
If ShowAllPages = True Then
strTemp = strTemp & " 转到第页"
End If
ShowPage = strTemp
End Function
Function JoinChar(ByVal strUrl)
If strUrl = "" Then
JoinChar = ""
Exit Function
End If
If InStr(strUrl, "?") < Len(strUrl) Then
If InStr(strUrl, "?") > 1 Then
If InStr(strUrl, "&") < Len(strUrl) Then
JoinChar = strUrl & "&"
Else
JoinChar = strUrl
End If
Else
JoinChar = strUrl & "?"
End If
Else
JoinChar = strUrl
End If
End Function
Sub WriteSuccessMsg(sSuccessMsg, sComeUrl)
Response.Write "
恭喜你! |
" & sSuccessMsg & " |
" If sComeUrl <> "" Then Response.Write "<< 返回上一页" Else Response.Write "【关闭】" End If Response.Write " |
错误信息 |
产生错误的可能原因:" & sErrMsg & " |
" If sComeUrl <> "" Then Response.Write "<< 返回上一页" Else Response.Write "【关闭】" End If Response.Write " |