<%@ LANGUAGE = JScript %> <% // Copyright (c) 1999-2000 by Fragment Art & Research, Inc, All Rights Reserved // Processes parameters for each form (for profile entry and update), applies those parameters to the DOM tree and generates next form. var DEBUG_IdentityXSL = false; var DEBUG_AllLanguages = false; var DEBUG_WriteFormParams = false; var paramLang; var styleSheet; // check first if user logged in already... // if not redirect to login page, carry the arguments along. Response.Buffer=true; var sessionID = Request.Cookies("sic-user"); if (sessionID == "0" || sessionID == ""){ // user has not registered yet, go to login script Response.Redirect("login.asp"); } var profiles = openDB(); var loginName = getLoginNameFromSessionID(sessionID, profiles); var consultantIDs = getConsultantsForAccount(loginName, profiles); var consultantID; if (consultantIDs.size == 0){ consultantID = null; }else{ consultantID = consultantIDs[0]; } if (consultantID == null){ // this needs to say that there is no consultant for this account... consultantID = 1; // this is wrong paramLang = Request.QueryString("param-lang").item; if (paramLang == null) paramLang = "EN"; }else{ consultantID = parseInt(consultantID); paramLang = Request.Form("param-lang").item; if (paramLang == null) { paramLang = Request.QueryString("param-lang").item; if (paramLang == null) paramLang = 'EN'; } } styleSheet="showSummary"; Response.ContentType="text/html"; var c; if (DEBUG_AllLanguages){ c = getConsultantDOM(consultantID, "*", profiles); }else{ c = getConsultantDOM(consultantID, paramLang, profiles); } profiles.Close(); var top = Server.CreateObject("Microsoft.XMLDOM"); top.async=false; var xProfiles = top.createElement("xProfiles"); top.insertBefore(xProfiles, null); var translations = Server.CreateObject("Microsoft.XMLDOM"); translations.async=false; translations.load(Server.MapPath("translations\\" + paramLang + ".xml")); var params = top.createElement("parameters"); params.setAttribute("lang", paramLang); xProfiles.appendChild(translations.selectSingleNode("translations[@lang='" + paramLang + "']")); xProfiles.appendChild(params); xProfiles.appendChild(c.childNodes.item(0)); var style = Server.CreateObject("Microsoft.XMLDOM"); style.async=false; if (DEBUG_IdentityXSL | (styleSheet == null)){ style.load(Server.MapPath("styles\\defaultss.xsl")); }else{ style.load(Server.MapPath("styles\\" + styleSheet + ".xsl")); } if (style.parseError.errorCode != 0){ Response.Write("PARSE ERROR: " + style.parseError); }else{ try { var r = top.transformNode(style); Response.Write(r); }catch (exception) { Response.Write("error: " + exception.description); } } Response.Flush(); %>