% theme = Request.Cookies("theme") IF theme = "" THEN theme="bg-theme1" END IF Dim idfid, isNewRecord idfid = Request.QueryString("id") If idfid = "" Or idfid = "0" Then isNewRecord = True idfid = 0 Else isNewRecord = False End If ' If editing, fetch existing data Dim rs, idfname, description, maptop, mapleft, isactive If Not isNewRecord Then Dim strSQL strSQL = "SELECT mac.machineid, mac.alias AS idfname, mac.machinenotes AS description, " & _ "mac.maptop, mac.mapleft, mac.isactive " & _ "FROM machines mac " & _ "WHERE mac.machineid = " & idfid & " AND mac.machinetypeid = 17" Set rs = objConn.Execute(strSQL) If rs.EOF Then Response.Write("IDF not found") Response.End End If If Not IsNull(rs("idfname")) Then idfname = rs("idfname") Else idfname = "" 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 rs.Close Set rs = Nothing Else ' New record defaults idfname = "" description = "" maptop = "" mapleft = "" isactive = 1 ' Active by default for new records End If %>