123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179 |
- <%@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
- %>
- <!--#include file="conn.asp"-->
- <%
- '版本号
- 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 "<SCRIPT language=javascript>" & vbCrLf
- Response.Write "function unselectall(){" & vbCrLf
- Response.Write " if(document.myform.chkAll.checked){" & vbCrLf
- Response.Write " document.myform.chkAll.checked = document.myform.chkAll.checked&0;" & vbCrLf
- Response.Write " }" & vbCrLf
- Response.Write "}" & vbCrLf
- Response.Write "function CheckAll(form){" & vbCrLf
- Response.Write " for (var i=0;i<form.elements.length;i++){" & vbCrLf
- Response.Write " var e = form.elements[i];" & vbCrLf
- Response.Write " if (e.Name != 'chkAll'&&e.disabled==false)" & vbCrLf
- Response.Write " e.checked = form.chkAll.checked;" & vbCrLf
- Response.Write " }" & vbCrLf
- Response.Write " }" & vbCrLf
- Response.Write "function ConfirmDel(){" & vbCrLf
- Response.Write " if(document.myform.Action.value=='Del'){" & vbCrLf
- Response.Write " if(confirm('确定要删除选中的" & ItemName & "吗?'))" & vbCrLf
- Response.Write " return true;" & vbCrLf
- Response.Write " else" & vbCrLf
- Response.Write " return false;" & vbCrLf
- Response.Write " }" & vbCrLf
- Response.Write "}" & vbCrLf
- Response.Write "</SCRIPT>" & 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), "</P><P>")
- fString = Replace(fString, Chr(10), "<BR>")
- 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 & "共 <b>" & totalnumber & "</b> " & 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 & "<a href='" & strUrl & "page=1'>首页</a> |"
- strTemp = strTemp & " <a href='" & strUrl & "page=" & (CurrentPage - 1) & "'>上一页</a> | "
- 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 & "<font color=""FF0000"">" & Jmaxpages & "</font> "
- Else
- If strUrl <> "" Then
- strTemp = strTemp & "<a href=""" & strUrl & "page=" & Jmaxpages & """>" & Jmaxpages & "</a> "
- 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 & "<font color=""FF0000"">" & Jmaxpages & "</font> "
- Else
- If strUrl <> "" Then
- strTemp = strTemp & "<a href=""" & strUrl & "page=" & Jmaxpages & """>" & Jmaxpages & "</a> "
- End If
- End If
- Jmaxpages = Jmaxpages + 1
- Loop
- Else
- Jmaxpages = CurrentPage - 4
- Do While (Jmaxpages < CurrentPage + 5)
- If Jmaxpages = CurrentPage Then
- strTemp = strTemp & "<font color=""FF0000"">" & Jmaxpages & "</font> "
- Else
- If strUrl <> "" Then
- strTemp = strTemp & "<a href=""" & strUrl & "page=" & Jmaxpages & """>" & Jmaxpages & "</a> "
- End If
- End If
- Jmaxpages = Jmaxpages + 1
- Loop
- End If
- End If
- If CurrentPage >= TotalPage Then
- strTemp = strTemp & "| 下一页 | 尾页"
- Else
- strTemp = strTemp & " | <a href='" & strUrl & "page=" & (CurrentPage + 1) & "'>下一页</a> |"
- strTemp = strTemp & "<a href='" & strUrl & "page=" & TotalPage & "'> 尾页</a>"
- End If
- If ShowMaxPerPage = True Then
- strTemp = strTemp & " <Input type='text' name='MaxPerPage' size='3' maxlength='4' value='" & MaxPerPage & "' onKeyPress=""if (event.keyCode==13) window.location='" & JoinChar(sfilename) & "page=" & CurrentPage & "&MaxPerPage=" & "'+this.value;"">" & strUnit & "/页"
- Else
- strTemp = strTemp & " <b>" & MaxPerPage & "</b>" & strUnit & "/页"
- End If
- If ShowAllPages = True Then
- strTemp = strTemp & " 转到第<Input type='text' name='page' size='3' maxlength='5' value='" & CurrentPage & "' onKeyPress=""if (event.keyCode==13) window.location='" & strUrl & "page=" & "'+this.value;"">页"
- 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 "<html><head><title>成功信息</title><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
- Response.Write "<link href='style_admin.css' rel='stylesheet' type='text/css'></head><body><br><br>" & vbCrLf
- Response.Write "<table cellpadding=2 cellspacing=1 border=0 width=400 class='border' align=center>" & vbCrLf
- Response.Write " <tr align='center' class='title'><td height='22'><strong>恭喜你!</strong></td></tr>" & vbCrLf
- Response.Write " <tr class='tdbg'><td height='100' valign='top'><br>" & sSuccessMsg & "</td></tr>" & vbCrLf
- Response.Write " <tr align='center' class='tdbg'><td>"
- If sComeUrl <> "" Then
- Response.Write "<a href='" & sComeUrl & "'><< 返回上一页</a>"
- Else
- Response.Write "<a href='javascript:window.close();'>【关闭】</a>"
- End If
- Response.Write "</td></tr>" & vbCrLf
- Response.Write "</table>" & vbCrLf
- Response.Write "</body></html>" & vbCrLf
- End Sub
- Sub WriteErrMsg(sErrMsg, sComeUrl)
- Response.Write "<html><head><title>错误信息</title><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
- Response.Write "<link href='style_main.css' rel='stylesheet' type='text/css'></head><body><br><br>" & vbCrLf
- Response.Write "<table cellpadding=2 cellspacing=1 border=0 width=400 class='border' align=center>" & vbCrLf
- Response.Write " <tr align='center' class='title'><td height='22'><strong>错误信息</strong></td></tr>" & vbCrLf
- Response.Write " <tr class='tdbg'><td height='100' valign='top'><b>产生错误的可能原因:</b>" & sErrMsg & "</td></tr>" & vbCrLf
- Response.Write " <tr align='center' class='tdbg'><td>"
- If sComeUrl <> "" Then
- Response.Write "<a href='javascript:history.go(-1)'><< 返回上一页</a>"
- Else
- Response.Write "<a href='javascript:window.close();'>【关闭】</a>"
- End If
- Response.Write "</td></tr>" & vbCrLf
- Response.Write "</table>" & vbCrLf
- Response.Write "</body></html>" & vbCrLf
- End Sub
- Function IsValidID(Check_ID)
- Dim FixID, i
- If IsNull(Check_ID) Or Check_ID = "" Then
- IsValidID = False
- Exit Function
- End If
- FixID = Replace(Check_ID, "|", "")
- FixID = Replace(FixID, ",", "")
- FixID = Replace(FixID, "-", "")
- FixID = Trim(Replace(FixID, " ", ""))
- If FixID = "" Or IsNull(FixID) Then
- IsValidID = False
- Else
- For i = 1 To Len(FixID) Step 100
- If Not IsNumeric(Mid(FixID, i, 100)) Then
- IsValidID = False
- Exit Function
- End If
- Next
- IsValidID = True
- End If
- End Function
- Function FilterJS(ByVal strInput)
- If IsNull(strInput) Or Trim(strInput) = "" Then
- FilterJS = ""
- Exit Function
- End If
- Dim reContent
- ' 替换掉HTML字符实体(Character Entities)名字和分号之间的空白字符,比如:ä ;替换成ä
- regEx.Pattern = "(&#*\w+)[\x00-\x20]+;"
- strInput = regEx.Replace(strInput, "$1;")
- ' 将无分号结束符的数字编码实体规范成带分号的标准形式
- regEx.Pattern = "(&#x*[0-9A-F]+);*"
- strInput = regEx.Replace(strInput, "$1;")
- ' 将 < > & "字符实体中的 & 替换成 & 以便在进行HtmlDecode时保留这些字符实体
- 'RegEx.Pattern = "&(amp|lt|gt|nbsp|quot);"
- 'strInput = RegEx.Replace(strInput, "&$1;")
- ' 将HTML字符实体进行解码,以消除编码字符对后续过滤的影响
- 'strInput = HtmlDecode(strInput);
- ' 将ASCII码表中前32个字符中的非打印字符替换成空字符串,保留 9、10、13、32,它们分别代表 制表符、换行符、回车符和空格。
- regEx.Pattern = "[\x00-\x08\x0b-\x0c\x0e-\x19]"
- strInput = regEx.Replace(strInput, "")
-
- oldhtmlString = ""
- Do While oldhtmlString <> strInput
- oldhtmlString = strInput
- regEx.Pattern = "(<[^>]+src[\x00-\x20]*=[\x00-\x20]*[^>]*?)&#([^>]*>)" '过虑掉 src 里的 &#
- strInput = regEx.Replace(strInput, "$1&#$2")
- regEx.Pattern = "(<[^>]+style[\x00-\x20]*=[\x00-\x20]*[^>]*?)&#([^>]*>)" '过虑掉style 里的 &#
- strInput = regEx.Replace(strInput, "$1&#$2")
- regEx.Pattern = "(<[^>]+style[\x00-\x20]*=[\x00-\x20]*[^>]*?)\\([^>]*>)" '替换掉style中的 "\"
- strInput = regEx.Replace(strInput, "$1/$2")
- Loop
- ' 替换以on和xmlns开头的属性,动易系统的几个JS需要保留
- regEx.Pattern = "on(load\s*=\s*""*'*resizepic\(this\)'*""*)"
- strInput = regEx.Replace(strInput, "off$1")
- regEx.Pattern = "on(mousewheel\s*=\s*""*'*return\s*bbimg\(this\)'*""*)"
- strInput = regEx.Replace(strInput, "off$1")
- regEx.Pattern = "(<[^>]+[\x00-\x20""'/])(on|xmlns)([^>]*)>"
- strInput = regEx.Replace(strInput, "$1pe$3>")
- regEx.Pattern = "off(load\s*=\s*""*'*resizepic\(this\)'*""*)"
- strInput = regEx.Replace(strInput, "on$1")
- regEx.Pattern = "off(mousewheel\s*=\s*""*'*return\s*bbimg\(this\)'*""*)"
- strInput = regEx.Replace(strInput, "on$1")
-
- ' 替换javascript
- regEx.Pattern = "([a-z]*)[\x00-\x20]*=[\x00-\x20]*([`'""]*)[\x00-\x20]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:"
- strInput = regEx.Replace(strInput, "$1=$2nojavascript...")
- ' 替换vbscript
- regEx.Pattern = "([a-z]*)[\x00-\x20]*=[\x00-\x20]*([`'""]*)[\x00-\x20]*v[\x00-\x20]*b[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:"
- strInput = regEx.Replace(strInput, "$1=$2novbscript...")
- '替换style中的注释部分,比如:<div style="xss:expres/*comment*/sion(alert(x))">
- regEx.Pattern = "(<[^>]+style[\x00-\x20]*=[\x00-\x20]*[^>]*?)/\*[^>]*\*/([^>]*>)"
- strInput = regEx.Replace(strInput, "$1$2")
- ' 替换expression
- regEx.Pattern = "(<[^>]+)style[\x00-\x20]*=[\x00-\x20]*([`'""]*).*[eeE][xxX][ppP][rrR][eeE][ssS][ssS][iiI][ooO][nnN][\x00-\x20]*[\(\(][^>]*>"
- strInput = regEx.Replace(strInput, "$1>")
- ' 替换behaviour
- regEx.Pattern = "(<[^>]+)style[\x00-\x20]*=[\x00-\x20]*([`'""]*).*behaviour[^>]*>>"
- strInput = regEx.Replace(strInput, "$1>")
- ' 替换behavior
- regEx.Pattern = "(<[^>]+)style[\x00-\x20]*=[\x00-\x20]*([`'""]*).*behavior[^>]*>>"
- strInput = regEx.Replace(strInput, "$1>")
- ' 替换script
- regEx.Pattern = "(<[^>]+)style[\x00-\x20]*=[\x00-\x20]*([`'""]*).*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:*[^>]*>"
- strInput = regEx.Replace(strInput, "$1>")
- ' 替换namespaced elements 不需要
- regEx.Pattern = "</*\w+:\w[^>]*>"
- strInput = regEx.Replace(strInput, " ")
- Dim oldhtmlString
- oldhtmlString = ""
- Do While oldhtmlString <> strInput
- oldhtmlString = strInput
- '实行严格过滤
- regEx.Pattern = "</*(applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base)[^>]*>?"
- strInput = regEx.Replace(strInput, " ")
- '过滤掉SHTML的Include包含文件漏洞
- regEx.Pattern = "<!--\s*#include[^>]*>"
- strInput = regEx.Replace(strInput, "noshtml")
- 'If FilterLevel > 0 Then
- ' '实行严格过滤
- ' RegEx.Pattern = "</*(embed|object)[^>]*>"
- ' strInput = RegEx.Replace(strInput, "")
- 'End If
- Loop
- FilterJS = strInput
- End Function
- Private Function IsOptionSelected(Compare1, Compare2)
- If Compare1 = Compare2 Then
- IsOptionSelected = " selected"
- Else
- IsOptionSelected = ""
- End If
- End Function
- Function IsObjInstalled(strClassString)
- On Error Resume Next
- IsObjInstalled = False
- Err = 0
- Dim xTestObj
- Set xTestObj = CreateObject(strClassString)
- If Err.Number = 0 Then IsObjInstalled = True
- Set xTestObj = Nothing
- Err = 0
- End Function
- Dim ClassID, ClassName, RootID, Depth, ParentID, ParentPath, Child, arrChildID, ClassPicUrl, ItemCount, ItemID
- Sub GetClass()
- ClassName = ""
- ParentID = 0
- ParentPath = "0"
- Child = 0
- arrChildID = ""
- If ClassID > 0 Then
- Dim tClass
- Set tClass = Conn.Execute("select * from Class where ChannelID=" & ChannelID & " and ClassType=1 " & " and ClassID=" & ClassID & "")
- If tClass.BOF And tClass.EOF Then
- FoundErr = True
- ErrMsg = ErrMsg & "<li>找不到指定的区域</li>"
- Else
- ClassName = tClass("ClassName")
- ParentID = tClass("ParentID")
- Child = tClass("Child")
- arrChildID = tClass("arrChildID")
- ClassPicUrl = tClass("ClassPicUrl")
- End If
- tClass.Close
- Set tClass = Nothing
- End If
- End Sub
- Dim ChannelID, ChannelName, ChannelShortName, ChannelItemUnit, ChannelPicUrl, ChannelUrl, UploadDir
- Dim ModuleType, ModuleName, SheetName
- Dim MaxFileSize
- ChannelID = oCLng(Trim(Request("ChannelID")))
- Sub GetChannel(tChannelID)
- Dim sqlChannel, rsChannel
- ModuleType = 0
- ChannelItemUnit = ""
- ChannelPicUrl = ""
- If tChannelID > 0 Then
- sqlChannel = "select * from Channel where ChannelID=" & tChannelID
- Set rsChannel = Conn.Execute(sqlChannel)
- If rsChannel.BOF And rsChannel.EOF Then
- FoundErr = True
- ErrMsg = ErrMsg & "找不到指定的频道"
- Else
- If rsChannel("Disabled") = True Then
- FoundErr = True
- ErrMsg = ErrMsg & "<li>此频道已经被管理员禁用!</li>"
- End If
- ChannelName = rsChannel("ChannelName")
- ChannelPicUrl = rsChannel("ChannelPicUrl")
- ChannelShortName = rsChannel("ChannelShortName")
- ChannelItemUnit = rsChannel("ChannelItemUnit")
- UploadDir = rsChannel("UploadDir")
- MaxFileSize = rsChannel("MaxFileSize")
-
- Select Case ChannelID
- Case 1
- ModuleName = "Article"
- SheetName = "article"
- Case 2
- ModuleName = "Product"
- SheetName = "product"
- Case 3
- ModuleName = "Soft"
- SheetName = "soft"
- Case 5
- ModuleName = "Fragment"
- SheetName = "fragment"
- Case 6
- ModuleName = "User"
- SheetName = "user"
- Case 7
- ModuleName = "GBook"
- SheetName = "gbook"
- Case 8
- ModuleName = "FriendLink"
- SheetName = "friendlink"
- End Select
- End If
- rsChannel.Close
- Set rsChannel = Nothing
- End If
- End Sub
- Function nohtml(ByVal str)
- If IsNull(str) Or Trim(str) = "" Then
- nohtml = ""
- Exit Function
- End If
- regEx.Pattern = "(\<.[^\<]*\>)"
- str = regEx.Replace(str, "")
- regEx.Pattern = "(\<\/[^\<]*\>)"
- str = regEx.Replace(str, "")
- regEx.Pattern = "\[NextPage(.*?)\]"
- str = regEx.Replace(str, "")
-
- str = Replace(str, "'", "")
- str = Replace(str, Chr(34), "")
- str = Replace(str, vbCrLf, "")
- str = Trim(str)
- nohtml = str
- End Function
- Function FoundInArr(strArr, strItem, strSplit)
- Dim arrTemp, arrTemp2, i, j
- FoundInArr = False
- If IsNull(strArr) Or IsNull(strItem) Or Trim(strArr) = "" Or Trim(strItem) = "" Then
- Exit Function
- End If
- If IsNull(strSplit) Or strSplit = "" Then
- strSplit = ","
- End If
- If InStr(Trim(strArr), strSplit) > 0 Then
- If InStr(Trim(strItem), strSplit) > 0 Then
- arrTemp = Split(strArr, strSplit)
- arrTemp2 = Split(strItem, strSplit)
- For i = 0 To UBound(arrTemp)
- For j = 0 To UBound(arrTemp2)
- If LCase(Trim(arrTemp2(j))) <> "" And LCase(Trim(arrTemp(i))) <> "" And LCase(Trim(arrTemp2(j))) = LCase(Trim(arrTemp(i))) Then
- FoundInArr = True
- Exit Function
- End If
- Next
- Next
- Else
- arrTemp = Split(strArr, strSplit)
- For i = 0 To UBound(arrTemp)
- If LCase(Trim(arrTemp(i))) = LCase(Trim(strItem)) Then
- FoundInArr = True
- Exit Function
- End If
- Next
- End If
- Else
- If LCase(Trim(strArr)) = LCase(Trim(strItem)) Then
- FoundInArr = True
- End If
- End If
- End Function
- Public Function RadioValue(compvalue, showvalue)
- If compvalue = showvalue Then
- RadioValue = "value='" & showvalue & "' checked"
- Else
- RadioValue = "value='" & showvalue & "'"
- End If
- End Function
- '**************************************************
- '函数名:XmlText
- '作 用:从语言包中读取指定节点的值
- '参 数:iBigNode ---- 大节点
- ' iSmallNode ---- 小节点
- ' DefChar ---- 默认值
- '返回值:语言包中指定节点的值
- '**************************************************
- Function XmlText(ByVal iBigNode, ByVal iSmallNode, ByVal DefChar)
- Dim LangRoot, LangSub
- If IsNull(iBigNode) Or IsNull(iSmallNode) Then
- XmlText = DefChar
- Else
- Set LangRoot = XmlDoc.getElementsByTagName(iBigNode)
- If LangRoot.Length = 0 Then
- XmlText = DefChar
- Else
- Set LangSub = LangRoot(0).getElementsByTagName(iSmallNode)
- If LangSub.Length = 0 Then
- XmlText = DefChar
- Else
- XmlText = LangSub(0).text
- End If
- End If
- Set LangRoot = Nothing
- End If
- End Function
- '===============================================================================================================================================
- '=====报警系列===================================================================================================================================
- '===============================================================================================================================================
- '空调自启动--------------------------------------------------------------------------------------------------------------------------------------
- function status_AirSinceTheStart(varname)
- if checkAllowedAlarm(varname) = 0 then exit function
- dim strAirSinceTheStart
- if sqlSumLog(varname) = 10000 then
- strAirSinceTheStart = "<img src='images/statusOffline.png' />"
- elseif sqlVar(varname) = 10000 then
- strAirSinceTheStart = "<img src='images/statusOffline.png' />"
- else
- strAirSinceTheStart = "<img src='images/statusNormal.png' />"
- if sqlSumLog(varname) <> sqlVar(varname) then strAirSinceTheStart = "<img src='images/statusAlarm.gif' />"
- end if
- status_AirSinceTheStart = strAirSinceTheStart
- end function
- function status_AirSinceTheStart_noCheck(varname)
- dim strAirSinceTheStart
- if sqlSumLog(varname) = 10000 then
- strAirSinceTheStart = "<img src='images/statusOffline.png' />"
- elseif sqlVar(varname) = 10000 then
- strAirSinceTheStart = "<img src='images/statusOffline.png' />"
- else
- strAirSinceTheStart = "<img src='images/statusNormal.png' />"
- if sqlSumLog(varname) <> sqlVar(varname) then strAirSinceTheStart = "<img src='images/statusAlarm.gif' />"
- end if
- status_AirSinceTheStart_noCheck = strAirSinceTheStart
- end function
- '---------------------------------------------------------------------------------------------------------------------------------
- '漏水,单变量
- function status_Leak(var1,offLine,normal,alarm)
- if checkAllowedAlarm(var1) = 0 then exit function
- dim strLeak
- if sqlSumLog(var1) = 10000 then
- strLeak = "<img src='images/"&offLine&".gif' />"
- elseif sqlVar(var1) = 10000 then
- strLeak = "<img src='images/"&offLine&".gif' />"
- else
- strLeak = "<img src='images/"&normal&".gif' />"
- if sqlSumLog(var1) <> sqlVar(var1) then strLeak = "<img src='images/"&alarm&".gif' />"
- end if
- status_Leak = strLeak
- end function
- '漏水,不定位,双参数
- function status_Leak2(var1,var2,offLine,normal,alarm)
- if checkAllowedAlarm(var1) = 0 and checkAllowedAlarm(var1) = 0 then exit function
- dim strLeak
- if sqlSumLog(var1) = 10000 or sqlSumLog(var2) = 10000 then
- strLeak = "<img src='images/"&offLine&".gif' />"
- else
- strLeak = "<img src='images/"&normal&".gif' />"
- if sqlSumLog(var1) <> sqlVar(var1) or sqlSumLog(var2) <> sqlVar(var2) then strLeak = "<img src='images/"&alarm&".gif' />"
- end if
- status_Leak2 = strLeak
- end function
- '------------------------------------------------------------------------------------------------------------------------------------------------
- '温度
- function status_Temp(varconn,varname)
- if checkAllowedAlarm(varconn) = 0 and checkAllowedAlarm(varname) = 0 then exit function
-
- dim strTemp
-
- if sqlSumLog(varconn) = 10000 or sqlSumLog(varconn) <> sqlVar(varconn) then
- strTemp = "<span style='color:gray;'>-</span>"
- elseif sqlSumLog(varname) = 10000 then
- strTemp = "-"
- else
- if sqlVarUp(varname) = 0 and sqlVarLow(varname) = 0 then
- strTemp = FormatNumber(sqlSumLog(varname),1,-1)
- else
- if sqlSumLog(varname) < sqlVarLow(varname) then
- strTemp = "<span style='color:red;background:url(images/alertBg.gif)'>" & FormatNumber(sqlSumLog(varname),1,-1) & "</span>"
- elseif sqlSumLog(varname) > sqlVarUp(varname) then
- strTemp = "<span style='color:red;background:url(images/alertBg.gif)'>" & FormatNumber(sqlSumLog(varname),1,-1) & "</span>"
- else
- strTemp = FormatNumber(sqlSumLog(varname),1,-1)
- end if
- end if
- end if
-
- status_Temp = strTemp ' & " ℃"
-
- end function
- '湿度
- function status_rsHumidity(varconn,varname)
- if checkAllowedAlarm(varconn) = 0 and checkAllowedAlarm(varname) = 0 then exit function
-
- dim strHumidity
-
- if sqlSumLog(varconn) = 10000 or sqlSumLog(varconn) <> sqlVar(varconn) then
- strHumidity = "<span style='color:gray;'>-</span>"
- elseif sqlSumLog(varname) = 10000 then
- strHumidity = "-"
- else
- if sqlVarUp(varname) = 0 and sqlVarLow(varname) = 0 then
- strHumidity = FormatNumber(sqlSumLog(varname),1,-1)
- else
- if sqlSumLog(varname) < sqlVarLow(varname) then
- strHumidity = "<span style='color:red;background:url(images/alertBg.gif)'>" & FormatNumber(sqlSumLog(varname),1,-1) & "</span>"
- elseif sqlSumLog(varname) > sqlVarUp(varname) then
- strHumidity = "<span style='color:red;background:url(images/alertBg.gif)'>" & FormatNumber(sqlSumLog(varname),1,-1) & "</span>"
- else
- strHumidity = FormatNumber(sqlSumLog(varname),1,-1)
- end if
- end if
- end if
-
- status_rsHumidity = strHumidity ' & "<span style='margin-left:-3px;'> %</span>"
-
- end function
- '-------------------------------------------------------------------------------------------------------------------------------------------------------
- 'CRAC状态
- function statusCRAC()
- dim strstatusCRAC, arrVar, i
- if sqlSumLog("Air_3") = 10000 then '无数据显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog("Air_3") <> sqlVar("Air_3") then '有数据与normalstate不等显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- else
- strstatusCRAC = "<img src='images/statusNormal.gif'>" '否则显示正常
- '判断是否有报警
- arrVar = Array("Air_9","Air_10","Air_34","Air_35","Air_11","Air_12","Air_13","Air_14","Air_15","Air_16","Air_17","Air_18","Air_23","Air_24","Air_CommStatus")
- for i = 0 to ubound(arrVar)
- if checkAllowedAlarm(arrVar(i)) = 1 and sqlSumLog(arrVar(i)) <> 10000 and sqlSumLog(arrVar(i)) <> sqlVar(arrVar(i)) then strstatusCRAC = "<img src='images/statusAlarm.gif'>"
- next
- end if
- statusCRAC = strstatusCRAC
- end function
- 'CRAC-EmersonCM-市委1.1
- function statusCRACEmersonCM(statusOpen,statusCom,var1,var2,var3,var4,var5,var6,var7,var8,var9)
- dim strstatusCRAC, arrVar, i
- if sqlSumLog(statusOpen) = 10000 then '无数据显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusOpen) <> sqlVar(statusOpen) then '有数据与normalstate不等显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom) = 10000 then '无数据显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom) <> sqlVar(statusCom) then '有数据与normalstate不等显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- else
- strstatusCRAC = "<img src='images/statusNormal.gif'>" '否则显示正常
- '判断是否有报警
- arrVar = Array(var1,var2,var3,var4,var5,var6,var7,var8,var9)
- for i = 0 to ubound(arrVar)
- if checkAllowedAlarm(arrVar(i)) = 1 and sqlSumLog(arrVar(i)) <> 10000 and sqlSumLog(arrVar(i)) <> sqlVar(arrVar(i)) then strstatusCRAC = "<img src='images/statusAlarm.gif'>"
- next
- end if
- statusCRACEmersonCM = strstatusCRAC
- end function
- 'CRAC-EmersonCM-市委3.5
- function statusDME30003(statusOpen,statusCom,statusCom2,var1,var2,var3,var4,var5,var6)
- dim strstatusCRAC, arrVar, i
- if sqlSumLog(statusOpen) = 10000 then '无数据显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusOpen) <> sqlVar(statusOpen) then '有数据与normalstate不等显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom) = 10000 then '无数据显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom) <> sqlVar(statusCom) then '有数据与normalstate不等显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom2) = 10000 then '无数据显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom2) <> sqlVar(statusCom2) then '有数据与normalstate不等显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- else
- strstatusCRAC = "<img src='images/statusNormal.gif'>" '否则显示正常
- '判断是否有报警
- arrVar = Array(var1,var2,var3,var4,var5,var6)
- for i = 0 to ubound(arrVar)
- if checkAllowedAlarm(arrVar(i)) = 1 and sqlSumLog(arrVar(i)) <> 10000 and sqlSumLog(arrVar(i)) <> sqlVar(arrVar(i)) then strstatusCRAC = "<img src='images/statusAlarm.gif'>"
- next
- end if
- statusDME30003 = strstatusCRAC
- end function
- 'DME3000
- function statusDME3000(statusOpen,var1,var2,var3,var4,var5,var6)'statusCom,statusCom2,
- dim strstatusCRAC, arrVar, i
- if statusOpen <> "" and sqlSumLog(statusOpen) = 10000 then '无数据显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif statusOpen <> "" and sqlSumLog(statusOpen) <> sqlVar(statusOpen) then '有数据与normalstate不等显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- ' elseif statusCom <> "" and sqlSumLog(statusCom) = 10000 then '无数据显示离线
- ' strstatusCRAC = "<img src='images/statusOffline.gif'>"
- ' elseif statusCom <> "" and sqlSumLog(statusCom) <> sqlVar(statusCom) then '有数据与normalstate不等显示离线
- ' strstatusCRAC = "<img src='images/statusOffline.gif'>"
- ' elseif statusCom2 <> "" and sqlSumLog(statusCom2) = 10000 then '无数据显示离线
- ' strstatusCRAC = "<img src='images/statusOffline.gif'>"
- ' elseif statusCom2 <> "" and sqlSumLog(statusCom2) <> sqlVar(statusCom2) then '有数据与normalstate不等显示离线
- ' strstatusCRAC = "<img src='images/statusOffline.gif'>"
- else
- strstatusCRAC = "<img src='images/statusNormal.gif'>" '否则显示正常
- '判断是否有报警
- arrVar = Array(var1,var2,var3,var4,var5,var6)
- for i = 0 to ubound(arrVar)
- if checkAllowedAlarm(arrVar(i)) = 1 and sqlSumLog(arrVar(i)) <> 10000 and sqlSumLog(arrVar(i)) <> sqlVar(arrVar(i)) then strstatusCRAC = "<img src='images/statusAlarm.gif'>"
- next
- end if
- statusDME3000 = strstatusCRAC
- end function
- 'CRAC-EmersonCM-市委3.4
- function statusAC(statusOpen,statusCom)
- dim strstatusCRAC, arrVar, i
- if sqlSumLog(statusOpen) = 10000 then '无数据显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusOpen) <> sqlVar(statusOpen) then '有数据与normalstate不等显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom) = 10000 then '无数据显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom) <> sqlVar(statusOpen) then '有数据与normalstate不等显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- else
- strstatusCRAC = "<img src='images/statusNormal.gif'>" '否则显示正常
- end if
- statusAC = strstatusCRAC
- end function
- 'Emerson P1030
- function statusP1030(statusOpen,statusCom,var1,var2)
- dim strstatusCRAC, arrVar, i
- if statusOpen <> -1 and sqlSumLog(statusOpen) = 10000 then '无数据显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif statusOpen <> -1 and sqlSumLog(statusOpen) <> sqlVar(statusOpen) then '有数据与normalstate不等显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif statusCom <> "" and sqlSumLog(statusCom) = 10000 then '无数据显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- elseif statusCom <> "" and sqlSumLog(statusCom) <> sqlVar(statusCom) then '有数据与normalstate不等显示离线
- strstatusCRAC = "<img src='images/statusOffline.gif'>"
- ' elseif statusCom2 <> -1 and sqlSumLog(statusCom2) = 10000 then '无数据显示离线
- ' strstatusCRAC = "<img src='images/statusOffline.gif'>"
- ' elseif statusCom2 <> -1 and sqlSumLog(statusCom2) <> sqlVar(statusCom2) then '有数据与normalstate不等显示离线
- ' strstatusCRAC = "<img src='images/statusOffline.gif'>"
- else
- strstatusCRAC = "<img src='images/statusNormal.gif'>" '否则显示正常
- '判断是否有报警
- arrVar = Array(var1,var2)
- for i = 0 to ubound(arrVar)
- if checkAllowedAlarm(arrVar(i)) = 1 and sqlSumLog(arrVar(i)) <> 10000 and (sqlSumLog(arrVar(i)) < sqlVarLow(arrVar(i)) or sqlSumLog(arrVar(i)) > sqlVarUp(arrVar(i))) then strstatusCRAC = "<img src='images/statusAlarm.gif'>"
- next
- end if
- statusP1030 = strstatusCRAC
- end function
- 'UPS-------------------------------------------------------------------------------------------------------------------------------------------------------
- 'UPS-MGE-市委1.1
- function statusUPSMGE(statusCom,var1,var2,var3)
- dim strstatusUPS, arrVar, i
- if sqlSumLog(statusCom) = 10000 then '无数据显示离线
- strstatusUPS = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom) <> sqlVar(statusCom) then '有数据与normalstate不等显示离线
- strstatusUPS = "<img src='images/statusOffline.gif'>"
- else
- strstatusUPS = "<img src='images/statusNormal.gif'>" '否则显示正常
- '判断是否有报警
- arrVar = Array(var1,var2,var3)
- for i = 0 to ubound(arrVar)
- if checkAllowedAlarm(arrVar(i)) = 1 and sqlSumLog(arrVar(i)) <> 10000 and sqlSumLog(arrVar(i)) <> sqlVar(arrVar(i)) then strstatusUPS = "<img src='images/statusAlarm.gif'>"
- next
- end if
- statusUPSMGE = strstatusUPS
- end function
- 'UPS-APC_Smart-市委3.4
- function statusUPSAPCSmart(statusCom,var1,var2)
- dim strstatusUPS, arrVar, i
- if sqlSumLog(statusCom) = 10000 then '无数据显示离线
- strstatusUPS = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom) <> sqlVar(statusCom) then '有数据与normalstate不等显示离线
- strstatusUPS = "<img src='images/statusOffline.gif'>"
- else
- strstatusUPS = "<img src='images/statusNormal.gif'>" '否则显示正常
- '判断是否有报警
- if checkAllowedAlarm(var1) = 1 and sqlSumLog(var1) <> 10000 and sqlSumLog(var1) <> sqlVar(var1) then strstatusUPS = "<img src='images/statusAlarm.gif'>"
- if checkAllowedAlarm(var2) = 1 and sqlSumLog(var2) <> 10000 and (sqlSumLog(var2) = 3 or sqlSumLog(var2) = 6 or sqlSumLog(var2) = 9 or sqlSumLog(var2) = 10) then strstatusUPS = "<img src='images/statusAlarm.gif'>"
- end if
- statusUPSAPCSmart = strstatusUPS
- end function
- 'UPS-MGE-市委3.5
- function statusUHK2L41U112(statusOpen,statusCom,var1,var2,var3,var4,var5,var6,var7,var8,var9,var10)
- dim strstatusUPS, arrVar, i
- if sqlSumLog(statusOpen) = 10000 then '无数据显示离线
- strstatusUPS = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusOpen) <> sqlVar(statusOpen) then '有数据与normalstate不等显示离线
- strstatusUPS = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom) = 10000 then '无数据显示离线
- strstatusUPS = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(statusCom) <> sqlVar(statusCom) then '有数据与normalstate不等显示离线
- strstatusUPS = "<img src='images/statusOffline.gif'>"
- else
- strstatusUPS = "<img src='images/statusNormal.gif'>" '否则显示正常
- '判断是否有报警
- arrVar = Array(var1,var2,var3,var4,var5,var6,var7,var8,var9,var10)
- for i = 0 to ubound(arrVar)
- if checkAllowedAlarm(arrVar(i)) = 1 and sqlSumLog(arrVar(i)) <> 10000 and sqlSumLog(arrVar(i)) <> sqlVar(arrVar(i)) then strstatusUPS = "<img src='images/statusAlarm.gif'>"
- next
- end if
- statusUHK2L41U112 = strstatusUPS
- end function
- 'UPS-MGE-市委3.5
- function statusUL33(var1,var2,var3,var4,var5)
- dim strstatusUPS, arrVar, i
- strstatusUPS = "<img src='images/statusNormal.gif'>" '否则显示正常
- '判断是否有报警
- arrVar = Array(var1,var2,var3,var4,var5)
- for i = 0 to ubound(arrVar)
- if checkAllowedAlarm(arrVar(i)) = 1 and sqlSumLog(arrVar(i)) <> 10000 and sqlSumLog(arrVar(i)) <> sqlVar(arrVar(i)) then strstatusUPS = "<img src='images/statusAlarm.gif'>"
- next
- statusUL33 = strstatusUPS
- end function
- 'UPS_APC
- function statusUPS_APC(var1, var2)
- dim strUPS, check1, check2
- check1 = checkAllowedAlarm(var1)
- check2 = checkAllowedAlarm(var2)
- if check1 = 0 and check2 = 0 then exit function
-
- strUPS = "<img src='images/statusNormal.gif'>"
- if check1 = 1 then
- if sqlSumLog(var1) = 10000 then strUPS = "<img src='images/statusOffline.gif'>"
- if sqlSumLog(var1) = 3 or sqlSumLog(var1) = 6 or sqlSumLog(var1) = 7 or sqlSumLog(var1) = 9 or sqlSumLog(var1) = 10 then strUPS = "<img src='images/statusAlarm.gif'>"
- end if
- if check2 = 1 then
- if sqlSumLog(var2) <> 10000 and sqlSumLog(var2) = 3 then strUPS = "<img src='images/statusAlarm.gif'>"
- end if
- statusUPS_APC = strUPS
- end function
- '--------------------------------------------------------------------------------------------------------------------------------------------------------
- '机房电压异常报警/干结点信号
- function statusVoltage(varname)
- if checkAllowedAlarm(varname) = 0 then exit function
- dim strVoltage
- strVoltage = "<img src='images/statusNormal.gif'>"
- if sqlSumLog(varname) = 10000 then strVoltage = "<img src='images/statusOffline.gif'>"
- if sqlSumLog(varname) <> 10000 and sqlSumLog(varname) <> sqlVar(varname) then strVoltage = "<img src='images/statusAlarm.gif'>"
- statusVoltage = strVoltage
- end function
- function statusVoltage2(varconn,varname)
- if checkAllowedAlarm(varconn) = 0 and checkAllowedAlarm(varname) = 0 then exit function
- dim strVoltage
- if sqlSumLog(varconn) = 10000 or sqlSumLog(varconn) <> sqlVar(varconn) then
- strVoltage = "<img src='images/statusOffline.gif'>"
- else
- if sqlSumLog(varname) = 10000 then
- strVoltage = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(varname) <> 10000 and sqlSumLog(varname) <> sqlVar(varname) then
- strVoltage = "<img src='images/statusAlarm.gif'>"
- else
- strVoltage = "<img src='images/statusNormal.gif'>"
- end if
- end if
- statusVoltage2 = strVoltage
- end function
- '网络状态,市委,如果勾选不报警则显示常绿
- function statusVoltage3(varname)
- if checkAllowedAlarm(varname) = 0 then
- strVoltage = "<img src='images/statusNormal.gif'>"
- else
- dim strVoltage
- strVoltage = "<img src='images/statusNormal.gif'>"
- if sqlSumLog(varname) = 10000 then strVoltage = "<img src='images/statusOffline.gif'>"
- if sqlSumLog(varname) <> 10000 and sqlSumLog(varname) <> sqlVar(varname) then strVoltage = "<img src='images/statusAlarm.gif'>"
- end if
- statusVoltage3 = strVoltage
- end function
- '灯光
- function statusLight(varname)
- 'if checkAllowedAlarm(varname) = 0 then exit function
- dim strLight
- if sqlSumLog(varname) = 10000 then
- strLight = "<img src='images/statusOffline.gif'>"
- elseif sqlSumLog(varname) <> 10000 and sqlSumLog(varname) = 1 then
- strLight = "<img src='images/statusLight.gif'>"
- else
- strLight = "<img src='images/statusOffline.gif'>"
- end if
- statusLight = strLight
- end function
- '从t_summary_log读取当前值,没有值则返回10000,否则返回当前值
- function sqlSumLog(varname)
- dim rsSqlSumLog
- set rsSqlSumLog = conn.execute("select curr_value from t_summary_log where varname = '"&varname&"'")
- if rsSqlSumLog.bof and rsSqlSumLog.eof then
- sqlSumLog = 10000
- elseif rsSqlSumLog(0) = -1 then
- sqlSumLog = 10000
- else
- sqlSumLog = rsSqlSumLog(0)
- end if
- rsSqlSumLog.close
- set rsSqlSumLog = nothing
- end function
- '从t_dev_variant读取normalstate,没有值则返回10000,否则返回当前值
- function sqlVar(varname)
- dim rsSqlVar
- set rsSqlVar = conn.execute("select normalstate from t_dev_variant where varname = '"&varname&"'")
- if rsSqlVar.bof and rsSqlVar.eof then
- sqlVar = 10000
- else
- sqlVar = rsSqlVar(0)
- end if
- rsSqlVar.close
- set rsSqlVar = nothing
- end function
- '从t_dev_variant读取下限,没有值则返回10000,否则返回当前值
- function sqlVarLow(varname)
- dim rsSqlVar
- set rsSqlVar = conn.execute("select lowerlimit from t_dev_variant where varname = '"&varname&"'")
- if rsSqlVar.bof and rsSqlVar.eof then
- sqlVarLow = 10000
- else
- sqlVarLow = rsSqlVar(0)
- end if
- rsSqlVar.close
- set rsSqlVar = nothing
- end function
- '从t_dev_variant读取上限,没有值则返回10000,否则返回当前值
- function sqlVarUp(varname)
- dim rsSqlVar
- set rsSqlVar = conn.execute("select upperlimit from t_dev_variant where varname = '"&varname&"'")
- if rsSqlVar.bof and rsSqlVar.eof then
- sqlVarUp = 10000
- else
- sqlVarUp = rsSqlVar(0)
- end if
- rsSqlVar.close
- set rsSqlVar = nothing
- end function
- function checkAllowedAlarm(varname)
- dim rsCheck
- set rsCheck = conn.execute("select boolreserved2 from t_dev_variant where varname = '"&varname&"'")
- if rsCheck.bof and rsCheck.eof then
- checkAllowedAlarm = 0
- else
- checkAllowedAlarm = rsCheck(0)
- end if
- rsCheck.close
- set rsCheck = nothing
- end function
- %>
|