Lab Evaluation 3 Khaja Moinuddin

Snippets 

 

Login page

<html>
<body bgcolor=”beige”>
<center>

<jsp:useBean id=”user” class=”obs.User” scope=”session” />

<jsp:setProperty name=”user” property=”*” />

<%
user.login();
if (! user.isLogged())
%>
<h3>Invalid Login. Click <a href=login.html>here</a> to try again! </h3>
<%
else
response.sendRedirect(“home.jsp”);
%>

</center>
</body>
</html>

Registeration page 

<html>
<body bgcolor=”wheat”>
<style>
h3 {font:700 12pt verdana;color:maroon}
a {font:12pt verdana;color:navy}
</style>

<center>

<jsp:useBean id=”user” class=”obs.User” scope=”session” />

<jsp:setProperty name=”user” property=”*” />

<%
String result = user.registerUser();

if ( result == null)
response.sendRedirect(“home.jsp”);
else
out.println(“<h3>Sorry! Registration Failed With Error : <p> ” + result + “</h3> <p> <a href=register.html>Try Again </a> “);

%>

</center>
</body>
</html>

orderitem

 

<jsp:useBean id=”user” scope=”session” class=”obs.User”/>
<%@page import=”java.sql.*”%>

<html>
<style>
a.topic {font:700 11pt verdana;color:white}
td {font:10pt verdana}
th {font:700 10pt verdana;background-color:green;color:white}
</style>

<body bgcolor=”beige”>
<h1>Order Items </h1>

 

<%
String ordid = request.getParameter(“ordid”);
String status = request.getParameter(“status”);

String cmd = “select oi.isbn,title, oi.price,qty, oi.price * qty amount from orderitem oi, books b where b.isbn = oi.isbn and ordid = ” + ordid;

Connection con = user.getConnection();
Statement st = con.createStatement();

ResultSet rs = st.executeQuery(cmd);

%>

<p>

<table width=”100%” cellpadding=2 border=1>
<tr>
<th> ISBN
<th> Title
<th> Price
<th> Quantity
<th> Amount
</tr>

<%
while ( rs.next())
{
%>

<tr>
<td> <%=rs.getInt(1)%>
<td> <%= rs.getString(2)%>
<td> <%= rs.getInt(3)%>
<td> <%= rs.getString(4)%>
<td> <%= rs.getString(5)%>
</tr>

<%
}

rs.close();
st.close();
con.close();

%>

</table>

<p>
<%
if ( status.equals(“n”))
{
%>

<a href=”deleteorder.jsp?ordid=<%=ordid%>”>Cancel This Order</a>
&nbsp;
&nbsp;
<%

}
%>

 

<a href=”javascript:history.back()”>Back </a>

 

 

 

Advertisements

3 thoughts on “Lab Evaluation 3 Khaja Moinuddin

  1. LAB EVALUATION-1 « msritse2012 January 23, 2013 at 2:08 pm Reply

    […] Lab Evaluation 3 Khaja Moinuddin […]

  2. LAB EVALUATION-1 « msritse2012 January 23, 2013 at 2:08 pm Reply

    […] Lab Evaluation 3 Khaja Moinuddin […]

  3. LAB EVALUATION-1 « msritse2012 January 23, 2013 at 2:08 pm Reply

    […] January 23, 2013 Leave a comment […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: