<% theme = Request.Cookies("theme") IF theme = "" THEN theme="bg-theme1" END IF pcid = Request.Querystring("pcid") strSQL = "SELECT pc.*,vendors.*,models.*,pc_network_interfaces.*,machines.machineid,machines.machinenumber as machine_number,machines.alias,machines.machinetypeid,machinetypes.machinetype,machines.businessunitid,businessunits.businessunit,machines.printerid,printers.printerwindowsname,pctype.typename,functionalaccounts.functionalaccount,functionalaccounts.description as functionalaccount_description " & _ "FROM pc " & _ "LEFT JOIN models ON pc.modelnumberid=models.modelnumberid " & _ "LEFT JOIN vendors ON models.vendorid=vendors.vendorid " & _ "LEFT JOIN pc_network_interfaces ON pc_network_interfaces.pcid=pc.pcid " & _ "LEFT JOIN machines ON pc.machinenumber = machines.machinenumber " & _ "LEFT JOIN machinetypes ON machines.machinetypeid = machinetypes.machinetypeid " & _ "LEFT JOIN businessunits ON machines.businessunitid = businessunits.businessunitid " & _ "LEFT JOIN printers ON machines.printerid = printers.printerid " & _ "LEFT JOIN pctype ON pc.pctypeid = pctype.pctypeid " & _ "LEFT JOIN functionalaccounts ON pctype.functionalaccountid = functionalaccounts.functionalaccountid " & _ "WHERE pc.isactive=1 AND pc.pcid="&pcid 'response.write (strSQL) 'response.end set rs = objconn.Execute(strSQL) ' Check if PC exists IF rs.EOF THEN objConn.Close Response.Redirect("displaypcs.asp") Response.End END IF ' Get machine ID if it exists IF NOT rs.EOF THEN IF NOT IsNull(rs("machineid")) THEN machineid = rs("machineid") ELSE machineid = 0 END IF END IF %>
" alt="Card image cap">
" alt="profile-image" class="profile">
<%Response.Write(rs("vendor"))%>
Configuration

Vendor:

Model:

Serial:

Hostname:

Location:

IP:

Functional Account:

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

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

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

:5900" title="VNC To Desktop"><%Response.Write(rs("hostname"))%>

<% IF machineid > 0 THEN Dim locationDisplay ' Use alias if available, otherwise machine_number IF NOT IsNull(rs("alias")) AND rs("alias") <> "" THEN locationDisplay = rs("alias") ELSE locationDisplay = rs("machine_number") END IF Response.Write("" & locationDisplay & "") ELSE Response.Write("Not assigned") END IF %>

<% IF NOT IsNull(rs("ipaddress")) AND rs("ipaddress") <> "" THEN Response.Write(rs("ipaddress")) ELSE Response.Write("N/A") END IF %>

<% IF NOT IsNull(rs("functionalaccount")) AND rs("functionalaccount") <> "" THEN Dim accountDisplay, descDisplay, extractedAccount Dim pcTypeName pcTypeName = "" IF NOT IsNull(rs("typename")) THEN pcTypeName = UCase(Trim(rs("typename") & "")) END IF ' Check if loggedinuser exists and should be used Dim useLoggedInUser useLoggedInUser = False IF NOT IsNull(rs("LoggedInUser")) AND rs("LoggedInUser") <> "" THEN ' Use loggedinuser for Standard, Engineer, or TBD types IF pcTypeName = "STANDARD" OR pcTypeName = "ENGINEER" OR rs("functionalaccount") = "TBD" OR rs("functionalaccount") = "1" THEN useLoggedInUser = True END IF END IF IF useLoggedInUser THEN accountDisplay = rs("LoggedInUser") ' Try to extract the account number from loggedinuser (format: lg[account]sd) Dim loggedUser loggedUser = rs("LoggedInUser") IF Left(loggedUser, 2) = "lg" AND Right(loggedUser, 2) = "sd" AND Len(loggedUser) > 4 THEN extractedAccount = Mid(loggedUser, 3, Len(loggedUser) - 4) ELSE extractedAccount = "" END IF ELSE accountDisplay = "lg" & rs("functionalaccount") & "sd" extractedAccount = "" END IF ' Determine what description to show Dim descField descField = "" ' If showing plain SSO (not lg[account]sd format), label it as "SSO" IF useLoggedInUser AND extractedAccount = "" THEN descField = "SSO" ' If we extracted an account from loggedinuser, look up its description ELSEIF extractedAccount <> "" THEN Dim rsDesc, sqlDesc sqlDesc = "SELECT description FROM functionalaccounts WHERE functionalaccount = '" & Replace(extractedAccount, "'", "''") & "' AND isactive = 1" Set rsDesc = objConn.Execute(sqlDesc) IF NOT rsDesc.EOF THEN IF NOT IsNull(rsDesc("description")) AND rsDesc("description") <> "" THEN descField = rsDesc("description") & "" END IF END IF rsDesc.Close Set rsDesc = Nothing ' Otherwise use functional account description from the query ELSE On Error Resume Next descField = rs("functionalaccount_description") & "" If descField = "" Then descField = rs("description") & "" End If On Error Goto 0 END IF IF descField <> "" AND NOT IsNull(descField) THEN descDisplay = " - " & descField ELSE descDisplay = "" END IF Response.Write(accountDisplay & descDisplay) ELSE Response.Write("N/A") END IF %>


Warranty Information

Status:

End Date:

Days Remaining:

Service Level:

Last Checked:

<% Dim warrantyStatus, warrantyEndDate, warrantyDaysRemaining, warrantyServiceLevel, warrantyLastChecked Dim warrantyStatusClass, warrantyBadge warrantyStatus = rs("warrantystatus") warrantyEndDate = rs("warrantyenddate") warrantyDaysRemaining = rs("warrantydaysremaining") warrantyServiceLevel = rs("warrantyservicelevel") warrantyLastChecked = rs("warrantylastchecked") ' Determine warranty status badge If IsNull(warrantyStatus) Or warrantyStatus = "" Then warrantyBadge = "Unknown" ElseIf LCase(warrantyStatus) = "active" Then If Not IsNull(warrantyDaysRemaining) And IsNumeric(warrantyDaysRemaining) Then If warrantyDaysRemaining < 30 Then warrantyBadge = "Expiring Soon" Else warrantyBadge = "Active" End If Else warrantyBadge = "Active" End If ElseIf LCase(warrantyStatus) = "expired" Then warrantyBadge = "Expired" Else warrantyBadge = "" & warrantyStatus & "" End If %>

<%Response.Write(warrantyBadge)%>

<% If Not IsNull(warrantyEndDate) And warrantyEndDate <> "" And warrantyEndDate <> "0000-00-00" Then Response.Write(warrantyEndDate) Else Response.Write("Not available") End If %>

<% If Not IsNull(warrantyDaysRemaining) And IsNumeric(warrantyDaysRemaining) Then If warrantyDaysRemaining < 0 Then Response.Write("" & Abs(warrantyDaysRemaining) & " days overdue") ElseIf warrantyDaysRemaining < 30 Then Response.Write("" & warrantyDaysRemaining & " days") Else Response.Write(warrantyDaysRemaining & " days") End If Else Response.Write("Not available") End If %>

<% If Not IsNull(warrantyServiceLevel) And warrantyServiceLevel <> "" Then Response.Write(warrantyServiceLevel) Else Response.Write("Not available") End If %>

<% If Not IsNull(warrantyLastChecked) And warrantyLastChecked <> "" Then Response.Write(warrantyLastChecked) Else Response.Write("Never checked") End If %>

<% IF machineid > 0 THEN strSQL2 = "SELECT * FROM installedapps,applications WHERE installedapps.appid=applications.appid AND installedapps.isactive=1 AND " &_ "installedapps.machineid=" & machineid & " ORDER BY appname ASC" set rs2 = objconn.Execute(strSQL2) while not rs2.eof Response.Write("") rs2.movenext wend ELSE Response.Write("") END IF %>
"&rs2("appname")&"
No machine assigned - cannot display installed applications
<% objConn.Close %>