<% 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 %>
Edit Device - <%=Server.HTMLEncode(rs("serialnumber"))%>
Back to Scan
<% Dim errorType, errorMsg errorType = Request.QueryString("error") errorMsg = Request.QueryString("msg") If isScanned = "1" Then %>
Device already exists! Update the details below.
<% ElseIf errorType = "required" Then %>
Error! Status is required.
<% ElseIf errorType = "db" Then %>
Database Error: <%=Server.HTMLEncode(errorMsg)%>
<% End If %>
" readonly>
" placeholder="e.g., DESKTOP-ABC123">
" placeholder="e.g., 101">
>
Default: Active (checked)
<% rs.Close objConn.Close %>