diff --git a/displaypc.asp b/displaypc.asp index 764ad19..04fe222 100644 --- a/displaypc.asp +++ b/displaypc.asp @@ -84,8 +84,10 @@ "machines.modelnumberid, machines.businessunitid, machines.printerid, machines.pctypeid, " & _ "machines.loggedinuser, machines.osid, machines.machinestatusid, machines.isvnc, machines.iswinrm, " & _ "machines.controllertypeid, machines.controllerosid, machines.requires_manual_machine_config, " & _ - "machines.lastupdated, " & _ + "machines.lastupdated, machines.lastboottime, " & _ + "DATEDIFF(NOW(), machines.lastboottime) AS uptime_days, " & _ "machinetypes.machinetype, machinetypes.machinetypeid, " & _ + "pctype.typename AS pctypename, " & _ "machinestatus.machinestatus, " & _ "models.modelnumber, models.image, models.modelnumberid, " & _ "businessunits.businessunit, businessunits.businessunitid, " & _ @@ -101,6 +103,7 @@ "LEFT 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 pctype ON machines.pctypeid = pctype.pctypeid " & _ "WHERE machines.machineid = " & CLng(machineid) & " AND machines.pctypeid IS NOT NULL" Set rs = objConn.Execute(strSQL) @@ -214,11 +217,13 @@
Location:
Vendor:
Model:
-Function:
+PC Type:
BU:
IP Address:
MAC Address:
VNC:
+WinRM:
+Uptime:
Controlled Equipment:
Printer:
@@ -251,6 +256,18 @@ If modelValM = "" Then modelValM = "N/A" machineTypeVal = rs("machinetype") & "" If machineTypeVal = "" Then machineTypeVal = "N/A" +' Get PC Type name from pctype table +Dim pctypeName +pctypeName = rs("pctypename") & "" +If pctypeName = "" Then pctypeName = "N/A" + +' Get uptime value +Dim uptimeDays +uptimeDays = "" +If Not IsNull(rs("uptime_days")) Then + uptimeDays = rs("uptime_days") & " days" +End If + buVal = rs("businessunit") & "" If buVal = "" Then buVal = "N/A" @@ -288,7 +305,7 @@ End If
<%=Server.HTMLEncode(vendorValM)%>
<%=Server.HTMLEncode(modelValM)%>
-<%=Server.HTMLEncode(machineTypeVal)%>
+<%=Server.HTMLEncode(pctypeName)%>
<%=Server.HTMLEncode(buVal)%>
<% ' Get primary communication (IP and MAC) from communications table @@ -361,11 +378,18 @@ Else Response.Write("VNC: N/A
") End If -' Display WinRM status +' Display WinRM status (text instead of badge) If hasWinRMEnabled Then - Response.Write("WinRM Enabled
") + Response.Write("Enabled
") Else - Response.Write("WinRM: N/A
") + Response.Write("N/A
") +End If + +' Display uptime +If uptimeDays <> "" Then + Response.Write("" & Server.HTMLEncode(uptimeDays) & "
") +Else + Response.Write("N/A
") End If ' Get controlled equipment from relationships - check both directions