<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<!--@author student
  Copyright (c) 2003 Clearfield Knowledge Solutions.
  All rights reserved. This program and the accompanying materials 
  are made available under the terms of the Common Public License v1.0
  which accompanies this distribution, and is available at
  http://www.k.co.nz/ 
 
  Copyright: Copyright (c) 2003
  Company  : Clearfield Knowledge Solutions
  @author  : Student
  @version : 1.0
  Date Created : Jul 8, 2003
  Title : coffeelogin.jsp
  Desprition : Diplayed during the login  -->   

<html>
<head>
<title>Coffee Order Application</title>
</head>
<body bgcolor="#FFFFFF">

<%@ page import="JavaBeans.*"%>
<%@ page import="java.util.*"%>

<jsp:useBean id='customer_interface' scope='session' class='JavaBeans.Customer_Interface'/>
<jsp:useBean id='customer_data' scope='session' class='JavaBeans.Customer_Data'/>
<jsp:useBean id='coffeepreference_data' scope='session' class='JavaBeans.CoffeePreference_Data'/>
<jsp:useBean id='address_data' scope='session' class='JavaBeans.Address_Data'/>
<jsp:useBean id='creditcard_data' scope='session' class='JavaBeans.CreditCard_Data'/>

<jsp:setProperty name='customer_data' property="*"/>

<% customer_interface.processRequest(request.getParameter("action"), customer_data, creditcard_data, address_data, coffeepreference_data);%>
<form method=POST action="coffeelogin.jsp">

<% if((request.getParameter("action"))!=null){
if ((request.getParameter("action").equals("Login"))&&(customer_interface.getSuccessful()))
{
%>
<!--% customer_data = customer_interface.getCustomer();
address_data = customer_interface.getAddress();
%-->
<jsp:forward page="order.jsp"/>

<%}
}%>


<table align="center" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td><p align="center"><img src="CoffeeBanner.gif"></p>
		</td>
	</tr>
	<tr>
		<td bgcolor=#F0F8FF><br><font face="Geneva, Arial, Helvetica, sans-serif" size="+1">
		<p align="center"><b>Welcome to the Clearfield Coffee Ordering Application</b></font> 
			<br>
			<!--font size = "-1">To begin, log in, or if you haven't <br>used the system before, please register.<br><br></font-->
			<br>
			<font size="-1" face="Geneva, Arial, Helvetica, sans-serif"Using this application, you can order a coffee from your desk, and have it delivered to you.  
			<br>The ultimate time saver, all it takes is two minutes to register
			<br>
			<br>
		</p>
			</font>
		</td>
	</tr>
	<tr>
		<td align=left><font face="Geneva, Arial, Helvetica, sans-serif">
			
			<table align="center" border="0" cellpadding="0" cellspacing="0" width=100%>
				<td width = "60%" bgcolor=#ADD8E6><font face="Geneva, Arial, Helvetica, sans-serif" type="bold" size="-1">
					<p align="center"><font  size = "+1"></font></p>
					<br>
					<p align="center"><font size = "-1"><i>Please enter your username and password.</i> </font></p>
					<p align="center"><font face="Verdana" size="-1"><b>Username: </b><input type="text" name="userName" size="20" maxlength="8"></p>
					<p align="center"><font face="Verdana" size="-1"><b>Password: </b><input type="password" name="password" size="20" maxlength="30"></p>
					<p align="center"><font size="-1" face="Geneva, Arial, Helvetica, sans-serif" color = "FF0000">
						<b><%if(!(request.getParameter("action")==null)){
						if(request.getParameter("action").equals("Login")){
						out.println( customer_interface.getMessage());
						}
						}
						%></b>
						</font></p>
					<p align="center"><input type="submit" name="action" value="Login"></p>
					</form>
					</p>
				
			</td>
				
				<td bgcolor=#D3D3D3>
				<form method=POST action="customerRegister.jsp" >	
					<br>		
					<p align="center"><font  size = "+1"></font></p>					
					<p align="center"><font size = "-1"><i>If you haven't used the system before<br><b>Click Register</b></i></font></p>
					<br>
					<br>
					<br>						
					<p align = "center"><input type="submit" name="action" value="Register"></p>
									
					</form>				
				</td>
			</table>		
		</td>	
	</tr>
	
		
</table>





</body>
</html>