<% theme = Request.Cookies("theme") If theme = "" Then theme = "bg-theme1" End If ' Get and validate machineid parameter Dim machineid machineid = Trim(Request.Querystring("machineid")) ' Validate machine ID If Not IsNumeric(machineid) Or CLng(machineid) < 1 Then Response.Redirect("default.asp") Response.End End If ' Use LEFT JOINs so query returns data even if printer/PC not associated strSQL = "SELECT machines.*, machinetypes.*, models.*, businessunits.*, vendors.*, functionalaccounts.*, " & _ "printers.ipaddress AS printerip, printers.printerid, printers.printercsfname, printers.printerwindowsname, " & _ "pc.pcid, pc.hostname, pc.loggedinuser AS LoggedInUser, pc_network_interfaces.IPAddress AS pcip " & _ "FROM machines " & _ "INNER JOIN machinetypes ON machines.machinetypeid = machinetypes.machinetypeid " & _ "INNER JOIN models ON machines.modelnumberid = models.modelnumberid " & _ "INNER JOIN businessunits ON machines.businessunitid = businessunits.businessunitid " & _ "INNER JOIN functionalaccounts ON machinetypes.functionalaccountid = functionalaccounts.functionalaccountid " & _ "INNER JOIN vendors ON models.vendorid = vendors.vendorid " & _ "LEFT JOIN printers ON machines.printerid = printers.printerid " & _ "LEFT JOIN pc ON pc.machinenumber = machines.machinenumber " & _ "LEFT JOIN pc_network_interfaces ON pc_network_interfaces.pcid = pc.pcid AND pc_network_interfaces.DefaultGateway IS NOT NULL " & _ "WHERE machines.machineid = " & CLng(machineid) Set rs = objConn.Execute(strSQL) ' Check if machine exists If rs.EOF Then rs.Close Set rs = Nothing Response.Redirect("default.asp") Response.End End If %>
" alt="Card image cap">
" alt="profile-image" class="profile">
<%If Not IsNull(rs("machinenumber")) Then Response.Write(Server.HTMLEncode(rs("machinenumber"))) End If%>
<%If Not IsNull(rs("vendor")) Then Response.Write(Server.HTMLEncode(rs("vendor"))) End If%>
<%If Not IsNull(rs("machinetype")) Then Response.Write(Server.HTMLEncode(rs("machinetype"))) End If%>

<%If Not IsNull(rs("machinedescription")) Then Response.Write(Server.HTMLEncode(rs("machinedescription"))) End If%>

Configuration

Location:

Vendor:

Model:

Function:

BU:

PC:

IP:

User:

Printer:

<%Response.Write(rs("machinenumber"))%>

<%Response.Write(rs("vendor"))%>

<%Response.Write(rs("modelnumber"))%>

<%Response.Write(rs("machinetype"))%>

<%Response.Write(rs("businessunit"))%>

<% ' PC data - check if exists (LEFT JOIN may return NULL) If Not IsNull(rs("pcip")) And rs("pcip") <> "" Then Response.Write("

" & rs("hostname") & "

") Response.Write("

" & rs("pcip") & "

") If Not IsNull(rs("LoggedInUser")) Then Response.Write("

" & rs("LoggedInUser") & "

") Else Response.Write("

 

") End If Else Response.Write("

No PC assigned

") Response.Write("

 

") Response.Write("

 

") End If ' Printer data - check if exists (LEFT JOIN may return NULL) If Not IsNull(rs("printerid")) And rs("printerid") <> "" Then Response.Write("

" & rs("printerwindowsname") & "

") Else Response.Write("

No printer assigned

") End If %>
<% strSQL2 = "SELECT * FROM installedapps, applications WHERE installedapps.appid = applications.appid AND installedapps.isactive = 1 AND installedapps.machineid = " & CLng(machineid) & " ORDER BY appname ASC" Set rs2 = objConn.Execute(strSQL2) Do While Not rs2.EOF Response.Write("") rs2.MoveNext Loop rs2.Close Set rs2 = Nothing %>
" & Server.HTMLEncode(rs2("appname")) & "
"> ">
Current position: X=<%Response.Write(rs("mapleft"))%>, Y=<%Response.Write(rs("maptop"))%>

Select Machine Location
Click on the map to select a location
<% objConn.Close %>