<% /* * Login.jsp 13/04/02 * * Copyright 2002 by George Ruthart, * 1955 Roy Ivor Crescent, Mississauga, Ontario, Canada L5L 3N7 * All rights reserved. * * This source code is the confidential and proprietary information * of George Ruthart ("Confidential Information"). You shall * not disclose this Confidential Information to any third parties * and shall not modify this code without the written permission * from George Ruthart as well as shall use the software only in * accordanc with the terms of the license agreement that * you entered into with George Ruthart. */ %> <%@ page import="org.apache.ecs.*" %> <%@ page import="org.apache.ecs.html.*" %> <%@ page import="net.ruthart.rdbms.*" %> <%@ page import="java.util.*" %> <% java.text.SimpleDateFormat exFmt = new java.text.SimpleDateFormat("EEE, d MMM yyyy hh:mm:ss z"); java.util.Date now = new java.util.Date(); long expTime = now.getTime(); // + 200000000; now.setTime(expTime); String expString = exFmt.format(now); response.setHeader("Expires", expString); LoginInfo li = new LoginInfo(getServletContext()); AuthInfo ai = li.getAuthInfo(request); Head head = new Head(); head.addElement(new Script("","js/send.js")); //head.addElement(new Script("ready.push(function() {alert('reloading');});")); //head.addElement(new Script("window.onbeforeunload = function () {return 'unloading'; }\n")); head.addElement(""); head.addElement(new Link().setHref("js/form2.css").setRel("stylesheet").setType("text/css")); head.addElement(new Meta().setContent("NO-CACHE").setHttpEquiv("CACHE-CONTROL")); head.addElement(new Meta().setContent("0").setHttpEquiv("expires")); head.addElement(new Meta().setContent("NO-CACHE").setHttpEquiv("PRAGMA")); Body body = new Body(); body.setOnLoad("if(checkReferrer('Extend.jsp')) location.reload(true);"); A a0 = new A("http://www.iciworld.com").addElement(new IMG("/banner/BannerICI.gif").setBorder(0)); body.addElement(new Center(new H1("Register for Membership at ICIWorld")).addElement(a0)).addElement("\n"); body.addElement(new BR()); A a2 = new A("http://www.iciworld.net/Forget.jsp","here"); H4 h2 = new H4("If you ever registered with ICIWorld, even if you didn't join, click ").addElement(a2).addElement(" to find your information."); body.addElement(h2); String action = null; Table t1 = new Table(0); Form f1 = new Form("Extend.jsp","POST").setName("form0"); String buttonLabel="Register", buttonText="
Press button to register"; String sessMembId = (String)session.getAttribute("sessMembId"); HashMap membHash = (HashMap)session.getAttribute("membHash"); Db2mod d2m = new Db2mod(); Vector rows = new Vector(); if (sessMembId !=null) { rows = d2m.getRawFields("reg",(HashMap)session.getAttribute("membHash"),head,ai); buttonLabel = "Modify Registration"; buttonText = "
Press button to modify registration"; action = "mod"; } else { // if record not in database for some reason, get a blank form. Revert the labels back. if (session.getAttribute("membHash") != null) { rows = d2m.getRawFields("reg", (HashMap)session.getAttribute("membHash"), head, ai); } else rows = d2m.getRawFields("reg",null,head,ai); buttonLabel="Register"; action = "add"; } for (Enumeration e = rows.elements() ; e.hasMoreElements() ;) { t1.addElement(e.nextElement()); t1.addElement("\n"); } Input sm = new Input("BUTTON","SUBMIT",buttonLabel); sm.setOnClick("send()"); f1.addElement(new Input("HIDDEN","ft", "reg " + sessMembId)); f1.addElement(new Input("HIDDEN","action", action)); if (request.getParameter("subtype") != null) { f1.addElement(new Input("HIDDEN","subtype", (String)request.getParameter("subtype"))); f1.addElement(new Input("HIDDEN","memb.subtype", (String)request.getParameter("subtype"))); } t1.addElement(new TR().addElement(new TD().addElement(new BR()).addElement(sm).setColSpan(2).addElement(buttonText).setClass("submit"))); f1.addElement(t1); body.addElement(f1); body.addElement(DbUtils.getMessage("deliveryPlcy")); body.addElement(DbUtils.getMessage("refundPlcy")); body.addElement(DbUtils.getMessage("privPlcy")); %> <% out.print(head.toString()); %> <% out.print(body.toString()); %>