%! static String SEMINAR_NAME="Die .NET-Technologie"; static String SEMINAR_DATE="27.2.2004"; static String WORKSHOP_DATE="28.2.2004"; static String PENALTY_DATE="1.2.2004"; static boolean active=true; %><%@ include file="session.jsp" %><% if (!active && !request.getRemoteAddr().startsWith("140.78.145.") && !request.getRemoteAddr().startsWith("127.")) return; // // Get request parameters // // True if form was submitted boolean submitted=(request.getParameter("submitted") != null); char sex=Session.convertString(request.getParameter("sex"),"m").charAt(0); String title=Session.convertString(request.getParameter("title")); String firstName=Session.convertString(request.getParameter("firstName")); String lastName=Session.convertString(request.getParameter("lastName")); String company=Session.convertString(request.getParameter("company")); String street=Session.convertString(request.getParameter("street")); String zip=Session.convertString(request.getParameter("zip")); String town=Session.convertString(request.getParameter("town")); String contact=Session.convertString(request.getParameter("contact")); String email=Session.convertString(request.getParameter("email")); String telephone=Session.convertString(request.getParameter("telephone")); String fax=Session.convertString(request.getParameter("fax")); boolean workshop=Session.convertString(request.getParameter("workshop"),"").equals("j"); // boolean notebook=Session.convertString(request.getParameter("notebook"),"").equals("j"); // Used for redirecting back to the lectures list Parameters redirectParams=new Parameters(sessionParams); // // Check for existence of the lecture the student wants to subscribe to and // redirect back to the lectures list if said lecture is not found; // If it is found, gather needed lecture data // ResultSet lecture=null; // Page title String pageTitle="Anmeldung zum Seminar"; if (!submitted || workshop) pageTitle+="/Workshop"; pageTitle+=" \"" + SEMINAR_NAME + "\""; if (!submitted) { // // Print form // // us.addExpiresHeader(response,300); %>
Das Seminar findet am <%= SEMINAR_DATE %> statt, der dazugehörige Workshop am <%= WORKSHOP_DATE %>.
ACHTUNG: Für Anmeldungen ab dem <%= PENALTY_DATE %> gilt der erhöhte Beitrag!
<% sessionParams.set("submitted","true"); FormSettings formSettings=new FormSettings("subscription.jsp"); FormSettings.Combobox cb=null; formSettings.setUsePost(); formSettings.addHidden(sessionParams); cb=new FormSettings.Combobox("Anrede","sex",Character.toString(sex),true); cb.add(new FormSettings.Entry("Herr","m")); cb.add(new FormSettings.Entry("Frau","w")); formSettings.add(cb); formSettings.add(new FormSettings.Textfield("Titel","title",Session.convertString(title,""),false,32,64)); formSettings.add(new FormSettings.Textfield("Vorname","firstName",Session.convertString(firstName,""),true,32,64)); formSettings.add(new FormSettings.Textfield("Nachname","lastName",Session.convertString(lastName,""),true,32,64)); formSettings.add(new FormSettings.Textfield("Firma","company",Session.convertString(company,""),false,32,64)); formSettings.add(new FormSettings.Textfield("Straße","street",Session.convertString(street,""),true,32,64)); formSettings.add(new FormSettings.Textfield("PLZ","zip",Session.convertString(zip,""),true,8,8)); formSettings.add(new FormSettings.Textfield("Ort","town",Session.convertString(town,""),true,32,64)); formSettings.add(new FormSettings.Textfield("Email","email",Session.convertString(email,""),false,32,64)); formSettings.add(new FormSettings.Textfield("Kontaktperson","contact",Session.convertString(contact,""),false,32,64)); formSettings.add(new FormSettings.Textfield("Telefonnr.","telephone",Session.convertString(telephone,""),false,32,64)); formSettings.add(new FormSettings.Textfield("Telefaxnr.","fax",Session.convertString(fax,""),false,32,64)); cb=new FormSettings.Combobox("Anmelden für","workshop",(workshop ? "j" : "n"),true); cb.add(new FormSettings.Entry("Seminar","n")); cb.add(new FormSettings.Entry("Seminar und Workshop","j")); formSettings.add(cb); /* cb=new FormSettings.Combobox("Notebook","notebook",(notebook ? "j" : "n"),true); cb.add(new FormSettings.Entry("wird nicht mitgebracht","n")); cb.add(new FormSettings.Entry("wird mitgebracht","j")); formSettings.add(cb); */ formSettings.add(new FormSettings.Button("button","Weiter")); %><%@ include file="formUsage.jsp" %>
<%@ include file="form.jsp" %> <% } else { // // Handle subscription // if (!us.subscribe(sex, title, firstName, lastName, company, street, zip, town, email, contact, telephone, fax, workshop)) // notebook)) { // Subscription failed, print reasons for failure us.addExpiresHeader(response,0); %>Die von Ihnen angegebenen Daten weisen folgende Fehler auf:
<%
if ((sex != 'm') &&
(sex != 'w'))
{
%>Ungültige Anrede
<%
}
if (firstName == null)
{
%>Vorname fehlt
<%
}
if (lastName == null)
{
%>Nachname fehlt
<%
}
if (street == null)
{
%>Straße fehlt
<%
}
if (zip == null)
{
%>Postleitzahl fehlt
<%
}
if (town == null)
{
%>Ort fehlt
<%
}
if ((email != null) &&
!us.validEmail(email))
{
%>Ungültige Email-Adresse
<%
}
%>
Bitte verwenden Sie den "Back"-Button Ihres Browsers, um zur vorherigen Seite zurückzukehren und die fehlenden Angaben zu ergänzen bzw. zu korrigieren.
<% } else { // Subscription was successful // // Print message about the subscriptions success // // us.addExpiresHeader(response,300); %>
Anmeldung durchgeführt.
Es wurde eine Bestätigungs-Email an Sie geschickt.
<% } catch (javax.mail.SendFailedException e) { %>Beim Abschicken der Bestätigungs-Email an Sie traten folgende Fehler auf:
<%= e.getMessage() %>
<% System.out.println("Sending mail to " + email + " failed:\n" + e.getMessage()); } } } } %>