<% theme = Request.Cookies("theme") IF theme = "" THEN theme="bg-theme1" END IF ' Get and validate pcid parameter Dim machineid, machineData, strSQL machineid = Request.QueryString("pcid") ' Security validation - ensure pcid is numeric If NOT IsNumeric(machineid) OR machineid = "" Then Response.Redirect("./displaypcs.asp") Response.End End If ' Load PC data (pctypeid IS NOT NULL identifies PCs) strSQL = "SELECT m.*, " &_ "mo.modelnumber, mo.vendorid AS modelvendorid, mo.machinetypeid, mo.image AS modelimage, " &_ "v.vendor, " &_ "bu.businessunit, " &_ "mt.machinetype " &_ "FROM machines m " &_ "LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " &_ "LEFT JOIN vendors v ON mo.vendorid = v.vendorid " &_ "LEFT JOIN businessunits bu ON m.businessunitid = bu.businessunitid " &_ "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " &_ "WHERE m.machineid = ? AND m.pctypeid IS NOT NULL" Dim cmd, rsMachine Set cmd = Server.CreateObject("ADODB.Command") cmd.ActiveConnection = objConn cmd.CommandText = strSQL cmd.CommandType = 1 cmd.Parameters.Append cmd.CreateParameter("@machineid", 3, 1, , machineid) Set rsMachine = cmd.Execute If rsMachine.EOF Then rsMachine.Close Set rsMachine = Nothing Set cmd = Nothing objConn.Close Response.Redirect("./displaypcs.asp") Response.End End If ' Store machine data Dim serialnumber, hostname, machinenumber, modelid, businessunitid, alias, machinenotes, mapleft, maptop serialnumber = "" : If NOT IsNull(rsMachine("serialnumber")) Then serialnumber = rsMachine("serialnumber") & "" hostname = "" : If NOT IsNull(rsMachine("hostname")) Then hostname = rsMachine("hostname") & "" machinenumber = "" : If NOT IsNull(rsMachine("machinenumber")) Then machinenumber = rsMachine("machinenumber") & "" modelid = "" : If NOT IsNull(rsMachine("modelnumberid")) Then modelid = rsMachine("modelnumberid") businessunitid = "" : If NOT IsNull(rsMachine("businessunitid")) Then businessunitid = rsMachine("businessunitid") alias = "" : If NOT IsNull(rsMachine("alias")) Then alias = rsMachine("alias") & "" machinenotes = "" : If NOT IsNull(rsMachine("machinenotes")) Then machinenotes = rsMachine("machinenotes") & "" mapleft = "" : If NOT IsNull(rsMachine("mapleft")) Then mapleft = rsMachine("mapleft") maptop = "" : If NOT IsNull(rsMachine("maptop")) Then maptop = rsMachine("maptop") rsMachine.Close Set rsMachine = Nothing Set cmd = Nothing ' Load network interfaces from communications table Dim ip1, mac1, ip2, mac2, ip3, mac3 ip1 = "" : mac1 = "" : ip2 = "" : mac2 = "" : ip3 = "" : mac3 = "" strSQL = "SELECT address, macaddress FROM communications WHERE machineid = ? AND isactive = 1 ORDER BY isprimary DESC" Set cmd = Server.CreateObject("ADODB.Command") cmd.ActiveConnection = objConn cmd.CommandText = strSQL cmd.CommandType = 1 cmd.Parameters.Append cmd.CreateParameter("@machineid", 3, 1, , machineid) Dim rsComms Set rsComms = cmd.Execute Dim interfaceCount interfaceCount = 0 While NOT rsComms.EOF AND interfaceCount < 3 interfaceCount = interfaceCount + 1 If interfaceCount = 1 Then If NOT IsNull(rsComms("address")) Then ip1 = rsComms("address") If NOT IsNull(rsComms("macaddress")) Then mac1 = rsComms("macaddress") ElseIf interfaceCount = 2 Then If NOT IsNull(rsComms("address")) Then ip2 = rsComms("address") If NOT IsNull(rsComms("macaddress")) Then mac2 = rsComms("macaddress") ElseIf interfaceCount = 3 Then If NOT IsNull(rsComms("address")) Then ip3 = rsComms("address") If NOT IsNull(rsComms("macaddress")) Then mac3 = rsComms("macaddress") End If rsComms.MoveNext Wend rsComms.Close Set rsComms = Nothing Set cmd = Nothing ' Load controlled machines from machinerelationships (for PC edit page) ' Note: Controls relationship is PC → Equipment, so we show machines where machineid is THIS PC Dim controllingpcid controllingpcid = "" strSQL = "SELECT mr.related_machineid AS controlpcid FROM machinerelationships mr " &_ "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " &_ "WHERE mr.machineid = ? AND rt.relationshiptype = 'Controls' AND mr.isactive = 1" Set cmd = Server.CreateObject("ADODB.Command") cmd.ActiveConnection = objConn cmd.CommandText = strSQL cmd.CommandType = 1 cmd.Parameters.Append cmd.CreateParameter("@machineid", 3, 1, , machineid) Dim rsControlPC Set rsControlPC = cmd.Execute If NOT rsControlPC.EOF Then If NOT IsNull(rsControlPC("controlpcid")) Then controllingpcid = rsControlPC("controlpcid") End If rsControlPC.Close Set rsControlPC = Nothing Set cmd = Nothing ' Load dualpath from machinerelationships Dim dualpathid dualpathid = "" strSQL = "SELECT related_machineid FROM machinerelationships mr " &_ "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " &_ "WHERE mr.machineid = ? AND rt.relationshiptype = 'Dualpath' AND mr.isactive = 1" Set cmd = Server.CreateObject("ADODB.Command") cmd.ActiveConnection = objConn cmd.CommandText = strSQL cmd.CommandType = 1 cmd.Parameters.Append cmd.CreateParameter("@machineid", 3, 1, , machineid) Dim rsDualpath Set rsDualpath = cmd.Execute If NOT rsDualpath.EOF Then If NOT IsNull(rsDualpath("related_machineid")) Then dualpathid = rsDualpath("related_machineid") End If rsDualpath.Close Set rsDualpath = Nothing Set cmd = Nothing ' Load compliance data Dim thirdpartymanaged, thirdpartymanager, otassetsystem, dodassettype thirdpartymanaged = "NA" : thirdpartymanager = "" : otassetsystem = "" : dodassettype = "" strSQL = "SELECT * FROM compliance WHERE machineid = ?" Set cmd = Server.CreateObject("ADODB.Command") cmd.ActiveConnection = objConn cmd.CommandText = strSQL cmd.CommandType = 1 cmd.Parameters.Append cmd.CreateParameter("@machineid", 3, 1, , machineid) Dim rsCompliance Set rsCompliance = cmd.Execute If NOT rsCompliance.EOF Then If NOT IsNull(rsCompliance("isthirdpartymanaged")) Then thirdpartymanaged = rsCompliance("isthirdpartymanaged") If NOT IsNull(rsCompliance("thirdpartymanager")) Then thirdpartymanager = rsCompliance("thirdpartymanager") If NOT IsNull(rsCompliance("dodassettype")) Then dodassettype = rsCompliance("dodassettype") End If rsCompliance.Close Set rsCompliance = Nothing Set cmd = Nothing %>
Edit Equipment
Back to Machines
PC serial number for asset tracking
Network hostname for this PC
Network Communications

Configure network interfaces for this equipment. You can add up to 3 interfaces.

Interface 1 (Primary)
Example: 192.168.1.100
Example: 00:1A:2B:3C:4D:5E
Interface 2 (Optional)
Interface 3 (Optional)
Machine Relationships

Define relationships between this PC and machines it controls.

Select a machine that this PC controls
Compliance & Security

Track compliance and security information for this equipment.

Is this equipment managed by a third party?
Select the vendor managing this equipment
Operational Technology asset classification
Department of Defense asset classification
Location

Set the physical location of this equipment on the shop floor map.


Cancel
Select Location on Map
No location selected
<% objConn.Close %>