| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- <!--#include file="common.asp"-->
- <!--#include file="CheckComeUrl.asp"-->
- <%
- Dim uid, rsRole, isAdmin, psql, rsp, arealist, arealist_arr, userGroupID0
- uid = trim(request("uid"))
- if Lcase(AdminName) = "admin" then
- isAdmin = true
- else
- isAdmin = false
- set userGroupID0 = conn.execute("select group_id from t_role_user where userid = '" & trim(AdminName) & "'")
- psql = "select t_classid,parentpath from t_area where t_classid in (select areaid from t_dev_property where uid in (select uid from t_role_equip where group_id = " & userGroupID0(0) & "))"
- set rsp = conn.execute(psql)
- if rsp.bof and rsp.eof then
- arealist = ""
- else
- do while not rsp.eof
- if arealist = "" then
- arealist = rsp(0) & "," & rsp(1)
- else
- arealist = arealist & "," & rsp(0) & "," & rsp(1)
- end if
- rsp.movenext
- loop
- end if
- rsp.close
- set rsp = nothing
- if arealist = "" then arealist = "0"
- end if
- %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title><%=systemPageTitle%></title>
- <link href="bs2010.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="js/share.js"></script>
- <link rel="stylesheet" href="jquery.treeview.css" />
- <link rel="stylesheet" href="screen.css" />
- <script src="lib/jquery.js" type="text/javascript"></script>
- <script src="lib/jquery.cookie.js" type="text/javascript"></script>
- <script src="jquery.treeview.js" type="text/javascript"></script>
- <script type="text/javascript" src="demo.js"></script>
- <script language="javascript">
- function changeVoiceAlarm()
- {
- if(document.getElementById("voiceAlarm").checked == true)
- {
- document.cookie = "voiceAlarm" + "=" + escape("on");
- }
- else
- {
- document.cookie = "voiceAlarm" + "=" + escape("off");
- }
- window.parent['main'].location.reload();
- }
- </script>
- <style>
- html, body {
- overflow-x: hidden;
- overflow-y:auto;
- }
- </style>
- </head>
- <body style="background:url(images/2010_leftbg.gif) left top no-repeat">
- <div style="line-height:180%;margin-top:20px;font-weight:bold;" class="leftMenu"> <a href="index_main.asp" target="main">首页</a></div>
- <div><img src='images/2010_leftLine.png'></div>
- <div id="main">
- <%
- dim rsClass
- set rsClass = conn.execute("select t_classid, classname, child, parentid, classpicurl from t_area where parentid = 0 order by rootid")
-
- response.write "<ul id='navigation' class='leftMenu'>"
- if rsClass.bof and rsClass.eof then
- response.write "<span> 没有菜单</span>"
- else
- call subTree(0, " |-")
- end if
- response.write "</ul>"
- %>
- </div>
- <div style="height:30px;"></div>
- <div style=" position:absolute; z-index:20; background:#FFF; bottom:0px; width:180px; padding-left:20px; padding-bottom:10px;"><label style=" cursor:pointer;">
- <input type="checkbox" name="voiceAlarm" id="voiceAlarm" value="voiceAlarm" onclick="changeVoiceAlarm();" <%if request.Cookies("voiceAlarm") = "on" then response.write "checked"%> />
- 启用BS声音报警</label></div>
- <%
- sub subTree(parentid,str)
- dim rsSubClass, sql
- if isAdmin = false then
- sql = "select t_classid, classname, child, parentid, classpicurl from t_area where parentid = " & parentid & " and t_classid in (" & arealist & ") order by rootid"
- else
- sql = "select t_classid, classname, child, parentid, classpicurl from t_area where parentid = " & parentid & " order by rootid"
- end if
- set rsSubClass = conn.execute(sql)
- if rsSubClass.bof and rsSubClass.eof then
- response.write "<li><span style='margin-left:20px'>无设备</span></li>"
- else
- do while not rsSubClass.eof
- if isAdmin = false then
- response.write "<li class='open'><span>"
-
- if rsSubClass("parentid") = 0 then
- response.write " "
- else
- response.write str
- end if
-
- if rsSubClass("ClassPicUrl") <> "" then
- response.write "<a href='" & rsSubClass("ClassPicUrl")& "?id=" & rsSubClass("t_classid") & "' target='main'>"
- else
- response.write "<a href='javascript:;'>"
- end if
-
- if rsSubClass("parentid") = 0 then response.write "<strong>"
- response.write "<img src='images/tree_folder4.gif'>"
- response.write rsSubClass("classname")
- if rsSubClass("parentid") = 0 then response.write "</strong>"
- response.write "</a></span><ul>"
-
- if rsSubClass("child") <> 0 then
- call subTree(rsSubClass("t_classid"), " " & str)
- else
- call devList(rsSubClass("t_classid"), " " & str)
- end if
-
- response.write "</ul></li>"
- if rsSubClass("parentid") = 0 then response.write "<div style='padding-left:16px;'><img src='images/2010_leftLine.png'></div>"
-
- rsSubClass.movenext
- if rsSubClass.eof then
- rsSubClass.close
- exit sub
- end if
- else
- response.write "<li class='open'><span>"
-
- if rsSubClass("parentid") = 0 then
- response.write " "
- else
- response.write str
- end if
-
- if rsSubClass("ClassPicUrl") <> "" then
- response.write "<a href='" & rsSubClass("ClassPicUrl")& "?id=" & rsSubClass("t_classid") & "' target='main'>"
- else
- response.write "<a href='javascript:;'>"
- end if
-
- if rsSubClass("parentid") = 0 then response.write "<strong style='line-height:180%;'>"
- response.write "<img src='images/tree_folder4.gif'>"
- response.write rsSubClass("classname")
- if rsSubClass("parentid") = 0 then response.write "</strong>"
- response.write "</a></span><ul>"
-
- if rsSubClass("child") <> 0 then
- call subTree(rsSubClass("t_classid"), " " & str)
- else
- call devList(rsSubClass("t_classid"), " " & str)
- end if
-
- response.write "</ul></li>"
- if rsSubClass("parentid") = 0 then response.write "<div style='padding-left:16px;'><img src='images/2010_leftLine.png'></div>"
-
- rsSubClass.movenext
- if rsSubClass.eof then
- rsSubClass.close
- exit sub
- end if
- end if
- loop
- end if
- end sub
-
- sub devList(classid, str)
-
- if isAdmin = false then
-
- dim rsR, iList, userGroupID
- set userGroupID = conn.execute("select group_id from t_role_user where userid = '" & trim(AdminName) & "'")
- set rsR = conn.execute("select uid from t_role_equip where group_id = " & userGroupID(0) & " order by uid")
- if rsR.bof and rsR.eof then
- response.write "<li>" & str & "无权限<li>"
- else
- do while not rsR.eof
-
- dim rsdl, sqldl
- sqldl = "select * from t_dev_property where areaid = " & classid & " and uid = '" & rsR(0) & "' and isuse = '1' order by uid, devicename"
- set rsdl = server.CreateObject("adodb.recordset")
- rsdl.open sqldl, conn, 1, 1
- do while not rsdl.eof
- response.write "<li class='equiplink'>" & str & "<a href='index_main.asp?uid=" & rsdl("uid") & "' target='main'>"
- if instr(rsdl("devicename"),"(") <> 0 then
- response.write left(rsdl("devicename"),instr(rsdl("devicename"),"(")-1)
- else
- response.write rsdl("devicename")
- end if
- response.write "</a></li>"
- rsdl.movenext
- loop
- rsdl.close
- set rsdl = nothing
-
- rsR.movenext
- loop
- end if
- rsR.close
- set rsR = nothing
-
- else
- sqldl = "select * from t_dev_property where areaid = " & classid & " and isuse = '1' order by uid,devicename"
- set rsdl = server.CreateObject("adodb.recordset")
- rsdl.open sqldl, conn, 1, 1
- if rsdl.bof and rsdl.eof then
- response.write "<li>" & str & "无设备</li>"
- else
- do while not rsdl.eof
- response.write "<li class='equiplink'><div>" & str & "<a href='index_main.asp?uid=" & rsdl("uid") & "' target='main'>"
- if instr(rsdl("devicename"),"(") <> 0 then
- response.write left(rsdl("devicename"),instr(rsdl("devicename"),"(")-1)
- else
- response.write rsdl("devicename")
- end if
- response.write "</a></div></li>"
- rsdl.movenext
- loop
- end if
- rsdl.close
- set rsdl = nothing
- end if
- end sub
- %>
- </body>
- </html>
- <%
- Call CloseConn
- function inArr(id,arr)
- dim i
- for i = lbound(arr) to ubound(arr)
- if int(id) = int(arr(i)) then
- inArr = true
- exit function
- end if
- next
- inArr = false
- end function
- %>
|