% theme = Request.Cookies("theme") IF theme = "" THEN theme="bg-theme1" END IF Dim machineid, isScanned machineid = Request.QueryString("pcid") ' Parameter named pcid for backwards compatibility If machineid = "" Then machineid = Request.QueryString("machineid") isScanned = Request.QueryString("scanned") ' Validate machineid If Not IsNumeric(machineid) Or CLng(machineid) < 1 Then Response.Write("Invalid device ID") Response.End End If ' Get PC data using parameterized query - PHASE 2: Use machines table Dim strSQL, rs strSQL = "SELECT machines.*, machinestatus.machinestatus, pctype.typename " & _ "FROM machines " & _ "LEFT JOIN machinestatus ON machines.machinestatusid = machinestatus.machinestatusid " & _ "LEFT JOIN pctype ON machines.pctypeid = pctype.pctypeid " & _ "WHERE machines.machineid = ? AND machines.pctypeid IS NOT NULL" Set rs = ExecuteParameterizedQuery(objconn, strSQL, Array(CLng(machineid))) If rs.EOF Then Response.Write("Device not found") Response.End End If %>