Post on 13-Nov-2014
description
transcript
BABY SHOPPING is a website in which consumers go through products which are
needed by babies and purchase them over the internet.
Shopping has evolved with the growth of technology. Online shopping widens the
target audience by providing them the facility to shop online and get the products
delivered at the desired address.
The web project “Baby Shopping” is developed exclusively for baby products. An effort has
been made to cover all possible baby products. This web project aims to help customers search
for the desired products and buy them on mouse click. The user can pay for the products
shopped using credit card’s pin number.
Facility is provided for a user to register himself and shop. The web project has important
feature of shopping cart which help customer to collect products and purchase all of them
together. The purchase feature is available only to those customers who are registered with the
website. Also some more features available to the registered customer are
1.1 Search: Customer can search for products based on different categories
1.2 Sell: Customer can sell products
1.3 Buy: He can buy proucts
1.4 Reviews: He can also view reviews about particular product
Before the user is asked to make the payment he is shown the sum total of all the
goods in the cart which gives him an idea as to how much money he would need for
the selected products. After this, he is requested to submit his personal as well as
shipping details to where the products have to be delivered after the payment is
made. This is done because the user is not shopping in a real market but in a virtual
market and the goods have to be delivered to the shipping address provided. This
also provides the flexibility for the user to select the goods as gifts for someone by
the shipping address to where the package has to be sent.
1
It includes various categories of baby products like:
Action toys & figures
Arts & Crafts
Discovery & Learning
Dolls & Soft Toys
Games & Puzzles
Collectibles
Infant & Preschool
Novelty & Virtual
Outdoors
The proposed project is a web-based portal .Consumers finds baby products of
interest by visiting the website and searching for it. Searching is made more user
friendly by providing sufficient categories through which the user can select the
required product. Customer is also allowed to select multiple items and pay the total
amount in one go.
A process follows in which payment and delivery information is collected. We
allow consumers to sign up for a permanent online account so that some or all of
this information only needs to be entered once.
2
2.1 Introduction
This document provides details about the entire software requirements specification
for the project Baby Shopping.
2.1.1 Purpose
The purpose of this project is to provide easy shopping facility online and easy
payment options and delivery of products in time. Customers can choose from our
wide range of categories of products.
2.1.2 Scope
The name of the project is Baby Shopping
The software stores details of customer.
The software provides the following facilities to the customers:
Facilitates easy shopping online any where
Provides information about the products in categories
Customers are provided with up to date information on the products available
Enables user to shop for products as gifts for someone.
2.1.3 References
IEEE SRS Format
3
2.2 Overall Description
2.2.1. Product Perspective
Baby Shopping is aimed towards the vendors who want to reach out to the
maximum section of customer and common people who can be potential customer.
This project envisages bridging the gap between the retailer and the customer.
This website is totally self contained and works relatively as efficient as other
packages related to the subject. It provides simple database rather than complex
ones for high requirements and it provides good and easy graphical user interface to
new, naive as well as experienced users of the computers.
2.2.1.1. System Interfaces
The software provides good graphical interface for the front end and appropriate
messages to guide the user
2.2.1.2. Hardware Interfaces
1. Monitor to display the pages of products.
2. Keyboard
3. Mouse
2.2.1.3. Software Interfaces
The software requires the support of the following softwares for the database and
other requirements
Microsoft Access for database
Server
NetBeans 6.7.1
4
2.2.1.4. Communication Interfaces
Local intranet
Internet protocols
2.2.1.5. Memory Constraints
At least 1 GB of RAM and
10 GB of hard disk will be required for running the application.
2.2.1.6. Operations
This product will not cover any automated housekeeping aspects of database.
2.2.1.7. Site adaptation requirements
The terminals at client side will have to support the hardware and software
interfaces specified in the above sections.
2.2. User characteristics
No pre knowledge of html
No pre knowledge of database management
Should be familiar with internet
Should know English
Should be able to use and do according to the graphical user interface
2.3. Constraints
The system may become slow due to increased no. of records being stored.
5
To host the website a computer with an operating system that can serve as a server
is required.
2.4. Assumptions and Dependencies
The product assumes that the users don’t opt for the same product number
simultaneously
2.5. Specific Requirements
The following screens will be provided
Index Page
It is the starting page of the website. It provides following features:
(i) Login for old users
(ii) Registration for new users
(iii) Categories
(iv) Featured Products
(v) Contacts
Registration Page:
It allows new users to enter their details for being registered.
It asks:
1. Initial Name
2. Final Name
3. Email ID
4. Password
5. Area
6. Age
7. Contact No.
6
Login Page
This is a page that opens when user clicks on login.
It asks for:-
1. Email ID
2. Password
Products
This page shows the images of the various products at our website to users.
The name and prices of the products are given.
ViewCart page
This gives the details of the products in the shopping cart.
It provides two options:
1. Back to shopping
2. Purchase
Purchase Page
This page gives the user the total sum of the bill for the items in the shopping cart.
Checkout Page
It seeks the information from the user so as to ship the products purchased by the
user according to the details provided.
It asks for:
1. Name
2. mobile no
3. landline no
4. Address
5. City
7
6. State
7. Country
Details page
It gives the address provided by the user along with the total price.
Payment page
It asks for 16-digit credit card number and the type of credit card for payment.
Search page
The user can search an item on the basis of the category.
SearchedItem page
This page is displayed when a user searches for an item on the search page.
It displays the item under the given category along with name and price.
Sell Page
The user can sell the old products by providing following information:
1. Browsing the image of the product
2. Name of the product
3. Category
4. Expected price
Buy page
The user can also buy the old products submitted by the other users.
Review page
The user can choose any item to give review to share his experience of using this
website or of the product bought.
8
Logical Database Requirements:
The following information will be placed in the database.
Login: - initial, finalname, email, pass, area, dob, contact.
Shopping: - name, mobile, landline, address, city, state, country.
Items: - item, category, image, price, id
Review: - id, review, email
9
Entity Relationship Diagram:-
The Entity Relationship Diagram (ERD) is the graphical notations of relationship
between different entities and attributes.
The ER diagram for Baby Shopping as follows:-
Figure 3.1. E-R Model showing relationship between Customer and Products:-
Customer
Customer Name
Password
Address
Contact Number
Views
Product
Name
Category
Price
10
Figure 3.2. E-R Model showing relationship between Cart and Transactions:-
Cart
Sum Total
Total Products
Products Selected
Shopping
Transaction Details
Entering Customer Details
User Details
Name
Shipping
Address
Contact Number
Credit Card
Details
11
Figure 3.3. E-R Model showing relationship between customer and cart:
Customer
Product Details
login
Search in categories
gives
Product Category
Product Name
Product Price
Add to Cart
Cart Information
Sum Total
Total products
Products selected
12
Figure 3.4. Data Flow Diagram for Baby Shopping:
Baby Shopping
RegistrationLogin
Sell productsPurchase
products
Customer enter details
Enter email id and password
Enter product name and price
Search on basis of categories
Customer enter details for shipping
13
System testing is an expensive but critical process that can take as much as 50
percent of the budget for program development. The common view of testing held
by users is that it is performed to prove that there are no errors in the program.
Testing is the process of executing a program with the explicit intention of finding
errors that is, making the program fail. A successful test, then, is one that finds an
error.
Test the modules thoroughly- cover all the access paths. Generate enough data to
cover all the access paths arising from conditions.
Test the modules by passing wrong data.
To test the different access paths, look at the conditional statement. Enter some data
in the test file, which would satisfy the condition and again test the script. Repeat
this process many times.
After each test, analyze the log file to ensure proper, understandable and useful
messages are present in the log file.
Test for locking by invoking multiple concurrent processes.
4.1 Types of Testing
TYPES OF TESTING
WHITE BOX TESTING BLACK BOX TESTING
14
4.1.1 WHITE BOX TESTING:
White Box testing which is performed early in the testing process is also called
glass-box testing. Using white box testing, the software engineer can derive test
cases that
Guarantee that all the independent paths within the module have been exercised at
least once.
Exercise all logical decisions on their true and false sides.
Execute all loops at their boundaries and within their operational bounds.
Exercise internal data structure to assure their validity.
4.1.2 BLACK BOX TESTING:
Black box testing is to be applied during later stage of testing. Black box testing
focuses on the functional requirement of the software. Black box testing enables the
software engineer to derive sets of input conditions that will fully exercise the
functional requirement of a program.
Black box testing enables to find error in the following categories:-
Incorrect or missing functions.
Interface errors.
Errors in the data structure or external database access.
Performance errors.
Initialization and termination errors
15
4.2 TEST PLANS (TEST CASE)
1. Login
Test Case stored in database Output
Parul@yahoo.com,parul yes redirects to customer page
Parul@yahoo.com,9876 no is not redirected to customer
page
2. Prepare Bill Page
Test Case Output
All the entries filled up but except one Page is not submitted
One Entry filled others not filled Page is not submitted
Entries filled rest not filled Page is not submitted
3. Customer Shopping cart
Delete item
Test case Output
1. Text field blank, but delete button No item is deleted
Is clicked
2. Item not present in cart is type nothing happens
3. Name Of item present in cart is typed item is deleted and bill amount
is adjusted
16
4. Payment Details
Test Case Output
All the entries filled up but except one Page is not submitted
One Entry filled others not filled Page is not submitted
Entries filled rest not filled Page is not submitted
17
Implementation
A crucial phase in the system life cycle is the successful implementation of the new
system design. Implementation includes all those activities that take place to
convert from the old system to the new. The new system may be totally new,
replacing an existing manual or automated system.
In our project implementation is done in following manner
Installation of software: First of all, the files are copied into CD writer. On the disk
also copy Microsoft Access database .Now all the files are copied in a folder on
server. The script is run on the query analyzer and all procedures are copied into
database on server.
Training the Operating Staff: All the users are given demonstration after copying all
the files. In this demonstration all the input variables are taken and project is
executed. After requirement of the user grew we have to amend our software for
before full installation.
Installation of Hardware: The only need is to install proper hardware for the
software. Deploy a server and install the software for proper working of software.
ADVANTAGES
It simplifies the operation.
It avoids a lot of manual work.
Every Transaction is obtained and processed immediately. Avoids errors by
avoiding the manual work.
User friendly screen to enter the data in database tables.
Contact information available.
User can easily access the system without much experience.
Provide Hardware and software securities.
Portable and flexible for further extension.
18
RESULT
The system has been implemented and tested successfully. It meets the
requirements specified to the great extent. Although the system has been designed
keeping the Present and future requirements in mind and made very flexible. There
are limitations of the System. Proper consideration has been given for a wide range
of new enhancements proposed in the future, throughout the development of
system. The system is developed user friendly.
19
SUMMARY AND CONCLUSION
The central concept of the application is to allow the customer to shop virtually
using
the Internet and allow customers to buy the items and articles of their desire from
the store. This system offers information relevant to the user accessing the
application thus avoiding unnecessary overloading and at the same time
maintaining the security.
The system has been developed for the given condition and is found working
effectively. The developed system is flexible and changes can be made easily
whenever required. Using the facilities and functionalities of .net, the website has
been developed in a neat and simple manner, thereby reducing the operator’s work.
The speed and accuracy are maintained in proper way. The user-friendly nature of
this website developed in Advanced Java is very easy to work with. The results
obtained are satisfactory from the user point of view.
The system is verified with valid as well as invalid data in each manner. The system
is run with an insight into the necessary modifications that may be required in the
future. Hence the system can be maintained successfully.
20
REFERENCES
1. Herbert Schildt, The Complete Reference Java 2, 5th edition, ISBN number: 978-
0072224207
2. Thinking in Java, by Bruce Eckel, 3rd Ed. ISBN number: 9780131002876
3. http://my.execpc.com/java/java_tutorial.html
4.http://ieeexplore.ieee.org/search/freesrchabstract.jsp?
tp=&arnumber=885952&queryText%3Ddatabase+connectivity+on+java
%26openedRefinements%3D*%26searchField%3DSearch+All
5. http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets.html
6. http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf
21
INDEX.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Baby Shop</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<script language="JavaScript">
<!--
function addItem( name, price )
{
var i = 1;
for( ; getCookieValue( "item" + i ) != "" ; i++ );
document.cookie = "item" + i + "=" + name + "," + price;
document.cookie = "items=" + i;
}
function getCookieValue( name )
{
22
var c = document.cookie;
var begin = c.indexOf( name );
if( begin < 0 ) return( "" );
begin += name.length + 1;
var end = c.indexOf( ";", begin );
if( end == -1 ) end = c.length;
return( c.slice( begin, end ) );
}
// -->
</script>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="inner_copy"><a href="http://www.greatdirectories.org/">web directories</a>
<a href="http://www.bestfreetemplates.info/">free CSS templates</a></div>
<div class="topnav">
<span><strong>Welcome</strong> <a href="login.jsp">Log in</a> | <a href="register.jsp">Register</a></span>
</div>
<%
session.setAttribute("emailid","");
session.setAttribute("item","");
session.setAttribute("total","");
%>
<ul id="menu">
23
<li><a href="index.jsp"><img src="images/but1.gif" alt="" width="110" height="32" /></a></li>
<li><a href="login.jsp"><img src="images/but2.gif" alt="" width="110" height="32" /></a></li>
<li><a href="register.jsp"><img src="images/but3.gif" alt="" width="110" height="32" /></a></li>
<li><a href="login.jsp"><img src="images/but4.gif" alt="" width="110" height="32" /></a></li>
<li><a href="viewcart.jsp"><img src="images/but5.gif" alt="" width="110" height="32" /></a></li>
<li><a href="login.jsp"><img src="images/but6.gif" alt="" width="110" height="32" /></a></li>
</ul>
</div>
<div id="content">
<div id="sidebar">
<div>
<img src="images/title1.gif" alt="" width="233" height="41" /><br />
<ul class="categories">
<li><a href="itemaction.jsp">Action Toys & Figures</a></li>
<li><a href="itemarts.jsp">Arts & Crafts</a></li>
<li><a href="itemdiscovery.jsp">Discovery & Learning</a></li>
<li><a href="itemdolls.jsp">Dolls & Soft Toys</a></li>
<li><a href="itemgames.jsp">Games & Puzzles</a></li>
<li><a href="itemcollectibles.jsp">Collectibles</a></li>
<li><a href="iteminfants.jsp">Infant & Preschool</a></li>
<li><a href="itemnovelty.jsp">Novelty & Virtual</a></li>
<li><a href="itemoutdoors.jsp">Outdoors</a></li>
<li><a href="itemtv.jsp">TV & Films</a></li>
24
</ul>
<img src="images/title2.gif" alt="" width="233" height="41" /><br />
<div class="inner_copy"><a href="http://www.bestfreetemplates.org/">free templates</a>
<a href="http://www.bannermoz.com/">banner templates</a></div>
<div class="review">
<a href="login.jsp"><img src="images/pic1.jpg" alt="" width="181" height="161" /></a><br /> Baby Block Fun</a><br />
<p>hii, Just loved it...Moreover, delivery is within a day..!! </p>
<img src="images/stars.jpg" alt="" width="118" height="20" class="stars" />
</div>
<div style="float:left"><table><img src="images/logo_2.gif"/></table></div>
</div>
</div>
<script language="JavaScript">
var source = 0;
var replacement = 1;
function createRollOver(originalImage,replacementImage) {
var imageArray = new Array;
imageArray[source] = new Image;
imageArray[source].src = originalImage;
imageArray[replacement] = new Image;
imageArray[replacement].src = replacementImage;
return imageArray;
}
var rollImage1 = createRollOver("images/pic2.jpg","images/shop.jpg");
25
</script>
<script language="JavaScript">
var imageList = new Array;
imageList[0] = new Image;
imageList[0].src = "images/photo.jpg";
imageList[1] = new Image;
imageList[1].src = "images/baby.jpg";
imageList[2] = new Image;
imageList[2].src = "images/baby1.jpg";
imageList[3] = new Image;
imageList[3].src = "images/photo.jpg";
function slideShow(imageNumber) {
document.slideShow.src =
imageList[imageNumber].src;
imageNumber += 1;
if (imageNumber < imageList.length) {window.setTimeout("slideShow(" + imageNumber + ")",3000);}}
</script>
<div id="main">
<img src="images/photo.jpg" alt="" width="682" height="334" border="0" usemap="#Map" name="slideShow" />
<br >
<div id="inside">
FIRST TIME IN INDIA ALL BABY PRODUCTS AT YOUR DOORSTEP<br />
<div class="info">
26
<a href="#" onMouseOver="document.myImage1.src = rollImage1[replacement].src;" onMouseOut="document.myImage1.src = rollImage1[source].src;">
<img src="images/pic2.jpg" width="159" height="132" name="myImage1" border=0>
</a>
<p>Baby care reminds you of a toddler and having one at home is really a delightful experience. Be it for first timers or even for experienced couples, parenting a baby with baby products and love is a whole new learning process. </p>
<a href="contact.jsp" class="more"><img src="images/more.gif" alt="" width="106" height="28" /></a>
</div>
<img src="images/title4.gif" alt="" width="159" height="17" /><br />
<div id="items">
<div class="item">
<img src="itemimages/collectibles/Vanity Table.gif" width="213" height="192" /></a><br />
<p>Vanity Table</a></p><span class="price">$125</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Vanity '+ 'Table', 125 );">
<input type="button" value="View Cart" onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item center">
<img src="itemimages/infants and preschool/Betty Butterfly Plush Rocking Animal.jpg" width="213" height="192"/></a><br />
<p>Betty Rocking</a></p><span class="price">$215</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Betty '+ 'Rocking', 215 );">
<input type="button" value="View Cart" onClick="JavaScript: document.location='viewcart.jsp';">
27
</div>
<div class="item">
<img src="itemimages/infants and preschool/Art Go Round.jpg" width="213" height="192" /></a><br />
<p>Art Go Round</a></p><span class="price">$85</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Art ' + 'Go ' + 'Round', 85 );">
<input type="button" value="View Cart" onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item">
<img src="itemimages/infants and preschool/Touch And Learn Picture Card Bank.jpg" width="213" height="192"/></a><br />
<p>Touch and Learn</a></p><span class="price">$35</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Touch ' + 'and ' + 'Learn', 35 );">
<input type="button" value="View Cart" onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item center">
<img src="itemimages/novelty and virtual/Magic Board.jpg" width="213" height="192" /></a><br />
<p>Magic Board</a></p><span class="price">$27</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Magic ' + 'Board', 27 );">
<input type="button" value="View Cart" onClick="JavaScript: document.location='viewcart.jsp';">
28
</div>
<div class="item">
<img src="itemimages/novelty and virtual/Crystal Climbers.jpg" width="213" height="192" /></a><br />
<p>Crystal Climbers</a></p><span class="price">$40</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Crystal '+ 'Climbers', 40 );">
<input type="button" value="View Cart" onClick="JavaScript: document.location='viewcart.jsp';">
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
<map name="Map">
<area shape="rect" coords="16,306,159,326" href="#">
</map>
</body>
</html>
29
LOGIN.JSP
<%@page session="true" contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Baby Shop</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style3.css" />
</head>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a> <div class="inner_copy"><a href="http://www.greatdirectories.org/">web directories</a><a href="http://www.bestfreetemplates.info/">free CSS templates</a></div>
<div class="topnav">
<span><strong>Welcome</strong> |
<a href="index.jsp">Home</a></span>
</div>
<div id="main">
<br>
<br>
<div style="font:14;color:#FE2E9A;width:682;height:434 ">
30
<table align="right">
<tr align="right">
<td>
<a href="register.jsp"> <img src="images/signup1.jpg"/></a>
</td>
</tr>
</table>
<table width="300">
<FORM name=form1 onsubmit="return val1(this)" method="post" action="user.jsp" >
<script language="javascript">
function val1(f) {
if(f.email.value=="") {
alert("Please enter email id!!");
f.email.focus();
return false;
}
else if(f.password.value=="") {
alert("Please enter password !!");
f.password.focus();
return false;
}
return true;
31
}
</script>
<td align="left">
<td height=34> </td>
<td height=34>EMAIL ID</td>
<td> <input type="text" name="email" value="" /></td>
</tr>
<tr align="left">
<tr height=34> </td>
<tr height=34>PASSWORD</td>
<tr> <input type="password" name="password" value="" /></td>
</tr>
<tr>
<td height=34> </td>
<td><input type="checkbox" name="remember" value="ON" /></td>
<td> remember me</td>
</tr>
<tr>
<td width=20></td>
<td width=25></td>
<TD align="left" height=53> <INPUT type="submit" value="submit">
</td>
32
</tr>
</form>
</table>
</div>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</div>
</body>
</html>
33
USER.JSP
<%@page session="true" contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="data" class="edow.loginbean"/>
<jsp:setProperty name="data" property="*"/>
<%
if(data.login()){%>
<%
String s=request.getParameter("email");
session.setAttribute("emailid",s);
%>
<script language="JavaScript">
<!—
function addItem( name, price )
{
var i = 1;
for( ; getCookieValue( "item" + i ) != "" ; i++ );
document.cookie = "item" + i + "=" + name + "," + price;
document.cookie = "items=" + i;
}
function getCookieValue( name )
34
{
var c = document.cookie;
var begin = c.indexOf( name );
if( begin < 0 ) return( "" );
begin += name.length + 1;
var end = c.indexOf( ";", begin );
if( end == -1 ) end = c.length;
return( c.slice( begin, end ) );
}
// -->
</script>
<html>
<head>
<title>Baby Shop</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="inner_copy"><a href="http://www.greatdirectories.org/">web directories</a><a href="http://www.bestfreetemplates.info/">free CSS templates</a></div>
<div class="topnav">
<span><strong>Welcome</strong></span>
35
<% if(data.login()==true)
{String s2=session.getAttribute("emailid").toString().toUpperCase(); out.println(s2);
}%>
<a href="index.jsp">sign out</a>
</div>
<ul id="menu">
</ul>
</div>
<div id="content">
<div id="sidebar">
<div id="navigation">
<ul>
<li><a href="search.jsp">search</a></li>
<li><a href="sell.jsp">sell</a></li>
<li><a href="products.jsp">buy</a></li>
<li><a href="review.jsp">Reviews</a></li>
<li><a href="contact.jsp">Contacts</a></li>
</ul>
<div id="cart">
<strong>Shopping cart:</strong> <br /> 0 items
</div>
</div>
<div>
<img src="images/title1.gif" alt="" width="233" height="41" /><br />
<ul class="categories">
36
<li><a href="itemaction.jsp">Action Toys & Figures</a></li>
<li><a href="itemarts.jsp">Arts & Crafts</a></li>
<li><a href="itemdiscovery.jsp">Discovery & Learning</a></li>
<li><a href="itemdolls.jsp">Dolls & Soft Toys</a></li>
<li><a href="itemgames.jsp">Games & Puzzles</a></li>
<li><a href="itemcollectibles.jsp">Collectibles</a></li>
<li><a href="iteminfants.jsp">Infant & Preschool</a></li>
<li><a href="itemnovelty.jsp">Novelty & Virtual</a></li>
<li><a href="itemoutdoors.jsp">Outdoors</a></li>
<li><a href="itemtv.jsp">TV & Films</a></li>
</ul>
<img src="images/title2.gif" alt="" width="233" height="41" /><br />
<div class="inner_copy"><a href="http://www.bestfreetemplates.org/">free templates</a><a href="http://www.bannermoz.com/">banner templates</a></div>
<div class="review">
<a href="seereview.jsp"><img src="images/pic1.jpg" alt="" width="181" height="161" /></a><br />
<a href="seereview.jsp">Baby Fun Blocks</a><br />
<p>hii, Just loved it...Moreover, delivery is within a day..!! </p>
<img src="images/stars.jpg" alt="" width="118" height="20" class="stars" />
</div>
</div>
</div>
<div id="main">
<img src="images/photo.jpg" alt="" width="682" height="334" border="0" usemap="#Map" />
37
<div id="inside">
<img src="images/title3.gif" alt="" width="159" height="15" /><br />
<div class="info">
<img src="images/pic2.jpg" alt="" width="159" height="132" />
<p>Baby care reminds you of a toddler and having one at home is really a delightful experience. Be it for first timers or even for experienced couples, parenting a baby with baby products and love is a whole new learning process. </p>
<a href="#" class="more"><img src="images/more.gif" alt="" width="106" height="28" /></a>
</div>
<img src="images/title4.gif" alt="" width="159" height="17" /><br />
<div id="items">
<div class="item">
<a href="#"><img src="images/item1.jpg" width="213" height="192" /></a><br />
<p><a href="#">Baby shoes</a></p><span class="price">$125</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Baby'
+ 'Shoes', 125 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item center">
<a href="#"><img src="images/item2.jpg" width="213" height="192" /></a><br />
<p><a href="#">Baby Bottle</a></p><span class="price">$215</span><br />
<input type="button" value="Add to cart"
onClick="JavaScript: addItem( 'Baby '
+ 'Bottle', 215 );">
38
<input type="button" value="View Cart"
onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item">
<a href="#"><img src="images/item3.jpg" width="213" height="192" /></a><br />
<p><a href="#">Sipper</a></p><span class="price">$85</span><br />
<input type="button" value="Add to cart"
onClick="JavaScript: addItem( 'Sipper '
, 85 );">
<input type="button" value="View Cart"
onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item">
<a href="#"><img src="images/item4.jpg" width="213" height="192" /></a><br />
<p><a href="#">Teddy Bear</a></p><span class="price">$35</span><br />
<input type="button" value="Add to cart" ="JavaScript: addItem( 'Teddy'
+ 'Bear', 35 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div>
39
<div class="item center">
<a href="#"><img src="images/item5.jpg" width="213" height="192" /></a><br />
<p><a href="#">Baby Toy</a></p><span class="price">$27</span><br />
<input type="button" value="Add to cart"onClick="JavaScript: addItem( 'Baby'
+ 'Toy', 27 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item">
<a href="#"><img src="images/item6.jpg" width="213" height="192" /></a><br />
<p><a href="#">Pyramid</a></p><span class="price">$40</span><br />
<input type="button" value="Add to cart"onClick="JavaScript: addItem( 'Pyramid'
, 40 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
<ul>
<li><a href="#">Home page</a> |</li>
40
<li><a href="#">New Products</a> |</li>
<li><a href="#">All Products</a> |</li>
<li><a href="#">Reviews</a> |</li>
<li><a href="#">F.A.Q.</a> |</li>
<li><a href="#">Contacts</a></li>
</ul>
</div>
<map name="Map">
<area shape="rect" coords="16,306,159,326" href="#">
</map>
<%}
else{response.sendRedirect("login.jsp");
%>
<%}%>
</body>
</html>
41
ITEMACTION.JSP
<%@page session="true" contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="data" class="edow.loginbean"/>
<jsp:setProperty name="data" property="*"/>
<script language="JavaScript">
<!--
function addItem( name, price )
{
var i = 1;
for( ; getCookieValue( "item" + i ) != "" ; i++ );
document.cookie = "item" + i + "=" + name + "," + price;
document.cookie = "items=" + i;
}
function getCookieValue( name )
{
var c = document.cookie;
var begin = c.indexOf( name );
if( begin < 0 ) return( "" );
begin += name.length + 1;
var end = c.indexOf( ";", begin );
if( end == -1 ) end = c.length;
return( c.slice( begin, end ) );
42
}
// -->
</script>
<html>
<head>
<title>Baby Shop</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="inner_copy"><a href="http://www.greatdirectories.org/">web directories</a><a href="http://www.bestfreetemplates.info/">free CSS templates</a></div>
<div class="topnav">
<span><strong>Welcome</strong> </span>
<%
String s2=session.getAttribute("emailid").toString().toUpperCase();
if(s2=="")
{%><a href="login.jsp">Log in</a> | <a href="register.jsp">Register</a></span>
<%}else{out.println(s2);
%><a href="index.jsp">sign out</a><%}%>
43
</div>
<%if(s2==""){%>
<ul id="menu">
<li><a href="index.jsp"><img src="images/but1.gif" alt="" width="110" height="32" /></a></li>
<li><a href="login.jsp"><img src="images/but2.gif" alt="" width="110" height="32" /></a></li>
<li><a href="register.jsp"><img src="images/but3.gif" alt="" width="110" height="32" /></a></li>
<li><a href="login.jsp"><img src="images/but4.gif" alt="" width="110" height="32" /></a></li>
<li><a href="viewcart.jsp"><img src="images/but5.gif" alt="" width="110" height="32" /></a></li>
<li><a href="checkout.jsp"><img src="images/but6.gif" alt="" width="110" height="32" /></a></li>
</ul><%}%>
</div>
<div id="content">
<div id="sidebar">
<div>
<img src="images/title1.gif" alt="" width="233" height="41" /><br />
<ul class="categories">
<li><a href="itemaction.jsp">Action Toys & Figures</a></li>
<li><a href="itemarts.jsp">Arts & Crafts</a></li>
<li><a href="itemdiscovery.jsp">Discovery & Learning</a></li>
44
<li><a href="itemdolls.jsp">Dolls & Soft Toys</a></li>
<li><a href="itemgames.jsp">Games & Puzzles</a></li>
<li><a href="itemcollectibles.jsp">Collectibles</a></li>
<li><a href="iteminfants.jsp">Infant & Preschool</a></li>
<li><a href="itemnovelty.jsp">Novelty & Virtual</a></li>
<li><a href="itemoutdoors.jsp">Outdoors</a></li>
<li><a href="itemtv.jsp">TV & Films</a></li>
</ul>
<img src="images/title2.gif" alt="" width="233" height="41" /><br />
<div class="review">
<a href="seereview.jsp">Baby Fun Blocks</a><br />
<p>hii, Just loved it...Moreover, delivery is within a day..!! </p>
<img src="images/stars.jpg" alt="" width="118" height="20" class="stars" />
</div>
</div>
</div>
<div id="main">
<div id="items">
<div class="item">
<img src="itemimages/Images_1/Action toys and figures/2 in 2 Pack Woody.jpeg" width="213" height="192" /><br />
<p>2 in 2 Pack Woody</p><span class="price">$125</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( '2 '+ '2' + ' Pack'+ 'Woody', 125 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
45
</div>
<div class="item center">
<img src="itemimages/Images_1/Action toys and figures/Deluxe Alien Action.jpeg" width="213" height="192" /><br />
<p>Deluxe Alien Action</p><span class="price">$215</span><br />
<input type="button" value="Add to cart"onClick="JavaScript: addItem( 'Deluxe '
+ 'Alien ' + 'Alien' + 'Action', 215 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item">
<img src="itemimages/Images_1/Action toys and figures/Heroes.jpeg" width="213" height="192" /><br />
<p>Heroes</p><span class="price">$85</span><br />
<input type="button" value="Add to cart"onClick="JavaScript: addItem( 'Heroes'
, 85 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item">
<img src="itemimages/Images_1/Action toys and figures/John McCain Action Figure.jpeg" width="213" height="192" /><br />
<p>John McCain</p><span class="price">$35</span><br />
<input type="button" value="Add to cart"onClick="JavaScript: addItem( 'John ' + 'McCain'+ 'Action'+ 'Figure', 35 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item center">
46
<img src="itemimages/Images_1/Action toys and figures/Iron Man.jpeg" width="213" height="192" /></a><br />
<p>Iron Man</p><span class="price">$27</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Iron'
+ 'Man', 27 );">onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item">
<img src="itemimages/Images_1/Action toys and figures/Leap Frog Baby Little Leaps.jpeg" width="213" height="192" /><br />
<p>Leap Frog Baby</p><span class="price">$40</span><br />
input type="button" value="Add to cart"
onClick="JavaScript: addItem( 'Leap ' + 'Frog' + 'Baby' + ' Little'+ 'Leaps', 40 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div>
</div>
<div class="item">
<img src="itemimages/Images_1/Action toys and figures/McFarlaneToys.jpeg" width="213" height="192" /><br />
<p>McFarlane Toys</p><span class="price">$85</span><br />
<input type="button" value="Add to cart"onClick="JavaScript: addItem( 'McFarlane '
+ 'Toys', 85 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div><br/>
<div class="item center">
<img src="itemimages/Images_1/Action toys and figures/Military Action Figures.jpeg" width="213" height="192" /><br />
<p>Military Action Figures</p><span class="price">$35</span><br />
47
<input type="button" value="Add to cart"onClick="JavaScript: addItem( 'Military ' + 'Action'+ 'Figures', 35 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item">
<img src="itemimages/Images_1/Action toys and figures/Pokemon.jpeg" width="213" height="192" /><br />
<p>Pokemon</p><span class="price">$27</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Pokemon ', 27 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div id="items">
<div class="item">
<img src="itemimages/Images_1/Action toys and figures/Ratatouille.jpeg" width="213" height="192" /><br />
<p>Ratatouille</p><span class="price">$125</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Ratatouille '
, 125 );">
<input type="button" value="View Cart" onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item center">
<img src="itemimages/Images_1/Action toys and figures/Resin figures.jpeg" width="213" height="192" /><br />
<p>Resin figures</p><span class="price">$215</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Resin'
+ 'figures', 215 );">
48
<input type="button" value="View Cart" onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item">
<img src="itemimages/Images_1/Action toys and figures/StarWars.jpeg" width="213" height="192" /><br />
<p>StarWars</p><span class="price">$85</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'StarWars ', 85 );">
<input type="button" value="View Cart" onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item">
<img src="itemimages/Images_1/Action toys and figures/Street Fighters.jpeg" width="213" height="192" /><br />
<p>Street Fighters</p><span class="price">$35</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Street'
+ 'Fighters', 35 );">
<input type="button" value="View Cart" onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item center">
<img src="itemimages/Images_1/Action toys and figures/Transformers.jpeg" width="213" height="192" /><br />
<p>Transformers</p><span class="price">$27</span><br />
<input type="button" value="Add to cart" onClick="JavaScript: addItem( 'Transformers ', 27 );">
<input type="button" value="View Cart"onClick="JavaScript: document.location='viewcart.jsp';">
</div>
<div class="item">
49
<img src="itemimages/Images_1/Action toys and figures/X-figures.jpeg" width="213" height="192" /><br />
<p>X-figures</p><span class="price">$40</span><br />
<input type="button" value="Add to cart"onClick="JavaScript: addItem( 'X-figures ', 40 );">
<input type="button" value="View Cart" onClick="JavaScript: document.location='viewcart.jsp';">
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</body>
</html>
50
VIEWCART.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>View Cart</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style3.css" />
<script language="JavaScript">
<!--
function getCookieValue( name )
{
var c = document.cookie;
var begin = c.indexOf( name );
if( begin < 0 ) return( "" );
begin += name.length + 1;
var end = c.indexOf( ";", begin );
if( end == -1 ) end = c.length;
return( c.slice( begin, end ) );
}
51
function removeItem( name )
{
document.cookie = name + "=;";
document.location = document.location;
}
function getItemName( item )
{
var c = getCookieValue( item );
if( c )
{
return( c.split( "," )[0] );
}
else return( "" );
}
function getItemPrice( item )
{
var c = getCookieValue( item );
if( c )
{
return( c.split( "," )[1] );
}
52
else return( "" );
}
// -->
</script>
</head>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="topnav">
<span><strong>Welcome</strong> | <a href="index.jsp">Home</a></span>
</div>
<b><font size="10" color=#FF0080>BABY STORE </font></b>
<br>
<font size="6" color=#408080>for all your paraphernalia needs</font><br><br>
<br>
<font size="4" color=#408080>Details of Items present in the cart </font><br><br>
</div>
<form>
<table width="100%" border="2">
<script language="JavaScript">
<!--
for( i = 1 ; i <= parseInt( getCookieValue( "items" ) ) ; i++ )
{
document.write( "<tr><td>" );
53
document.write( getItemName( "item" + i ) + "</td><td>" );
document.write( "$" + getItemPrice( "item" + i ) );
document.write( "<input type='button' value='Remove' " +
"onClick='JavaScript: removeItem( \"item" +i + "\" );'>" );
document.write( "</td></tr>" );
}
// -->
</script>
<tr><td colspan="3" align="center">
<input type="button" value="Back to shopping"
onClick="JavaScript: document.location='index.jsp';">
<input type="button" value="purchase"
onClick="JavaScript: document.location='purchase.jsp';">
</td></tr>
</table>
<center> <img align="center" src="images/shopcart.jpg" width="400" height="300"></center>
</form>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</body>
</html>
54
PURCHASE.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Store Checkout</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style3.css" />
<script language="JavaScript">
<!--
var total = 0;
function getCookieValue( name )
{
var c = document.cookie;
var begin = c.indexOf( name );
if( begin < 0 ) return( "" );
begin += name.length + 1;
var end = c.indexOf( ";", begin );
if( end == -1 ) end = c.length;
return( c.slice( begin, end ) );
}
function getItemName( item )
55
{
var c = getCookieValue( item );
if( c )
{
return( c.split( "," )[0] );
}
else return( "" );
}
function getItemPrice( item )
{
var c = getCookieValue( item );
if( c )
{
return( c.split( "," )[1] );
}
else return( "" );
}
function fixTotal( n )
{
n *= 100;
var good = parseInt( n );
while( good < n ) good += 1;
return( good / 100 );
}
// -->
</script>
56
</head>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="topnav">
<span><strong>Welcome</strong> | <a href="index.jsp">Home</a></span>
</div>
<b><font size="10" color=#FF0080>BABY STORE </font></b>
<br>
<font size="6" color=#408080>for all your paraphernalia needs</font><br><br>
<br>
<font size="4" color=#408080>Your Total Bill </font><br><br>
</div>
<form>
<table width="100%" border="2">
<script language="JavaScript">
<!--
for( i = 1 ; i <= parseInt( getCookieValue( "items" ) ) ; i++ )
{
if( getItemName( "item" + i ) != "" &&
getItemPrice( "item" + i ) != undefined )
{
document.write( "<tr><td>" );
document.write( getItemName( "item" + i ) + "</td><td>" );
document.write( getItemPrice( "item" + i ) );
document.write( "</td></tr>" );
57
total += parseFloat( getItemPrice( "item" + i ) );
}
}
// -->
</script>
<tr>
<td><b>Total</b></td>
<td>$
<script language="JavaScript">
<!--
document.write( fixTotal( total ) );
-->
</script>
</td>
</tr>
</table>
<input type="button" value="back to shopping"
onClick="JavaScript: document.location='index.jsp';">
<%session.setAttribute("item",0);
String s2=session.getAttribute("emailid").toString().toUpperCase();
if(s2=="")
{%>
<input type="button" value=" check out"
58
onClick="JavaScript: document.location='login.jsp';">
<%}else{%>
<input type="button" value=" check out"
onClick="JavaScript: document.location='checkout.jsp';">
<%}%>
<table width="100%">
<tr>
<td>
<img align="left" src="images/shopbag1.jpg" width="400" height="300">
</td>
<td>
<img align="right" src="images/shopbag2.jpg" width="400" height="300">
</td>
</tr>
</table>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</form>
</body>
</html>
59
CHECKOUT.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style3.css" />
<title>checkout1</title>
</head>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="topnav">
<span><strong>Welcome</strong> | <a href="index.jsp">Home</a></span>
</div>
<b><font size="10" color=#FF0080>BABY STORE </font></b>
<br>
<font size="6" color=#408080>for all your paraphernalia needs</font><br><br>
<br>
</div>
<form action="checkout1.jsp">
60
<br>
<br>
<script language="JavaScript">
var imageList = new Array;
imageList[0] = new Image;
imageList[0].src = "images/adlogo2.jpg";
imageList[1] = new Image;
imageList[1].src = "images/adlogo1.jpg";
imageList[2] = new Image;
imageList[2].src = "images/dhl.jpg";
imageList[3] = new Image;
imageList[3].src = "images/adlogo3.jpg";
imageList[4] = new Image;
imageList[4].src = "images/adlogo2.jpg";
function slideShow(imageNumber) {
document.slideShow.src =imageList[imageNumber].src;
imageNumber += 1;
if (imageNumber < imageList.length) {
window.setTimeout("slideShow(" + imageNumber+ ")",3000);
}
}
</script>
<right> <img src="images/adlogo2.jpg" alt="" width="100%" height="200" border="0" name="slideShow" /></right>
<table align="center" width="682">
<tr align="left"><TD height=34>  </TD><td align="center">
61
<h1 align="center" style="color:#8D38C9">SHIPPING AND CONTACT DETAILS</h1></td></tr>
<TR align="left">
<TD height=34> </TD>
<TD height=34>Name</TD>
<TD> <input type="text" name="name" value="" /></TD>
</TR>
<TR align="left">
<TD height=34> </TD>
<TD height=34>MobileNo</TD>
<TD> <input type="text" name="mobile" value="" /></TD>
</TR>
<TR align="left">
<TD height=34> </TD>
<TD height=34>LandlineNo</TD>
<TD><input name="land" type="text" value=""></TD>
</TR>
<TR align="left">
<TD height=34> </TD>
<TD height=34>Address</TD>
<TD><input name="address" type="text" value=""></TD>
</TR>
<TR align="left">
<TD height=34> </TD>
<TD height=34>City</TD>
<TD><input name="city" type="text" value=""></TD>
</TR>
62
<TR align="left">
<TD height=34> </TD>
<TD height=34>State</TD>
<TD><input name="state" type="text" value=""></TD>
</TR>
<TR align="left">
<TD height=34> </TD>
<TD height=34>Country</TD>
<TD><input name="country" type="text" value=""></TD>
<TD align="left" height=53> <INPUT type="submit"
value="submit">
</TR>
</table>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</form>
</body>
</html>
63
DETAILS.JSP
<%@page session="true" contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
int s1=Integer.parseInt(session.getAttribute("item").toString());
if(s1==0){
%>
<script language="JavaScript">
<!--
var total = 0;
function getCookieValue( name )
{
var c = document.cookie;
var begin = c.indexOf( name );
if( begin < 0 ) return( "" );
begin += name.length + 1;
var end = c.indexOf( ";", begin );
if( end == -1 ) end = c.length;
return( c.slice( begin, end ) );
}
64
function getItemName( item )
{
var c = getCookieValue( item );
if( c )
{
return( c.split( "," )[0] );
}
else return( "" );
}
function getItemPrice( item )
{
var c = getCookieValue( item );
if( c )
{
return( c.split( "," )[1] );
}
else return( "" );
}
function fixTotal( n )
{
n *= 100;
var good = parseInt( n );
while( good < n ) good += 1;
return( good / 100 );
}
// -->
65
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style3.css" />
<title>details</title>
</head>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="topnav">
<span><strong>Welcome</strong> | <a href="index.jsp">Home</a></span>
</div>
<b><font size="10" color=#FF0080>BABY STORE </font></b>
<br>
<font size="6" color=#408080>for all your paraphernalia needs</font><br><br>
<br>
<br>
<br>
</div>
<form action="payment.jsp">
<center><h1>PRODUCT DETAILS</h1></center>
<table style="font:bold ;color:white" align="center" bgcolor=#2B60DE width="600" border="6" cellspacing="2" cellpadding="2"><tr><td><b>item names</b></td><td><b>shipping address</b></td><td><b>total price</b></td></tr>
<tr><td> <script language="JavaScript">
66
<!--
for( i = 1 ; i <= parseInt( getCookieValue( "items" ) ) ; i++ )
{
if( getItemName( "item" + i ) != "" &&
getItemPrice( "item" + i ) != undefined )
{
document.write( getItemName( "item" + i ) );
total += parseFloat( getItemPrice( "item" + i ) );
}
}
// -->
</script></td>
<td>
<%
String s2=session.getAttribute("address").toString().toUpperCase();
out.println(s2);
%></td>
<td><script language="JavaScript">
<!--
document.write( fixTotal( total ) );
-->
</script></td></tr>
<tr width="400"><td><input type="submit" value="review & confirm" /></td></tr>
</table>
<br>
<br>
67
<br>
<p>
*Please click on review and confirm to make payement and generate your order.
</p>
</form>
<%}else{%>
<%
try {
/* Create string of connection url within specified format with machine
name, port number and database name. Here machine name id localhost and
database name is student. */
String connectionURL = "jdbc:odbc:perry";
// declare a connection by using Connection interface
Connection connection = null;
/* declare object of Statement interface that is used for executing sql
statements. */
Statement statement = null;
// declare a resultset that uses as a table for output data from tha table.
ResultSet rs = null;
// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
/* Create a connection by using getConnection() method that takes parameters
of string type connection url, user name and password to connect to database.*/
connection = DriverManager.getConnection(connectionURL, "", "");
/* createStatement() is used for create statement object that is used for
sending sql statements to the specified database. */
68
statement = connection.createStatement();
// sql query to retrieve values from the secified table.
String QueryString = "SELECT * from items1 where id='"+s1+"'";
rs = statement.executeQuery(QueryString);
while (rs.next()) {
%>
<form action="payment.jsp">
<h1>PRODUCT DETAILS</h1>
<table width="400" border="4" cellspacing="2" cellpadding="2"><tr><td><b>item names</b></td><td><b>shipping address</b></td><td><b>total price</b></td></tr>
<tr><td><%=rs.getString(1)%></td>
<td>
<%
String s2=session.getAttribute("address").toString().toUpperCase();
out.println(s2);
%></td>
<td><%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%=rs.getString(4)%> <%}
rs.close();
statement.close();
connection.close();
} catch (Exception ex) {
%>
<%
69
out.println("Unable to connect to database.");}
%>
</td></tr>
<tr width="400"><td><input type="submit" value="review & confirm" /></td></tr>
</table>
<br>
<br>
<br>
<br>
</form>
<%}%>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</body>
</html>
70
PAYMENT.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>payment</title>
</head>
<script language="javascript">
function checkCreditCard(card){
if(card.length==0){
window.alert("you must provide a number");
return false;
}
card=card.replace("","");
if(card.length!=16){
window.alert("Should be 16-digit");
return false;
}
else{
return true;
71
}
for (i=0; i<card.length; i++) {
if (card.charAt(i) < "0" || card.charAt(i) > "9") {
window.alert("CCard must only contain numbers.");
return false;
}
}
return true;
}
function checkForm(formObj) {
return checkCreditCard(formObj.myField.value); }
</script>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="topnav">
<span><strong>Welcome</strong> | <a href="index.jsp">Home</a></span>
</div>
<b><font size="10" color=#FF0080>BABY STORE </font></b>
<br>
<font size="6" color=#408080>for all your paraphernalia needs</font><br><br>
<br>
<br>
<br>
</div>
<form name="myForm" action="thanks.jsp"
72
onSubmit="return checkForm(this);">
<center>
Credit Card No. <input type="text" name="myField"> <font color="red" size="3" >**Should be 16-digit</font> <br><br>
<input type="radio" name="creditcard" value="" />VISA <br> <br>
<input type="radio" name="creditcard" value="" />AMERICAN EXPRESS <br> <br>
<input type="radio" name="creditcard" value="" />MASTER CARD<br><br>
<input type="submit"name="Submit" value="Submit">
</center>
<br>
<br>
<p>
<font color="red" style="italics" size="3">
*Disclaimer<br> <br>
1.The mode of payement provided is through credit card.<br>
2.The credit card should be valid uptill the date of delivery.<br>
3.Personal information as entered by the customer will remain secure with us.
</font>
</p>
</form>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</body>
</html>
73
THANKS.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.util.*" %>
<html>
<head>
<title>thanks</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style3.css" />
</head>
<body onload="slideShow(0)">
<div>
<img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" />
<div class="topnav">
<%
String s3=session.getAttribute("address").toString().toUpperCase();
String s2=session.getAttribute("emailid").toString().toUpperCase();
%>
<font size="5" color="blue"> <span><strong>THANKS FOR SHOPPING</strong></font>
<img align="right" src="images/baby3.jpg" width="400" height="400">
<br><br> <br><br><br><br>
<font size="4" color="red">
74
Shipping Address :<%=s3%>
<br><br> <br><br>
<bottom>
Your personal details have been saved with us for future transactions<%=s2%>
</bottom>
<br><br> <br><br>
<bottom>
The order will be delivered at this address within next 48 hours
You have to pay the shipping cost that is 50$ at the time of delivery
</bottom>
</span>
</font>
</div>
</div>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</body>
</html>
75
SEARCH.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Baby Shopping</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style3.css" />
</head>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="topnav">
<span><strong>Welcome</strong> | <a href="index.jsp">Home</a></span>
</div>
<script language="javascript">
function val(f){
if(f.item.value==""){
alert("please enter something");
f.item.focus();
return false;
}
return true;
}
76
</script>
<div id="main">
<img src="images/photo.jpg" alt="" width="682" height="334" border="0" usemap="#Map" name="slideShow" />
<br />
<div>
<h3><font color=#FF0080> SEARCH ON THE BASIS OF ITEM OR CATEGORY</font></h3><br><br>
<FORM name=form method="post" action="searcheditem.jsp" >
ITEM NAME<input type="text" name="item" value="" /><br/><br/><br/><br/>
CATEGORY<select name="category">
<option>action toys & figures </option>
<option>arts & crafts</option>
<option>discovery & learning</option>
<option>dolls & soft toys</option>
<option>games & puzzles</option>
<option>collectibles</option>
<option>infants & preschool</option>
<option>novelity & virtual</option>
<option>outdoors</option>
<option>tv & films</option>
</select>
<input type="submit" value="search" />
</form>
</div>
77
</div>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</body>
</html>
78
SEARCHEDITEM.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="data" class="search.searchitem"/>
<jsp:setProperty name="data" property="*"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style3.css" />
<title>Searched item</title>
</head>
<body onload="slideShow(0)">
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<%
if(data.search(out,request,response)==true){
out.println("");
}
%>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</body>
</html>
79
SELL.JSP
<html>
<head>
<title>Baby Shop</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style3.css" />
</head>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="topnav">
<span><strong>Welcome</strong> | <a href="index.jsp">Home</a></span>
</div>
<br>
<script language="JavaScript" type="text/JavaScript">
<!--
function call(form1)
{
if(document.form1.file.value=="")
{
alert("Please give the path of file!!!!");
form1.file.select();
form1.file.focus();
return false;
}
80
return true;
}
//-->
</script>
<div id="main">
<div style="font:14;color:lime;width:682;height:334 ">
<table width="682" >
<form name="form1" method="post" onsubmit="javascript: return call(this);" action="sold.jsp">
<tr align="left"><TD height=34>  </TD><td align="center"><h1 align="center" ><font color=#FF0080>ADD ITEM</font></h1></td></tr>
<br>
<br>
<TR align="left">
<TD height=34> </TD>
<TD height=34>Please select the browse button to select the photo</TD>
<TD> <input type="file" name="file" /></TD>
</TR>
<TR align="left">
<TD height=34> </TD>
<TD height=34>Enter your item name</TD>
<TD> <input type="text" name="profile" /></TD>
</TR>
<TR>
<TD width=20></TD>
<TD width=125 height=34>
81
Select the Category</TD>
<TD width=200><select size=1
name="category">
<option
value="cat">Action toys & figures</option>
<option
value="vikas puri">EAST DELHI</option>
<option
value="vikas puri">WEST DELHI</option>
<option
value="vikas puri">SOUTH DELHI</option>
</select></TD>
</TR>
<TR align="left">
<TD height=34> </TD>
<TD height=34>Enter your expected price</TD>
<TD><input name="price" type="text" /></TD>
</TR>
<TR align="left">
<TD height=34> </TD>
<TD height=34>submit</TD>
<TD><input name="Submit" type= "Submit" vaulue="submit"></TD>
</TR>
</form>
</table>
</div>
82
</div>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</body>
</html>
83
SOLD.JSP
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<jsp:useBean id="data3" class="photo.photobean"/>
<jsp:setProperty name="data3" property="request" value="<%=request%>" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Sell old products</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<br>
<br>
<%String name=request.getParameter("file");
if(name==null)
{
}
else
{
request.setAttribute("file1",name);
84
}
%>
<%
boolean reply=data3.photoloadb();
if(reply==true)
{%>
<table width="529" align="center" border="1" cellspacing="2" cellpadding="2">
<tr>
<td width="517" height="43" align="center" ><h4 align="center"><strong><span class="style2">....You have Successfully Stored Your Item... </span></strong></h4></td>
</tr></table>
<font size="18"><table width="403" align="center" border="1" cellspacing="2" cellpadding="2">
</tr></table>
</font><table width="403" align="center" border="1" cellspacing="2" cellpadding="2">
<td width="391" align="center"><a href="index.jsp">go to home page</a> </td>
</tr></table>
<font size="18"><table width="403" align="center" border="1" cellspacing="2" cellpadding="2">
</tr></table>
</font><table width="403" align="center" border="1" cellspacing="2" cellpadding="2">
<td align="center"><span class="style3"><a href="sell.jsp">...Go to previous page... </a></span></td>
</tr></table>
<font size="18">
<table width="403" align="center" border="1" cellspacing="2" cellpadding="2">
<%}
else if(reply==false)
85
{ %>
<td height="59" ><p align="center">You have not successfully stored your item..</p>
<p align="center">plz try again later !!! </p>
<p><center><a href="sell.jsp">Go To Previous Page...</a></center></p>
<p><center><a href="index.jsp">Go To Home Page...</a></center></p></td>
</table> <% }
%>
</font>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</body>
</html>
86
PRODUCTS.JSP
<%@page session="true" contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="data" class="edow.loginbean"/>
<jsp:setProperty name="data" property="*"/>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%
try {
/* Create string of connection url within specified format with machine
name, port number and database name. Here machine name id localhost and
database name is student. */
String connectionURL = "jdbc:odbc:perry";
// declare a connection by using Connection interface
Connection connection = null;
/* declare object of Statement interface that is used for executing sql
statements. */
Statement statement = null;
// declare a resultset that uses as a table for output data from tha table.
ResultSet rs = null;
// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
/* Create a connection by using getConnection() method that takes parameters
of string type connection url, user name and password to connect to database.*/
87
connection = DriverManager.getConnection(connectionURL, "", "");
/* createStatement() is used for create statement object that is used for
sending sql statements to the specified database. */
statement = connection.createStatement();
// sql query to retrieve values from the secified table.
String QueryString = "SELECT * from items1";
rs = statement.executeQuery(QueryString);
%>
<script language="JavaScript">
<!--
function addItem( name, price )
{
var i = 1;
for( ; getCookieValue( "item" + i ) != "" ; i++ );
document.cookie = "item" + i + "=" + name + "," + price;
document.cookie = "items=" + i;
}
function getCookieValue( name )
{
var c = document.cookie;
var begin = c.indexOf( name );
if( begin < 0 ) return( "" );
begin += name.length + 1;
var end = c.indexOf( ";", begin );
if( end == -1 ) end = c.length;
88
return( c.slice( begin, end ) );
}
// -->
</script>
<html>
<head>
<title>Baby Shop</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="topnav">
<span><strong>Welcome</strong> </span>
<%
String s2=session.getAttribute("emailid").toString().toUpperCase();
if(s2=="")
{%><a href="login.jsp">Log in</a> | <a href="register.jsp">Register</a></span>
<%}else{out.println(s2);
%><a href="index.jsp">sign out</a><%}%>
</div>
<%if(s2==""){%>
89
<%}%>
</div>
<%
while (rs.next()) { int i=rs.getRow();i++;
%>
<div id="content">
<div id="sidebar">
</div>
<div id="items">
<table align="right"><tr><td>
</form></td>
</tr></table>
<table>
<div class="item">
<a href="buy.jsp?id=<%=i%>"><img src="<%=rs.getString(3)%>" width="213" height="192" /></a><br />
<p><%=rs.getString(1)%></p><span class="price"><%=rs.getInt(4)%>$</span><br />
</table>
</div>
<%}
rs.close();
statement.close();
connection.close();
} catch (Exception ex) {
90
%>
<%
out.println("Unable to connect to database.");
}
%>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</body>
</html>
91
BUY.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="data3" class="buy.buying"/>
<jsp:setProperty name="data3" property="*"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Buy old products</title>
</head>
<body>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<center>
<%
if(data3.search(out,request,response)==true){
}
int s1=(Integer.parseInt(request.getParameter("id")));
session.setAttribute("item", s1--);
%>
</center>
<br>
<br>
92
<br>
<br>
<center>
<a href="checkout.jsp"><img src="images/buynow.jpg"/></a>
</center>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</body>
</html>
93
REVIEW.JSP
<%@page session="true" contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="data" class="edow.loginbean"/>
<jsp:setProperty name="data" property="*"/>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%
try {
/* Create string of connection url within specified format with machine
name, port number and database name. Here machine name id localhost and
database name is student. */
String connectionURL = "jdbc:odbc:perry";
// declare a connection by using Connection interface
Connection connection = null;
/* declare object of Statement interface that is used for executing sql
statements. */
Statement statement = null;
// declare a resultset that uses as a table for output data from tha table.
ResultSet rs = null;
// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
/* Create a connection by using getConnection() method that takes parameters
of string type connection url, user name and password to connect to database.*/
94
connection = DriverManager.getConnection(connectionURL, "", "");
/* createStatement() is used for create statement object that is used for
sending sql statements to the specified database. */
statement = connection.createStatement();
// sql query to retrieve values from the secified table.
String QueryString = "SELECT * from items1";
rs = statement.executeQuery(QueryString);
%>
<script language="JavaScript">
<!--
function addItem( name, price )
{
var i = 1;
for( ; getCookieValue( "item" + i ) != "" ; i++ );
document.cookie = "item" + i + "=" + name + "," + price;
document.cookie = "items=" + i;
}
function getCookieValue( name )
{
var c = document.cookie;
var begin = c.indexOf( name );
if( begin < 0 ) return( "" );
begin += name.length + 1;
var end = c.indexOf( ";", begin );
if( end == -1 ) end = c.length;
95
return( c.slice( begin, end ) );
}
// -->
</script>
<html>
<head>
<title>Baby Shop</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="topnav">
<span><strong>Welcome</strong> </span>
<%
String s2=session.getAttribute("emailid").toString().toUpperCase();
if(s2=="")
{%><a href="login.jsp">Log in</a> | <a href="register.jsp">Register</a></span>
<%}else{out.println(s2);
%><a href="index.jsp">sign out</a><%}%>
</div>
<%if(s2==""){%>
96
<ul id="menu">
<li><a href="index.jsp"><img src="images/but1.gif" alt="" width="110" height="32" /></a></li>
<li><a href="login.jsp"><img src="images/but2.gif" alt="" width="110" height="32" /></a></li>
<li><a href="register.jsp"><img src="images/but3.gif" alt="" width="110" height="32" /></a></li>
<li><a href="login.jsp"><img src="images/but4.gif" alt="" width="110" height="32" /></a></li>
<li><a href="viewcart.jsp"><img src="images/but5.gif" alt="" width="110" height="32" /></a></li>
<li><a href="checkout.jsp"><img src="images/but6.gif" alt="" width="110" height="32" /></a></li>
</ul>
<%}%>
</div>
<%
while (rs.next()) { int i=rs.getRow();i++;
%>
<div id="content">
<div id="sidebar">
</div>
<div id="items">
<table align="right"><tr><td>
</form></td></tr></table>
97
<table>
<div class="item">
<a href="givereview.jsp?id=<%=i%>"><img src="<%=rs.getString(3)%>" width="213" height="192" /></a><br />
<p><%=rs.getString(1)%></p><span class="price"><%=rs.getInt(4)%></span><br />
</table>
</div>
<%}
rs.close();
statement.close();
connection.close();
} catch (Exception ex) {
%>
<%
out.println("Unable to connect to database.");
}
%>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</body>
</html>
98
GIVEREVIEW.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="data3" class="buy.buying"/>
<jsp:setProperty name="data3" property="*"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style3.css" />
<title>Review</title>
</head>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<p>
<br>
<br>
<br>
<h3 align="center"> <font color=#FF0080>We would greatly appreciate your feedback about our products </font> </h3>
99
</p>
<br>
<br>
<%
if(data3.search(out,request,response)==true){
}
int s1=(Integer.parseInt(request.getParameter("id")));
session.setAttribute("item", s1--);
%>
<form action="reviewdone.jsp">
<center>
**Kindly enter the Name of the product also
<textarea name="review" rows="4" cols="20">
</textarea>
<br>
<br>
<input type="submit" value="submit"
</center>
</form>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</body>
</html>
100
REVIEWDONE.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Thanks for review!</title>
</head>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<div class="topnav">
<span><strong>Welcome</strong> <a href="login.jsp">Log in</a> | <a href="register.jsp">Register</a></span>
<br>
<br>
<br>
</div>
<jsp:useBean id="ship" class="shipping.shippingbean" />
<jsp:setProperty name="ship" property="*" />
101
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%String name = request.getParameter("review");
/* Create string of connection url within specified
format with machine name,
port number and database name. Here machine name id
localhost and database name is student. */
String s=session.getAttribute("item").toString();
String s1=session.getAttribute("emailid").toString();
String connectionURL = "jdbc:odbc:perry";
// declare a connection by using Connection interface
Connection connection = null;
// declare object of Statement interface that uses for
//executing sql statements.
PreparedStatement pstatement = null;
// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
int updateQuery = 0;
// check if the text box is empty
if(name!=null){
// check if the text box having only blank spaces
if(name!="" ) {
102
try {
/* Create a connection by using getConnection()
method that takes parameters of string type
connection url, user name and password to connect
to database. */
connection = DriverManager.getConnection
(connectionURL, "", "");
// sql query to insert values in the secified table.
String queryString = "INSERT INTO reviews(id, review,email) VALUES (?,?,?)";
/* createStatement() is used for create statement
object that is used for
sending sql statements to the specified database. */
pstatement = connection.prepareStatement(queryString);
pstatement.setString(1, s);
pstatement.setString(2, name);
pstatement.setString(3,s1);
updateQuery = pstatement.executeUpdate();
if (updateQuery != 0) {out.println(" " + "Thanks for giving your review..!"); %>
<br>
<br>
<br>
<br>
<center>
<table style="background-color: #F6CEF5;"
WIDTH="30%" border="1">
<tr><th>Data is inserted successfully
103
in database.</th></tr>
</table>
</center>
<br>
<br>
<br>
<br>
<%
}
}
catch (Exception ex) {
out.println("Unable to connect to batabase.");
}
finally {
// close all the connections.
pstatement.close();
connection.close();
}
}
}
%>
<center> <img align="center" src="images/thanks.jpg" width="400" height="300"></center>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</body>
</html>
104
CONTACT.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Contact us</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style2.css" />
</head>
<body onload="slideShow(0)">
<div>
<a href="#"><img src="images/logo.gif" width="237" height="123" class="float" alt="setalpm" /></a>
<span><strong>Welcome</strong>
<%
String s2=session.getAttribute("emailid").toString().toUpperCase();
if(s2=="")
{%><a href="login.jsp">Log in</a> | <a href="register.jsp">Register</a></span>
<%}else{out.println(s2);
%><a href="index.jsp">sign out</a><%}%>
</div>
105
</div>
<div id="content">
<div id="sidebar">
</div>
<div id="main">
<img src="images/photo.jpg" alt="" align ="left" width="682" height="334" border="0" usemap="#Map" name="slideShow" />
<br />
</div>
</div>
<div id="inside">
<div class="info">
<p>
<b> Contact Details :</b><br>
<br>
Address :<br>
4th Floor, Camex House,<br>
Near. Samved Hospital<br>
Stadium - Commerce Road,<br>
Navrangpura, Ahmedabad 380 009<br>
Gujarat, India.<br>
<br><br>
<b>Mon to Fri Timings :</b> 0930 - 1830 hrs IST<br>
<b>Sat Timings :</b> 0930 - 1400 hrs IST<br>
106
FAX (India) : +91-79-6630 7311<br>
<font color="red">In case you get an answering machine, please leave a detailed message</font>
</p>
</div>
</div>
</div>
<div id="footer">
<img src="images/cards.jpg" alt="" width="919" height="76" />
</div>
</body>
</html>
107
BUY.BUYING.JAVA
package buy;
import java.sql.*;
import javax.servlet.jsp.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class buying {
private String item,code,image;
private int id;
public int getid()
{
return id;
}
public void setid(int id)
{
this.id=id;
}
public String getitem()
{
return item;
}
public void setitem(String item)
{
this.item=item;
108
}
public String getcode()
{
return code;
}
public void setcode(String code){
this.code=code;
}
public String getimage()
{
return image;
}
public void setimage(String image){
this.image=image;
}
public boolean search(JspWriter out,javax.servlet.ServletRequest request,javax.servlet.ServletResponse response) throws Exception
{int s1=(Integer.parseInt(request.getParameter("id")));
s1--;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:perry","", "");
try{boolean flag=false;
Statement stm=con.createStatement();
ResultSet rs=stm.executeQuery("select * from items1 where id='"+s1+"'");
response.setContentType("image/jpeg");
response.setContentType("text/html");
while(rs.next())
109
{
String item=rs.getString(1);
String code=rs.getString(2);
String image=rs.getString(3);
String price=rs.getString(4);
out.println("<table border='2' align='center'><tr><td><img src='"+image+"'width='300'height='200' /></td></tr></table><table align='center' border='1'width='300'><tr><td><b><font color='red'>PRODUCTFEATURES </b></td></tr><br/><tr><td><p>item:"+item+"</p></td></tr><tr><td><span class='price'>price:"+price+"</span></td></tr><br></font></table>");
flag=true;
}return flag;
}
catch(Exception e)
{
return false;
}
}
}
110
EDOW.LOGINBEAN.JAVA
package edow;
import java.sql.*;
public class loginbean {
private static String email,password;
public String getemail()
{
return email;
}
public void setemail(String email)
{
this.email=email;
}
public String getpassword()
{
return password;
}
public void setpassword(String password){
this.password=password;
}
public boolean login() throws Exception
{boolean flag=false;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:perry","", "");
try{
111
Statement stm=con.createStatement();
ResultSet rs=stm.executeQuery("select * from login");
while(rs.next())
{
if((rs.getString(4).equals(password)) && (rs.getString(3).equals(email)))
{
flag=true;
}
}
return flag;
}
catch(Exception e)
{
return false;
}
}
}
112
EDOW.PHOTOINDEXBEAN.JAVA
package edow;
import java.sql.*;
import java.io.*;
public class photoindexbean
{
public boolean photoloadd(String s1,String profile,String category,String price,int id)throws Exception
{try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:perry","", "");
PreparedStatement s = con.prepareStatement("insert into items1(item,category,image,price,id)values(?,?,?,?,?)");
s.setString(1, profile);
s.setString(2, category);
s.setString(3,s1);
s.setString(4,price );
s.setInt(5,id);
s.executeUpdate ();
s.close ();
}
catch(Exception e){
System.out.println("Exception is ;"+e);
}
return true;
}
}
113
PACK.REGISTRATIONBEAN.JAVA
package pack;
import java.sql.*;
import javax.servlet.jsp.*;
import java.sql.*;
public class registrationbean {
private String initial,finalname,email,pass,area,dob,contact;
public String getinitial()
{
return initial;
}
public void setinitial(String initial)
{
this.initial=initial;
}
public String getfinalname()
{
return finalname;
}
public void setfinalname(String finalname){
this.finalname=finalname;
}
public String getemail()
{
return email;
114
}
public void setemail(String email){
this.email=email;
}
public String getpass()
{
return pass;
}
public void setpass(String pass){
this.pass=pass;
}
public String getarea()
{
return area;
}
public void setarea(String area){
this.area=area;
}
public String getdob()
{
return dob;
}
public void setdob(String dob){
this.dob=dob;
}
public String getcontact()
115
{
return contact;
}
public void setcontact(String contact){
this.contact=contact;
}
public boolean registrationd() throws Exception
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:perry","", "");
Try{
PreparedStatement s = con.prepareStatement("insert into login(initial,finalname,email,pass,area,dob,contact)values(?,?,?,?,?,?,?)");
s.setString(1, initial);
s.setString(2, finalname);
s.setString(3,email );
s.setString(4, pass);
s.setString(5, area);
s.setString(6, dob);
s.setString(7, contact);
s.executeUpdate();
s.close();
}
catch(Exception e){
System.out.println("Exception is ;"+e);
}
return true;
116
}
public boolean showinfo(JspWriter out)
{
try
{
Connection con=DriverManager.getConnection("jdbc:odbc:perry","","");
Statement s=con.createStatement();
ResultSet rs=s.executeQuery("select * from stores");
while(rs.next())
{String name=rs.getString(1);
String location=rs.getString(2);
String contact=rs.getString(3);
String manager=rs.getString(4);
out.println("<table width='845' height='119' border='1'><tr><td width='122' rowspan='3'>"+name+"</td><td width='125' height='20'>LOCATION-:</td><td width='255'>"+location+"</td></tr><tr><td height='20'>CONTACT-:</td><td>"+contact+"</td></tr><tr><td height='20'>MANAGER-:</td><td>"+manager+"</td></tr></table><br>");
}
}
catch(Exception e)
{
e.printStackTrace();}
return true;
}
public boolean show(JspWriter out)
{
117
try
{
Connection con=DriverManager.getConnection("jdbc:odbc:perry","","");
Statement s=con.createStatement();
ResultSet rs=s.executeQuery("select * from prices where storename='spencer' and category='home'");
while(rs.next())
{
String item=rs.getString(2);
String price=rs.getString(4);
out.println("<table align='left' width='200' height='50' style='margin-bottom:20;margin-top:40;border-color:lime' border='4'><tr><th>"+"spencer"+"</th></tr><tr><td width='100' height='20'>item</td><td width='100' height='20'>price</td></tr><tr><td width='100'>"+item+"</td><td width='100'>"+price+"</td></tr></table>");
}
ResultSet rs1=s.executeQuery("select * from prices where storename='easy day' and category='home'");
while(rs1.next())
{
String item=rs1.getString(2);
String price=rs1.getString(4);
ut.println("<table align='center' width='200' height='50' border='4' style='margin-bottom:20;margin-top:40;border-color:lime'><tr><th>"+"easy day"+"</th></tr><tr><td width='100' height='20'>item</td><td width='100' height='20'>price</td></tr><tr><td width='100'>"+item+"</td><td width='100'>"+price+"</td></tr></table>");
118
}
ResultSet rs2=s.executeQuery("select * from prices where storename='big apple' and category='home'");
while(rs2.next())
{
String item=rs2.getString(2);
String price=rs2.getString(4)
out.println("<table align='center' width='200' height='50' border='4' style='margin-top:0;border-color:lime;float:right'><tr><th>"+"big apple"+"</th></tr><tr><td width='100' height='20'>item</td><td width='100' height='20'>price</td></tr><tr><td width='100'>"+item+"</td><td width='100'>"+price+"</td></tr></table>");
}
}
catch(Exception e)
{
e.printStackTrace();}
return true;
}
public boolean showfruits(JspWriter out)
{
try
{
Connection con=DriverManager.getConnection("jdbc:odbc:perry","","");
Statement s=con.createStatement();
ResultSet rs=s.executeQuery("select * from prices where storename='spencer' and category='fruit'");
while(rs.next())
119
{
String item=rs.getString(2);
String price=rs.getString(4);
out.println("<table align='left' width='200' height='50' border='4' style='margin-bottom:20;margin-top:300;border-color:lime '><tr><th>"+"spencer"+"</th></tr><tr><td width='100' height='20'>item</td><td width='100' height='20'>price</td></tr><tr><td width='100'>"+item+"</td><td width='100'>"+price+"</td></tr></table><br>");
}
ResultSet rs1=s.executeQuery("select * from prices where storename='easy day' and category='fruit'");
while(rs1.next())
{
String item=rs1.getString(2);
String price=rs1.getString(4);
out.println("<table align='center' width='200' height='50' border='4' style='margin-bottom:20;margin-top:40;border-color:lime '><tr><th>"+"easy day"+"</th></tr><tr><td width='100' height='20'>item</td><td width='100' height='20'>price</td></tr><tr><td width='100'>"+item+"</td><td width='100'>"+price+"</td></tr></table><br>");
}
ResultSet rs2=s.executeQuery("select * from prices where storename='big apple' and category='fruit'");
while(rs2.next())
{
String item=rs2.getString(2);
String price=rs2.getString(4);
out.println("<table align='right' width='200' height='50' border='4' style='margin-bottom:20;margin-top:40;border-color:lime '><tr><th>"+"big apple"+"</th></tr><tr><td width='100' height='20'>item</td><td width='100' height='20'>price</td></tr><tr><td width='100'>"+item+"</td><td width='100'>"+price+"</td></tr></table><br>");
120
}
}
catch(Exception e)
{
e.printStackTrace();}
return true;
}
}
121
PHOTO.PHOTOBEAN.JAVA
package photo;
import java.io.*;
import java.sql.*;
public class photobean
{
private String profile,category,price;
private int id;
javax.servlet.ServletRequest request;
javax.servlet.ServletConfig config;
public String getcategory()
{
return category;
}
public void setcategory(String category){
this.category=category;
}
public void setProfile()
{
this.profile=profile;
}
public String getProfile()
{
return profile;
122
}
public void setprice()
{
this.price=price;
}
public String getprice()
{
return price;
}
public void setid()
{
this.id=id;
}
public int getid()
{
return id;
}
public void setRequest(javax.servlet.ServletRequest request)
{
this.request=request;
}
public boolean photoloadb() throws Exception
{
price=request.getParameter("price");
123
category=request.getParameter("category");
profile=request.getParameter("profile");
int id=addid();
String f1 =request.getAttribute("file1").toString();
edow.photoindexbean pic=new edow.photoindexbean();
return(pic.photoloadd("itemimages/"+f1,profile,category,price,id));
}
public int addid() throws Exception
{
int i=1;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:perry","", "");
Statement stm=con.createStatement();
ResultSet rs=stm.executeQuery("select * from items1");
while(rs.next())
{
i=rs.getRow();
i++;
}
return i;
}
}
124
SEARCH.SEARCHITEM.JAVA
package search;
import java.sql.*;
import javax.servlet.jsp.*;
import javax.servlet.*;
import java.sql.*;
public class searchitem {
private String item,code,image;
public String getitem()
{
return item;
}
public void setitem(String item)
{
this.item=item;
}
public String getcode()
{
return code;
}
public void setcode(String code){
this.code=code;
}
public String getimage()
{
125
return image;
}
public void setimage(String image){
this.image=image;
}
public boolean search(JspWriter out,javax.servlet.ServletRequest request,javax.servlet.ServletResponse response) throws Exception
{String s1=request.getParameter("item").toString();
String s2=(String)request.getParameter("category");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:perry","", "");
try{boolean flag=false;
Statement stm=con.createStatement();
ResultSet rs=stm.executeQuery("select * from items1 where item='"+s1+"' or category='"+s2+"'");
response.setContentType("image/jpeg");
response.setContentType("text/html");
while(rs.next())
{
String item=rs.getString(1);
String code=rs.getString(2);
String image=rs.getString(3);
int price=rs.getInt(4);
out.println("<table border='1'><tr><td><img src='"+image+"' width='213' height='192' /></td></tr><tr><td><b>PRODUCT FEATURES</b></td></tr><br/><tr><td><p>item----
126
"+item+"</p></td></tr><tr><td><span class='price'>price---- "+price+"$</span></td></td><br />");
flag=true;
}
return flag;
}
catch(Exception e)
{
return false;
}
}
}
127
SHIPPING.SHIPPINGBEAN.JAVA
package shipping;
import javax.servlet.jsp.*;
import java.sql.*;
public class shippingbean {
private String Name1, MobileNo, LandlineNo, Address, City, State, Country;
public String getName1()
{
return Name1;
}
public void setName1(String Name1)
{
this.Name1=Name1;
}
public String getMobileNo()
{
return MobileNo;
}
public void setMobileNo(String MobileNo){
this.MobileNo=MobileNo;
}
public String getLandlineNo()
{
128
return LandlineNo;
}
public void setLandlineNo(String LandlineNo){
this.LandlineNo=LandlineNo;
}
public String getAddress()
{
return Address;
}
public void setAddress(String Address){
this.Address=Address;
}
public String getCity()
{
return City;
}
public void setCity(String City){
this.City=City;
}
public String getState()
{
return State;
}
public void setState(String State){
this.State=State;
}
129
public String getCountry()
{ return Country; }
public void setCountry(String Country){
this.Country=Country;
}
public boolean shippingd() throws Exception
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:perry","", "");
try{
PreparedStatement s = con.prepareStatement("insert into shipping(name1, mobile, landline, address, city, state, country)values(?,?,?,?,?,?,?)");
s.setString(1, Name1);
s.setString(2, MobileNo);
s.setString(3, LandlineNo);
s.setString(4, Address);
s.setString(5, City);
s.setString(6, State);
s.setString(7, Country);
s.executeUpdate();
s.close();
}
catch(Exception e){
System.out.println("Exception is ;"+e);
}
return true;
}}
130
INDEX PAGE
131
LOGIN PAGE
132
ITEMS PAGE
133
VIEWCART PAGE
134
PURCHASE PAGE
135
CHECKOUT PAGE
136
PRODUCT DETAILS PAGE
137
SEARCH PAGE
138
SELL PAGE
139