<% theme = Request.Cookies("theme") IF theme = "" THEN theme="bg-theme1" END IF %>
<% Dim filterType filterType = Request.QueryString("filter") If filterType = "" Then filterType = "all" %>
<% ' Render table headers based on filter type If filterType = "IDF" Then ' IDF columns: Location, Name, Description Response.Write("") Response.Write("") Response.Write("") ElseIf filterType = "Server" Or filterType = "Switch" Then ' Server/Switch columns: Location, Name, Vendor, Model, Serial, IP Address, Description Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") ElseIf filterType = "Camera" Then ' Camera columns: Location, Name, IDF, Vendor, Model, MAC Address, IP Address Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") ElseIf filterType = "Access Point" Or filterType = "Printer" Then ' Access Point/Printer columns: Location, Name, Number, Vendor, Model, IP Address Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Else ' All devices: Location, Type, Name, Vendor, Model, Serial, IP Address, Description Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") End If %> <% ' Build query based on filter Dim strSQL If filterType = "all" Then strSQL = "SELECT * FROM vw_network_devices WHERE isactive = 1 ORDER BY device_type, device_name" Else ' Filter by specific type strSQL = "SELECT * FROM vw_network_devices WHERE device_type = '" & Replace(filterType, "'", "''") & "' AND isactive = 1 ORDER BY device_name" End If Dim rs Set rs = objConn.Execute(strSQL) If Not rs.EOF Then Do While Not rs.EOF ' Determine badge style and icon based on device type (using network_map legend colors) Dim badgeStyle, iconClass, detailUrl Select Case rs("device_type") Case "IDF" badgeStyle = "background:#FF9800; color:#fff; padding:5px 10px; border-radius:4px; font-weight:500;" iconClass = "zmdi-city-alt" detailUrl = "displayidf.asp?id=" & rs("device_id") Case "Server" badgeStyle = "background:#607D8B; color:#fff; padding:5px 10px; border-radius:4px; font-weight:500;" iconClass = "zmdi-storage" detailUrl = "displayserver.asp?id=" & rs("device_id") Case "Switch" badgeStyle = "background:#9C27B0; color:#fff; padding:5px 10px; border-radius:4px; font-weight:500;" iconClass = "zmdi-device-hub" detailUrl = "displayswitch.asp?id=" & rs("device_id") Case "Camera" badgeStyle = "background:#F44336; color:#fff; padding:5px 10px; border-radius:4px; font-weight:500;" iconClass = "zmdi-videocam" detailUrl = "displaycamera.asp?id=" & rs("device_id") Case "Access Point" badgeStyle = "background:#2196F3; color:#fff; padding:5px 10px; border-radius:4px; font-weight:500;" iconClass = "zmdi-wifi" detailUrl = "displayaccesspoint.asp?id=" & rs("device_id") Case "Printer" badgeStyle = "background:#4CAF50; color:#fff; padding:5px 10px; border-radius:4px; font-weight:500;" iconClass = "zmdi-print" detailUrl = "displayprinter.asp?printerid=" & rs("device_id") Case Else badgeStyle = "background:#FFC107; color:#000; padding:5px 10px; border-radius:4px; font-weight:500;" iconClass = "zmdi-devices" detailUrl = "#" End Select Response.Write("") ' Location column (always shown first) Response.Write("") ' Type badge (only shown on "All Devices" view) If filterType = "all" Then Response.Write("") End If ' Name (always shown) - clickable link to detail page Response.Write("") ' Render remaining columns based on filter type If filterType = "IDF" Then ' Description, Actions Response.Write("") ElseIf filterType = "Server" Or filterType = "Switch" Then ' Vendor, Model, Serial, IP Address, Description, Actions Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") ElseIf filterType = "Camera" Then ' IDF, Vendor, Model, MAC Address, IP Address, Actions Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") ElseIf filterType = "Access Point" Or filterType = "Printer" Then ' Access Point/Printer - Name (already shown), Number, Vendor, Model, IP Address, Actions ' Note: The Number field shows the machinenumber, which is stored in a different field ' For machines table, we need to show the actual machine number Response.Write("") Response.Write("") Response.Write("") Response.Write("") Else ' All devices view - Vendor, Model, Serial, IP Address, Description, Actions Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") End If Response.Write("") rs.MoveNext Loop Else ' No devices found Dim noDataMessage, colspanCount Select Case filterType Case "IDF": noDataMessage = "No IDFs found." colspanCount = "3" Case "Server": noDataMessage = "No servers found." colspanCount = "7" Case "Switch": noDataMessage = "No switches found." colspanCount = "7" Case "Camera": noDataMessage = "No cameras found." colspanCount = "7" Case "Access Point": noDataMessage = "No access points found." colspanCount = "6" Case "Printer": noDataMessage = "No printers found." colspanCount = "6" Case Else: noDataMessage = "No network devices found." colspanCount = "8" End Select Response.Write("") End If rs.Close Set rs = Nothing objConn.Close %>
NameDescriptionNameVendorModelSerialIP AddressDescriptionNameIDFVendorModelMAC AddressIP AddressNameNumberVendorModelIP AddressTypeNameVendorModelSerialIP AddressDescription
") ' Add location link if device has map coordinates If Not IsNull(rs("maptop")) And Not IsNull(rs("mapleft")) And rs("maptop") <> "" And rs("mapleft") <> "" Then Response.Write("") Response.Write("") Response.Write("") Else Response.Write(" ") End If Response.Write("") Response.Write("") Response.Write(" " & Server.HTMLEncode(rs("device_type"))) Response.Write("") Response.Write("") If Not IsNull(rs("device_name")) And rs("device_name") <> "" Then Response.Write("") Response.Write("" & Server.HTMLEncode(rs("device_name")) & "") Response.Write("") Else Response.Write("Unnamed") End If Response.Write("") If Not IsNull(rs("description")) And rs("description") <> "" Then Dim desc desc = Server.HTMLEncode(rs("description")) If Len(desc) > 100 Then Response.Write(Left(desc, 100) & "...") Else Response.Write(desc) End If Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("vendor")) Then Response.Write(Server.HTMLEncode(rs("vendor"))) Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("modelnumber")) Then Response.Write(Server.HTMLEncode(rs("modelnumber"))) Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("serialnumber")) And rs("serialnumber") <> "" Then Response.Write(Server.HTMLEncode(rs("serialnumber"))) Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("ipaddress")) And rs("ipaddress") <> "" Then Response.Write("") Response.Write(Server.HTMLEncode(rs("ipaddress"))) Response.Write("") Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("description")) And rs("description") <> "" Then Dim descSvr descSvr = Server.HTMLEncode(rs("description")) If Len(descSvr) > 50 Then Response.Write(Left(descSvr, 50) & "...") Else Response.Write(descSvr) End If Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("idfname")) Then Response.Write("") Response.Write(Server.HTMLEncode(rs("idfname"))) Response.Write("") Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("vendor")) Then Response.Write(Server.HTMLEncode(rs("vendor"))) Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("modelnumber")) Then Response.Write(Server.HTMLEncode(rs("modelnumber"))) Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("macaddress")) And rs("macaddress") <> "" Then Response.Write("" & Server.HTMLEncode(rs("macaddress")) & "") Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("ipaddress")) And rs("ipaddress") <> "" Then Response.Write("") Response.Write(Server.HTMLEncode(rs("ipaddress"))) Response.Write("") Else Response.Write("-") End If Response.Write("") ' Machine number - for machines from machines table, get from original machinenumber field ' For now, show device_id as placeholder since view doesn't have separate machinenumber Response.Write("ID: " & rs("device_id") & "") Response.Write("") If Not IsNull(rs("vendor")) Then Response.Write(Server.HTMLEncode(rs("vendor"))) Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("modelnumber")) Then Response.Write(Server.HTMLEncode(rs("modelnumber"))) Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("ipaddress")) And rs("ipaddress") <> "" Then Response.Write("") Response.Write(Server.HTMLEncode(rs("ipaddress"))) Response.Write("") Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("vendor")) Then Response.Write(Server.HTMLEncode(rs("vendor"))) Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("modelnumber")) Then Response.Write(Server.HTMLEncode(rs("modelnumber"))) Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("serialnumber")) And rs("serialnumber") <> "" Then Response.Write(Server.HTMLEncode(rs("serialnumber"))) Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("ipaddress")) And rs("ipaddress") <> "" Then Response.Write("") Response.Write(Server.HTMLEncode(rs("ipaddress"))) Response.Write("") Else Response.Write("-") End If Response.Write("") If Not IsNull(rs("description")) And rs("description") <> "" Then Dim descAll descAll = Server.HTMLEncode(rs("description")) If Len(descAll) > 50 Then Response.Write(Left(descAll, 50) & "...") Else Response.Write(descAll) End If Else Response.Write("-") End If Response.Write("
" & noDataMessage & "