Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%--
- Document : page4
- Created on : Apr 22, 2017, 1:14:28 AM
- Author : Sam
- --%>
- <%@page import="java.util.Arrays"%>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Summary - Professional Conference</title>
- <%
- String[] seminar;
- String fName, lName, address, city, state, zip, pNumber, email, cName, cAddress, cCity, cState, cZip, cPNumber;
- int z = 0;
- String javascript = "No";
- String php = "No";
- String mysql = "No";
- String apache = "No";
- String webservices = "No";
- seminar = request.getParameterValues("seminar");
- for(int i=0; i<seminar.length; i++) {
- if(seminar[i].equals("JavaScript")) {
- javascript = "Yes";
- }
- else if(seminar[i].equals("PHP")) {
- php = "Yes";
- }
- else if(seminar[i].equals("MySQL")) {
- mysql = "Yes";
- }
- else if(seminar[i].equals("Apache")) {
- apache = "Yes";
- }
- else if(seminar[i].equals("Web Services")) {
- webservices = "Yes";
- }
- }
- //Store seminar check box into session
- if(javascript.equals("Yes"))
- session.setAttribute("javascript", "Yes");
- else
- session.setAttribute("javascript", "No");
- if(php.equals("Yes"))
- session.setAttribute("php", "Yes");
- else
- session.setAttribute("php", "No");
- if(mysql.equals("Yes"))
- session.setAttribute("mysql", "Yes");
- else
- session.setAttribute("mysql", "No");
- if(apache.equals("Yes"))
- session.setAttribute("apache", "Yes");
- else
- session.setAttribute("apache", "No");
- if(webservices.equals("Yes"))
- session.setAttribute("webservices", "Yes");
- else
- session.setAttribute("webservices", "No");
- //Get parameter from session and assign variables to be displayed
- if(!(session.getAttribute("fName")).equals(""))
- fName = (String) session.getAttribute("fName");
- else {
- fName = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("lName")).equals(""))
- lName = (String) session.getAttribute("lName");
- else {
- lName = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("address")).equals(""))
- address = (String) session.getAttribute("address");
- else {
- address = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("city")).equals(""))
- city = (String) session.getAttribute("city");
- else {
- city = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("state")).equals(""))
- state = (String) session.getAttribute("state");
- else {
- state = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("zip")).equals(""))
- zip = (String) session.getAttribute("zip");
- else {
- zip = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("pNumber")).equals(""))
- pNumber = (String) session.getAttribute("pNumber");
- else {
- pNumber = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("email")).equals(""))
- email = (String) session.getAttribute("email");
- else {
- email = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("cName")).equals(""))
- cName = (String) session.getAttribute("cName");
- else {
- cName = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("cAddress")).equals(""))
- cAddress = (String) session.getAttribute("cAddress");
- else {
- cAddress = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("cCity")).equals(""))
- cCity = (String) session.getAttribute("cCity");
- else {
- cCity = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("cState")).equals(""))
- cState = (String) session.getAttribute("cState");
- else {
- cState = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("cZip")).equals(""))
- cZip = (String) session.getAttribute("cZip");
- else {
- cZip = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- if(!(session.getAttribute("cPNumber")).equals(""))
- cPNumber = (String) session.getAttribute("cPNumber");
- else {
- cPNumber = "<font color='red'>**REQUIRED**</font>";
- z = 1;
- }
- %>
- </head>
- <body>
- <h1>Summary</h1>
- <form name="form1" action="register.jsp" method="post">
- You entered the following information.
- <br/>
- <br/>
- <table border="1">
- <tr>
- <td>
- <a href="page1.jsp"><h2>Personal Information</h2></a>
- First Name : <%= fName %>
- <br/>
- Last Name : <%= lName %>
- <br/>
- Address : <%= address %>
- <br/>
- City : <%= city %>
- <br/>
- State : <%= state %>
- <br/>
- Zip : <%= zip %>
- <br/>
- Phone : <%= pNumber %>
- <br/>
- E-mail : <%= email %>
- </td>
- <td>
- <a href="page2.jsp"><h2>Company Information</h2></a>
- First Name : <%= cName %>
- <br/>
- Address : <%= cAddress %>
- <br/>
- City : <%= cCity %>
- <br/>
- State : <%= cState %>
- <br/>
- Zip : <%= cZip %>
- <br/>
- Phone : <%= cPNumber %>
- <br/>
- <br/>
- <br/>
- </td>
- <td>
- <a href="page3.jsp"><h2>Seminars</h2></a>
- JavaScript seminar : <%= javascript %>
- <br/>
- PHP seminar : <%= php %>
- <br/>
- MySQL seminar : <%= mysql %>
- <br/>
- Apache seminar : <%= apache %>
- <br/>
- Web Services seminar : <%= webservices %>
- <br/>
- <br/>
- <br/>
- <br/>
- </td>
- </tr>
- </table>
- <br/>
- <%
- if(z == 1)
- out.println("<font color='red'>You cannot register for the conference until you fill out all **REQUIRED** fields!</font>");
- else
- out.println("<input type='submit' value='Register'>");
- %>
- <br/><br/>
- <form name="form2" action="page3.jsp" method="post">
- <input type="submit" value="Back">
- </form>
- <br/>
- <form name="form3" action="page5.jsp" method="post">
- <input type="submit" value="Start Over">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement