<% Dim uid, rsRole, isAdmin, rsgan uid = trim(request("uid")) if trim(Lcase(AdminName)) = "admin" then isAdmin = true else isAdmin = false end if %> <%=systemPageTitle%>

数据载入中……

设备管理

<% Action = request("Action") select case Action case "Modify" call Modify case "SaveModify" call SaveModify case "doMoveToClass" call doMoveToClass case else call main end select sub main() %>
<% dim rse, sqle, t_classid t_classid = trim(request("t_classid")) if t_classid = "" then sqle = "select id, devicename, areaid from t_dev_property order by areaid, devicename" else sqle = "select id, devicename, areaid from t_dev_property where areaid = " & t_classid & " and uid in (select uid from t_dev_property where isuse = '1') order by devicename" end if set rse = server.CreateObject("adodb.recordset") rse.open sqle, conn, 1, 1 if rse.bof and rse.eof then %> <% else do while not rse.eof %> <% rse.movenext loop end if rse.close set rse = nothing %>
选中 ID 所属区域 - 显示全部 设备名称 操作
没有设备
<%=rse("id")%> ">
"> <% set rsgan = conn.execute("select t_classid, parentpath from t_area where t_classid = " & rse("areaid")) response.write GetPath(rsgan(0), rsgan(1)) %>
<%=rse("devicename")%> ">修改
选中本页显示的所有设备 将选中的设备移动到
<% end sub sub modify() dim rsem, id id = trim(request("id")) set rsem = conn.execute("select * from t_dev_property where id = " & id) if rsem.bof and rsem.eof then response.write "error" else %>
<%=rsem("id")%> <%=rsem("devicename")%> " />   
<% end if end sub sub SaveModify() dim id, areaid, devicename, rssm, sqlsm id = trim(request("ID")) areaid = trim(request("areaid")) 'devicename = trim(request("devicename")) sqlsm = "select * from t_dev_property where id = " & id set rssm = server.CreateObject("adodb.recordset") rssm.open sqlsm, conn, 1, 3 if rssm.bof and rssm.eof then FoundErr = True ErrMsg = ErrMsg & "
  • 找不到指定的区域!
  • " rssm.Close Set rssm = Nothing Exit Sub end if 'rssm("devicename") = devicename rssm("areaid") = areaid rssm.update rssm.close set rssm = nothing If FoundErr = True Then Exit Sub Response.Redirect "Admin_equipment.asp" end sub sub doMoveToClass() dim BatchInfoID, areaid, rsar BatchInfoID = ReplaceBadChar(Request("Batcheid")) If BatchInfoID = "" Then BatchInfoID = ReplaceBadChar(Request("eid")) End If if BatchInfoID = "" then response.write "" if BatchInfoID = "" then response.end areaid = trim(request("areaid")) set rsar = conn.execute("select child from t_area where t_classid = " & areaid) if rsar(0) <> 0 then response.write "" if rsar(0) <> 0 then response.end conn.execute("update t_dev_property set areaid = " & areaid & " where id in (" & BatchInfoID & ")") response.redirect "admin_equipment.asp" end sub %>
     
    <% Function GetClass_Option(iChannelID, CurrentID) Dim rsClass, sqlClass, strTemp, tmpDepth, i Dim arrShowLine(20) For i = 0 To UBound(arrShowLine) arrShowLine(i) = False Next sqlClass = "Select t_classid,ClassName,ClassType,Depth,NextID from t_area where ChannelID=" & iChannelID & " order by RootID,OrderID" Set rsClass = Conn.Execute(sqlClass) If rsClass.BOF And rsClass.EOF Then strTemp = "" Else strTemp = "" Do While Not rsClass.EOF tmpDepth = rsClass(3) If rsClass(4) > 0 Then arrShowLine(tmpDepth) = True Else arrShowLine(tmpDepth) = False End If strTemp = strTemp & "" rsClass.MoveNext Loop End If rsClass.Close Set rsClass = Nothing GetClass_Option = strTemp End Function Function GetPath(ParentID, ParentPath) on error resume next Dim strPath, i If ParentID <= 0 Then GetPath = "无(所属区域已被删除)" Exit Function End If ParentPath = ParentPath & "," & ParentID Dim rsParent, sqlParent sqlParent = "Select * from t_area where t_classid in (" & ParentPath & ") order by Depth" Set rsParent = Conn.Execute(sqlParent) Do While Not rsParent.EOF For i = 1 To rsParent("Depth") strPath = strPath & "   " Next If rsParent("Depth") > 0 Then strPath = strPath & "└ " End If strPath = strPath & rsParent("ClassName") & "
    " rsParent.MoveNext Loop rsParent.Close Set rsParent = Nothing GetPath = strPath End Function Call CloseConn %>