% theme = Request.Cookies("theme") IF theme = "" THEN theme="bg-theme1" END IF Dim accesspointid, isNewRecord accesspointid = Request.QueryString("id") If accesspointid = "" Or accesspointid = "0" Then isNewRecord = True accesspointid = 0 Else isNewRecord = False End If ' If editing, fetch existing data Dim rs, accesspointname, modelid, serialnumber, ipaddress, fqdn, description, maptop, mapleft, isactive Dim vendorname, modelnumber If Not isNewRecord Then Dim strSQL strSQL = "SELECT mac.machineid, mac.alias AS apname, mac.modelnumberid AS modelid, " & _ "mac.serialnumber, mac.fqdn, mac.machinenotes AS description, mac.maptop, mac.mapleft, mac.isactive, " & _ "m.modelnumber, v.vendor, c.address AS ipaddress " & _ "FROM machines mac " & _ "LEFT JOIN models m ON mac.modelnumberid = m.modelnumberid " & _ "LEFT JOIN vendors v ON m.vendorid = v.vendorid " & _ "LEFT JOIN communications c ON mac.machineid = c.machineid AND c.isprimary = 1 AND c.comstypeid = 1 " & _ "WHERE mac.machineid = " & accesspointid & " AND mac.machinetypeid = 16" Set rs = objConn.Execute(strSQL) If rs.EOF Then Response.Write("Access Point not found") Response.End End If If Not IsNull(rs("apname")) Then accesspointname = rs("apname") Else accesspointname = "" If Not IsNull(rs("modelid")) Then modelid = rs("modelid") Else modelid = "" If Not IsNull(rs("serialnumber")) Then serialnumber = rs("serialnumber") Else serialnumber = "" If Not IsNull(rs("ipaddress")) Then ipaddress = rs("ipaddress") Else ipaddress = "" End If If Not IsNull(rs("fqdn")) Then fqdn = rs("fqdn") Else fqdn = "" If Not IsNull(rs("description")) Then description = rs("description") Else description = "" If Not IsNull(rs("maptop")) Then maptop = rs("maptop") Else maptop = "" If Not IsNull(rs("mapleft")) Then mapleft = rs("mapleft") Else mapleft = "" If Not IsNull(rs("isactive")) Then isactive = rs("isactive") Else isactive = 1 If Not IsNull(rs("vendor")) Then vendorname = rs("vendor") Else vendorname = "" If Not IsNull(rs("modelnumber")) Then modelnumber = rs("modelnumber") Else modelnumber = "" rs.Close Set rs = Nothing Else ' New record defaults accesspointname = "" modelid = "" serialnumber = "" ipaddress = "" fqdn = "" description = "" maptop = "" mapleft = "" isactive = 1 ' Active by default for new records vendorname = "" modelnumber = "" End If %>