Você está na página 1de 87

ABSTRACT

E-Commerce Shopping Cart is Software designed for customers to order food online.
The main aim of the project is to provide service smart security to the customers. This
system provides good and efficient information and thus making the service smarter. It is
an interface for customers to browse the catalogue and order the food online. Using the
power of Internet multiple interest parties can order with complete security and control.
ESC system maintains and processes all sort of information pertaining to the order type
options control the life cycle of an order. It provides an end to end solution to sell and
manage.
By following this new approach the information can be accessed from anywhere just
with a mouse click. This helps the users by saving lot of time and providing the user with
up to date information.

This developed package provides a good interface between the user and the database.

This new approach will guide the user if at all any invalid entries are made and provide
feedback to the users.

This will sustain reasonable amount of traffic and provide the user with the required
information without any delay.

This project provides a very good user interface such that any one can easily
understand and can access the information with least effort.

INDEX
1. INTRODUCTION
1.1 EXISTING SYSTEM

1.2 PROPOSED SYSTEM


1.3 SYSTEM OVERVIEW

2. SYSTEM SPECIFICATION
2.1 SOFTWARE REQUIREMENTS
2.2 HARDWARE REQUIREMENTS

3. REQUIREMENT ANALYSIS
3.1

PURPOSE

3.2

Overall Description

3.3

System Features

3.4

External Interface Requirements

3.5

Other Nonfunctional Requirements

4. SYSTEM DESIGN
4.1 DATA DESIGN
4.2

ARCHITECHTURAL DESIGN

5. SYSTEM IMPLEMENTATION
5.1 SAMPLE CODE
5.2 SYSTEM TESTING

6. OUTPUT SCREENS
7. SYSTEM TOOLS
3

7.1 FEATURES OF LANGUAGES USED

8. CONCLUSION
9. BIBILIOGRAPHY

INTRODUCTION

INTRODUCTION
E-Commerce Shopping Cart is Software designed for customers to order food
online. The main aim of the project is to provide service smart security to the customers.
This system provides good and efficient information and thus making the service smarter.
It is an interface for customers to browse the catalogue and order the food online. Using
the power of Internet multiple interest parties can order with complete security and
control.

ESC system maintains and processes all sort of information pertaining to the order
type options control the life cycle of an order. It provides an end to end solution to sell
and manage.
By following this new approach the information can be accessed from anywhere
just with a mouse click. This helps the users by saving lot of time and providing the user
with up to date information.
Goals For The System:

By following the new approach the information can be accessed from any where
just with a mouse click. This helps the user by saving lot of time.

The developed package should be able to create a good interface between user
and database.

It should guide the user if it all any invalid entries are made and provide feedback
to the users.

It should sustain reasonable amount of network traffic and provide the user with
the required information with out any delay.

The Goals Achieved By This Project:

This project provides a very good user interface for the user to access information
with least effort.

The system provides various functionalities to the user for any type of details
about the store.

Since the information is available on the server at any point of time from the store

updated information is provided.

1.1 Existing System:


In this very busy world and when the technology is being used efficiently to
conserve the time we cannot afford to spend so much of time. To overcome the
disadvantage of the existing system that will provide the automate information on a
system which people can access from this system, which obviously provides proper
information with minimum time consumption. Thus this new system provides the user an
easier and a better way of accessing the information.

1.2 Proposed System:


With the proposed E-commerce Shopping Cart (ESC) system Maintaining and
Processing all sort of information pertaining to Order Type options controls the lifecycle
of an order. The Order Type design tool allows you to define an unlimited number of
order types, each with unique sequence.

1.3System Overview:
E-Commerce Shopping Cart (ESC) software designed for the customer to order
the food through online. Using the power of the Internet to open your order management
application to multiple interest parties, with complete security and control.
This project is a product for cooperate business centers. The implementation of
this project has following major process modules.

Modules

Browse

Registration

Login

View Items

Add_To_Cart

Remove_From_Cart

Time of Dispatch

Checkout

1. The Browse Phase:


This module will allow the customer to browse through the store before
login. The main page will show the name and other contextual information regarding the
online store and when the customers selects the ordering option in the front page of the
ordering system it shows the criteria of displaying the products.
2. Registration Phase:
In the register phase of the application, customer will be allowed to input their
postcode to validate weather the store delivers the order to the postcode. If the validation
returns true and the order can be delivered to the customer address. The customer is
required to fill a registration from including all the necessary details that are required to
fulfill the order dispatch.
3. Login:
The customer will be allowed to login at the beginning of the shopping or at
of the shopping providing their email address as username and password. If the customer
logins in the beginning, the customer is given the choice of ordering the same as the last
time with complete view of the shopping and also to edit if required by the customer to

create new order. Adding additional items to take the union of the customers previous
order products and show after the login.
4. View Items:
The customer can at any point of time be able to view his/her shopped
products that are added to the basket and at the same time also able to update and delete
and individual and group products from the shopping list. There will be an option for the
customer to increase (+) and decrease (-) the quantity of an individual product in the
shopping basket.
5. Add_To_Cart:
The application will allow the customer to add individual products or group
of products from the shopping cart, and will automatically update the totals and others.
6. Remove_ From _Cart:
The application will allow the customer to remove individual products or group
of products from the shopping cart, and will automatically update the totals and others.

7. Time of Dispatch:
In this module the time will be displayed to the customers for delivery and it also
gives the customers option of giving time for delivery.
8. Checkout:
The customer confirms the order by clicking the checkout.

10

SYSTEM SPECIFICATION

SYSTEM SPECIFICATIONS

2.1 Software Requirements:


Operating System: Windows 2000/XP
Database: Oracle9i
Language: Java (JDBC, JSP)

11

Driver: Microsoft ODBC


Web Server: Tomcat5.0
Browser: Internet Explorer

2.2 Hardware Requirement:


CPU Pentium 4
RAM: 128MB or above
Hard Disk: 20GB or Above
Keyboard 105 Standard and Mouse

12

REQUIREMENT ANALYSIS

Software Requirements Specification


3.1 Introduction
3.1.1

Purpose

13

This SRS describes the software functional requirements for ECOMMERCE SHOPPING CART (ESC). This software is intended to be used by
the storeowner that will implement and verify the correct functioning of the
system. By adopting this process the customers can order food online and also
allow them to pay for the order with their credit/debit card.
3.1.2 Project Scope and Product Features

The ESC will provide an interface for customers to browse the catalogue
before or after login. Here the customer is allowed to view his/her shopped
products that are added to the basket .The customer can also update and delete and
individual and group products from the shopping list. Here the customer is given
an option to increase and decrease the quantity of individual products in the
shopping basket. The application even allows the customer to remove selected
items from the shopping cart, and will automatically update the totals and others.
The application will allow the customer to carry on shopping with the click button.
In the register phase of the application, customer will be allowed to input their
post code to validate whether the shop/store delivers the order to that post code. If
the validation returns true and the order can be delivered to the customer address.
The customer is required to fill a registration form including all the necessary
details that are required to fulfill the order dispatch. The customers can order food
from the on-line store to be delivered to specified area through which the time of
the customer is been saved. The main idea behind this software is that the
customer can get his food faster.
3.1.3 References
1. Cafeteria Ordering System Vision and Scope Document.

3.2 Overall Description

14

3.2.1 Product Perspective


The ESC is a new system that replaces the age old manual and telephone ordering
process and picking up food. The system is expected to evolve over several releases. The
existing system ultimately connects to the Internet ordering services for several local
restaurants and to credit and debit card authorization services.

3.2.2 User Classes and Characteristics


Customer:
The customer can browse through the store before login. When the customer
selects the ordering option has the option of selecting the range of categories or search by
the given name. If there is no search then the application will show the customer with an
alternative choice. After the completion of the order the customer has to confirm his/her
order. After the confirmation of the order the customer has to login by giving his user id
and password. After the delivery of the order the customer has to sign confirmation bill
which is given by the delivery boy.

Storeowner:
The storeowner checks the order and address of the customer, generates the bill
and asks his staff to prepare the order and asks the delivery staff to deliver it to specified
address. He asks the delivery boy get sign of the customer on confirmation bill.
3.2.4 Assumptions and Dependencies
AS-1: The ESC is open for lunch and dinner everyday.
DE-1: The operation of the ESC depends on changes being made in the store.
Depending on the availability of food items as ESC orders are accepted.

3.3. System Features

15

3.3.1 Browse
Stimulus/Response Sequences
Stimulus: Customer will give the yoursite.com to enter into the store.
Response: System shows the name and other contextual information regarding online
store.
Stimulus: Customer request for the catalogue.
Response: System displays the catalogue which is in the database.
Stimulus: Customer requests for category.
Response: The system will give all type of information regarding that category.
Stimulus: Customer requests to place an order for one or more items.
Response: System will store the list of items which are selected into the temporary
database.
Functional Requirements
Ordering. Option: The customer when selects the ordering option the system
shall displays the catalogue.
Select.Catageory: The customer has the choice of either selecting from range
of categories or searching with a given name.
Select.NoSearch: If there is no search, then the application will show the
customer with an alternative choice.
Order. Place: The System will allow the customer to place an order for one
or more items.

3.3.2 Registration
Functional Requirements
Order. Register: If the customer is not registered, the system shall give the customer
options to register now and continue placing an order.
3.3.3 Time of Dispatch
Stimulus/Response Sequences

16

Stimulus: The customer will select the items.


Response: The system depending upon selected items will display time of delivery in
minutes.
Functional Requirements
Time. Delivery: Depending upon the items selected the system will display time of
delivery in minutes.
Time. Takeaway: The system will give an option to the customer to give take away time
in minutes.
Delivery/Takeaway. Select: Depending upon delivery/takeaway time the customer will
decide either to order to delivery or for collection.

View. Item: The system shall display all items the items selected by the customer.

3.3.4 View_Item
Stimulus/Response Sequences
Stimulus: Customer requests to view the selected items.
Response: The system will display the list of items selected.
Functional Requirements

3.3.5 Add _To_Cart


Functional Requirements

17

Update. Item: The system shall allow the customer to add individual or group of items
to already existing list.

3.3.6 Remove_From_Cart
Functional Requirements
Delete. Item: The system shall allow the customer to delete individual or group items
from already selected list and system will automatically update the totals and others.

3.3.7 Check out


Stimulus/Response Sequences
Stimulus: Customer request to check out
Response: The system will allow the customer to login before else continue shopping.
Functional Requirements
Confirm. Order: The system will confirm the order.

External Interface Requirements


3.4.1 User Interfaces
The Web pages shall permit complete navigation and food item selection using the
Keyboard alone, in addition to using mouse and keyboard combinations.
3.4.2 Hardware Interfaces
No hardware interfaces have been identified.

18

3.4.3 Software Interfaces


Software interface for Customer:
The application will allow the customer to login to the store by giving the URL
yoursite.com. The application will give an index page where the customer can select the
ordering option and displays the catalogue regarding the items available in the store
which is retrieved from the database. The application that will receive orders from the
customer, and get the information about the ordered items from the Database. Once the
order is completed the customer tries to checkout, once the customer confirms the order
the application will display the final ordered list to the customer which is retrieved from
Database. After all completion of ordering the application will generate a bill to
storeowner and display about the confirmation of the order to the customer which is
retrieved from the Database.
Software interface for Storeowner:
The application will allow the storeowner to update the database according to
availability of an item in the store .The application will allow the storeowner to keep the
track of records regarding the orders which have come to store and update the records.

3.5. Other Nonfunctional Requirements


3.5.1 Performance Requirements

At a time the software is expected to handle 100 customers as deliver would be a


convenient to handle.

All Web pages generated by the system shall be fully downloadable in no more
than 10 seconds.

3.5.2 Safety Requirements

19

The details of the customer are passed on the secure server where he/she pays for
the order.
3.5.3 Security Requirements
All network transactions that involve financial information or personally
identifiable information shall be encrypted.

20

SYSTEM DESIGN

]SCOPE OF THE DOCUMENT

21

The Software Design Document (SDD) is a comprehensive software


design model consisting of four distinct but interrelated activities: data design,
architectural design, interface design, and procedural design.
The Data design describes structures that reside within the software.
Attributes and relationships between data objects dictate the choice of data structures.
The Architecture Design uses information flow characteristics, and maps
them into

the program structure. Transformation mapping method is applied to exhibit

distinct boundaries between incoming and outgoing data. The Data Flow diagrams
allocate control input, processing, and output along three separate modules.
The Interface Design describes internal and external program interfaces
as well as the design of human interface. Internal and external interface designs are based
on the information obtained from the analysis model.
The Procedural Design describes structured programming concepts
using graphical, tabular, and textual notations. These design mediums enable the designer
to represent procedural detail that facilitates translation to code. This blueprint for
implementation forms the basis for all subsequent software engineering work.
The SDD contains the following documents:
o

Architecture Design

Data Design

Interface Design

Procedural Design

4.1 Architecture Design:

22

The architectural design of a software project is simply the design of


the entire software system. This includes the hierarchy of the modules and
also which modules are present in the system

Data-flow Diagram (DFD)


Data flow diagrams are

directed graphs in which the nodes specify processing

activities and the arcs specify data items transmitted between processing nodes. A data
flow diagram might represent data flow between sequential routines, data flow concurrent
process, or data flow in a distributed computing system, where each node represents a
geographically remote processing unit.
Unlike flow charts, data flow diagrams do not indicate decision logic or condition
under which various nodes in the diagram might be activated. Data flow diagrams can be
expressed using special symbols. These symbols can be used to denote processing nodes,
data nodes, data sources and data stores.

Data Store: Holds data


D1

File

Process

Process: Transforms or moves

23

Source /sink: original or final destination of data

Data Flow: Indicates the direction of movement of Data

24

SYSTEM FLOW CHART

E-Commerce Shopping Cart

Customer

Browse

Product
catalogue

Registrati
on

Login

Add/Delete
Items

25

Checkout

CONTEXT-LEVEL
BROWSE
REGISTRATION

LOGIN

USER
USER
INTERACT
S

ES
C

ADD TO CART

VIEW LIST

REMOVE FROM
LIST
TIME OF
DISPATCH

CHECK OUT

26

27

28

29

4.2 Data Design:


30

The data design specifies how the data of the program is going to be
stored. This includes all major data structures and methods. For each data structure, the
actions that can be performed on it are specified.

ESC Data Dictionary:


Category Table

Name
C_ID

Null?
NOT NULL

Type
NUMBER(5)

C_NAME

VARCHAR2(100)

C_DESC

VARCHAR2(150)

Subcategory Table
Name

Null?

Type

SC_ID

NOT NULL

NUMBER(5)

C_ID

NOT NULL

NUMBER(5)

SC_NAME
COST
SC_DESC

VARCHAR2(100)
NOT NULL

NUMBER(7,2)
VARCHAR2(100)

Register Table

31

Name

Null?

Type

F_NAME

VARCHAR2(25)

SURNAME

VARCHAR2(26)

FULL_ADD

VARCHAR2(50)

TOWN

VARCHAR2(15)

COUNTRY

VARCHAR2(20)

POSTCODE

NUMBER(6)

H_PHONE

NUMBER(11)

MOBILE

NUMBER(11)

PASSWORD

VARCHAR2(30)

MAIL_ID

VARCHAR2(50)

Feedback Table

Name

Null?

Type

CO_NAME

VARCHAR2(50)

BEST_TIME

VARCHAR2(10)

MAIL_ID

VARCHAR2(50)

PHONE

NUMBER(10)

MOBILE

NUMBER(12)

CMT

VARCHAR2(200)

Temp order Table

32

Name

Null?

Type

SESSIONID

NOT NULL

VARCHAR2(100)

C_ID

NOT NULL

NUMBER(5)

SC_ID

NOT NULL

NUMBER(5)

COST

NUMBER(8,2)

SC_NAME

VARCHAR2(100)

QTY

NUMBER(5)

Order_Info Table

Name
ORDER_ID

Null?
NOT NULL

Type
NUMBER(5)

NAME

VARCHAR2(25)

ADDRESS

VARCHAR2(100)

PHONE

NUMBER(11)

MOBILE

NUMBER(11)

TIME_OF_DIS

NUMBER(3)

DEL_TIME

NUMBER(3)

Order_Info1 Table
Name

Null?

Type

ORDER_ID

NUMBER(5)

C_ID

NUMBER(5)

SC_ID

NUMBER(5)

COST

NUMBER(8,2)

SC_NAME

VARCHAR2(100)

QTY

NUMBER(5)

33

SYSTEM IMPLEMENTATION

5.1 Sample Code

34

5.1.1 Browse Phase:


It is the home page of the website which will display description about the
hotel.
<HTML><HEAD><TITLE>index </TITLE>
<SCRIPT language=JavaScript>
</SCRIPT>
</HEAD>
<DIV align=right>
<P><FONT face="Geneva, Arial, Helvetica, san-serif, Arial Black"
color=#000000
size=1><B><FONT size=1>'E-Commerce Shopping Cart'
is a premier take away for the best in Indian food. Offering a
wide range of Asian cuisine to choose from.our chefs offer only the best of
Tandoori curry and rice dishes.</FONT></B></FONT></P></DIV></DIV>
color=#000000>E-Commerce Shopping Cart online helps you choose your
menu and order it by phone for a free home delivery within 3-mile radius.
We at E-Commerce Shopping Cart strive to offer you only the best and want
you to enjoy our food. Check out the wide range of menu to choose from
and 'Happy browsing' this site.
</FONT></B></FONT></DIV>
face="Arial, Helvetica, sans-serif" size=3>Home
</font><u></b></A></TD>
</TR>
<TR>
<TD align="center">
<A href="f1.html" value="homepage"><b><FONT
face="Arial, Helvetica, sans-serif" size=3>MENU
</font></b></A></TD>
</TR>

35

<TR>
<TD align="center">
<A href="contact.htm" value="homepage"><b><FONT
face="Arial, Helvetica, sans-serif" size=3>CONTACT US
</font></b></A></TD>
</TR>

5.1.2 Menu Page:


The categories and subcategories are retrieved from the database in this page .for
this we write the JSP code to link to database.
<%@ page language="java" %>
<%@ include file="makecon.jsp" %>
<SCRIPT language="JavaScript">
function addtobasket (Val)
{
document.productform.cartaction.value ="add";
document.productform.itemno.value=document.productform.elements
[Itemno'+val].value;
document.productform.qty.value=document.productform.elements['qty'+v
al].value;
document.productform.price.value=document.productform.elements['price'+val].value;
document.productform.title.value=document.productform.elements['title'+val].value;
valLen =document.productform.qty.value.length;
if (valLen<1)
{

36

alert ("Please enter quantity");


document.productform.elements['qty'+val].select();
return;
}
valLen = document.productform.qty.value.length;
for( var i = 0; i < valLen; i++)
{
if( isNaN( parseInt(document.productform.qty.value.charAt(i))))
{
alert("Please enter valid quantity");
document.productform.elements['qty'+val].select();
return ;
if(document.productform.qty.value==0)
{
alert("Please enter valid Quantity");
document.productform.elements['qty'+val].select();
return;
}
if(document.productform.qty.value.length<1)
{
alert("Please enter valid Quantity");
document.productform.elements['qty'+val].select();

37

return;
}
document.productform.action="ordering.jsp?itemno="+document.productfmno.va
lue+"&title="+document.productform.title.value+"&qty="+document.productform.qty.va
lue+"&price="+document.productform.price.value;
</SCRIPT>
<%! String oid;
int z=0 ;%>
<%
String s=request.getParameter("c_id");
if(s! =null)
{

oid=s; }

%>
<%
ResultSet rs1=st.executeQuery("select max(sc_id) from subcategory where
c_id="+Integer.parseInt(oid));
if(rs1.next())
{
out.println(rs1.getInt(1));
}
rs1.close();
%>
<%

38

ResultSet rs2=st.executeQuery("select * from subcategory where c_id="+oid);


z=0;
String color;
System.out.println(rs2);
while (rs2.next ())
{
z++;
if(z%2==0)
color="#ffffff";
else
color="#ecfcff";
out.println("<INPUT type=hidden value="+rs2.getInt(1)+","+rs2.getInt(2)+"
name=itemno"+rs2.getInt(1)+">");
out.println("<INPUT type=hidden
value="+rs2.getFloat(4)+" name=price"+rs2.getInt(1)+">");
out.println("<INPUT type=hidden value=\""+rs2.getString(3)+"\"
name=title"+rs2.getInt(1)+">");
%>
<TR>
<%
out.println("<TD width=\"2%\" bgColor="+color+"><IMG

39

alt=\""+rs2.getString(5)+"\"
src=\"one_files/info.gif\" align=left border=0></TD>");
out.println("<TD width=\"40%\" bgColor="+color+"><SPAN
class=productdisplay>"+rs2.getString(3)+"</SPAN></TD>");
out.println("<TD width=\"8%\" bgColor="+color+"><IMG src=\"one_files/0.gif\"
align=center border=0></TD>");
out.println("<TD width=\"8%\" bgColor="+color+"><SPAN
class=productdisplay>Rs."+rs2.getFloat(4)+"</SPAN></TD>");
out.println("<TD width=\"10%\" bgColor="+color+"><SPAN
class=productdisplay><INPUT size=2 value=1
name=qty"+rs2.getInt(1)+"></SPAN></TD>");
out.println("<TD width=\"10%\" bgColor="+color+"><A style=\"COLOR: #000000;
TEXT-DECORATION: underline\" href=\"javascript:addtobasket("+rs2.getInt(1)+")\"
><IMG alt=\"Enter quantity and click this button.\" src=\"one_files/sbasket.gif\"
border=0></A></TD>");
%>
</TR>
<%
}
%>

5.1.3 View Cart:

40

The selected items are viewed with the individual price of the item and quantity
and totals are made. The items which are selected are retrieved from the database. Any
updations done will be modified in the database also.

<%@ page language="java" %>


<%@ include file="makecon.jsp" %>
<%@ page import="java.util.*" %>
<%
try {
String formaction=request.getParameter("formaction");
if(formaction.equals("delete"))
{
String itemno=request.getParameter("deleteitem");
StringTokenizer s=new StringTokenizer(itemno,",");
int i=0;
int[] j=new int[2];
while(s.hasMoreTokens())
{
j[i]=Integer.parseInt(s.nextToken());
i++;
}
PreparedStatement stmt = con.prepareStatement("delete from temporder where
sessionid=? and c_id=? and sc_id=?");
stmt.setString(1,session.getId());
stmt.setInt(2,j[1]);

41

stmt.setInt(3,j[0]);
int m=stmt.executeUpdate();
stmt.close();
}
if(formaction.equals("increment"))
{
String itemno=request.getParameter("incrementitem");
String qty=request.getParameter("incrementqty");
String price=request.getParameter("incrementprice");
StringTokenizer s=new StringTokenizer(itemno,",");
int i=0;
int[] j=new int[2];
while(s.hasMoreTokens())
{
j[i]=Integer.parseInt(s.nextToken());
i++;
}

PreparedStatement stmt = con.prepareStatement("update temporder set


cost=?,qty=? where sessionid=? and c_id=? and sc_id=?");
stmt.setFloat(1,(Integer.parseInt(qty) * Float.parseFloat(price)));
stmt.setInt(2,Integer.parseInt(qty));
stmt.setString(3,session.getId());

42

stmt.setInt(4,j[1]);
stmt.setInt(5,j[0]);
int m=stmt.executeUpdate();
stmt.close();
}
if(formaction.equals("decrement"))
{
String itemno=request.getParameter("decrementitem");
String qty=request.getParameter("decrementqty");
String price=request.getParameter("decrementprice");
StringTokenizer s=new StringTokenizer(itemno,",");
int i=0;
int[] j=new int[2];
while(s.hasMoreTokens())
{
j[i]=Integer.parseInt(s.nextToken());
i++;
}
PreparedStatement stmt = con.prepareStatement("update temporder set
cost=?,qty=? where sessionid=? and c_id=? and sc_id=?");
stmt.setFloat(1,(Integer.parseInt(qty) * Float.parseFloat(price)));
stmt.setInt(2,Integer.parseInt(qty));
stmt.setString(3,session.getId());
stmt.setInt(4,j[1]);

43

stmt.setInt(5,j[0]);
int m=stmt.executeUpdate();
stmt.close();
}
}catch(Exception e)
{ System.out.println(e); }
%>
5.1.4 Registration:
All the information given by the customer will be stored in the database for delivery
of an order.
<%@ include file="makecon.jsp" %>
<%
try {
String firstname=request.getParameter("firstname");
String lastname=request.getParameter("lastname");
String address1=request.getParameter("address1");
String town=request.getParameter("town");
String state=request.getParameter("state");
String postcode1=request.getParameter("postcode1");
String phone=request.getParameter("phone");
String mobile=request.getParameter("mobile");
String pass=request.getParameter("pass");
String email=request.getParameter("email");

44

PreparedStatement stmt = con.prepareStatement("insert into register


values(?,?,?,?,?,?,?,?,?,?)");
stmt.setString(1,firstname);
stmt.setString(2,lastname);
stmt.setString(3,address1);
stmt.setString(4,town);
stmt.setString(5,state);
stmt.setInt(6,Integer.parseInt(postcode1));
stmt.setLong(7,Long.parseLong(phone));
stmt.setLong(8,Long.parseLong(mobile));
stmt.setString(9,pass);
stmt.setString(10,email);
int m=stmt.executeUpdate();
if(m==0)
{
%>
<jsp:forward page="failure.html" />
<%
}
else
{
%>
<jsp:forward page="success.html" />

45

<%
}
session.setAttribute("loginid",email);
session.setAttribute("name",firstname);
} catch(Exception e)
{
%>
<jsp:forward page="failure.html" />
<%
}
%>
<script language="javaScript">
function validateForm(form)
{
flag=true
p=document.registerform.pass.value
psize=p.length
cp=document.registerform.repass.value
cpsize=cp.length
if(psize!=cpsize)
{
flag=false
}
for(i=0;i<prize++)

46

{
s=p.substring(i,i+1)
s1=cp.substring(i,i+1)
if(s!=s1)
{
flag=false
}
}
if(flag)
{
document.registerform.submit()
}
else
{
alert("Password and Confirm password are not same")
document.registerform.repass.select()
}
}
function num(numfield)
{
var f=true
n=numfield.value
nsize=n.length
for(i=0;i<nsize;i++)
{

47

s=n.substring(i,i+1)
if(s<'0' || s>'9')
{
f=false
}
}
if(!f)
{
alert("pls enter numbers only")
numfield.select()
}
}
</script>
</HEAD>

5.1.5 Checkout:
The user when wants to confirm his/her order tries to checkout where they have to
login for confirmation and all the information of the customer when login will be stored
in to database including time of dispatch given by the customer and the order given.

<%@ page language="java" %>

48

<%@ include file="makecon.jsp" %>


<%
if(session.getAttribute("name")==null)
{
%>
<jsp:forward page="b_order.jsp"/>
<%
}
else
{
String delivery=request.getParameter("deltime");
String takeway="15";
String email=(String) session.getAttribute("loginid");
String name=(String) session.getAttribute("name");
String addr="";
long mobile=0;
long phone=0;
int order_id=0;
ResultSet rs=st.executeQuery("select * from register where MAIL_ID
='"+email+"'");
if(rs.next())
{
mobile=rs.getLong(8);
phone=rs.getLong(7);

49

addr=rs.getString(3);
}
rs=st.executeQuery("select max(order_id) from order_info");
if(rs.next())
{
order_id=rs.getInt(1);
}
PreparedStatement stmt = con.prepareStatement("insert into order_info
values(?,?,?,?,?,?,?)");
stmt.setInt(1,++order_id);
stmt.setString(2,name);
stmt.setString(3,addr);
stmt.setLong(4,phone);
stmt.setLong(5,mobile);
stmt.setInt(6,Integer.parseInt(takeway));
stmt.setInt(7,Integer.parseInt(delivery));
int m=stmt.executeUpdate();
stmt = con.prepareStatement("insert into order_info1 values(?,?,?,?,?,?)");
rs=st.executeQuery("select * from temporder where
sessionid='"+session.getId()+"'");
while(rs.next())
{

stmt.setInt(1,order_id);

50

stmt.setInt(2,rs.getInt(2));
stmt.setInt(3,rs.getInt(3));
stmt.setFloat(4,rs.getFloat(4));
stmt.setString(5,rs.getString(5));
stmt.setInt(6,rs.getInt(6));
stmt.executeUpdate();
}
int n=st.executeUpdate("delete from temporder where
sessionid='"+session.getId()+"'");
if(n==0)
{
System.out.println("temporder not cleared");
}
session.removeAttribute("name");
session.removeAttribute("loginid");
%>
<jsp:forward page="thank.htm" />
<%
}
%>

5.2 SYSTEM TESTING

51

The philosophy behind testing is to find errors. Test cases are devised with us in
mind .A strategy employed for system testing is code testing.

5.2.1 Code Testing:


This strategy examines the logic of program. To follow this method our project
supervisor developed some test data that resulted in executing every instruction in the
program and module i.e. every path is tested. Systems are not designed as entire nor are
they tested as single systems. To ensure that the coding is perfect two types of testing is
performed.

5.2.2 TYPES OF TESTING:

Unit Testing.
Link Testing.
Integration testing

Unit Testing:
In this application developer tests the programs up as system. Software units in a
system are the modules and routines that are assembled and integrated to form a specific
function. Unit testing first done on modules, independent of one another to locate errors.
This enables to detect errors. Through this error resulting from interaction between
modules initially avoided.

Link Testing:

52

Link testing does not test software but rather the integration of each module. The
programmer tests where modules are designed with different parameters, length, type etc.
Integration testing:

All the tested modules are combined into sub system, which are then tested. The
goal is to see if the modules are properly integrated, and emphasis being on the testing
interfaces between the modules.

5.2.3 TESTING METHODS:


Testing is a process of executing a program to find out errors. If testing is
conducted successfully, it will uncover all the errors in the software. Any testing can be
done in two ways:

BLACK BOX TESTING:

It is a test case method used on functional requirements of the software .it will
help a software engineer to derive sets of input conditions that will exercise all the
functional requirements of the program .Black Box testing attempts to find errors in the
following categories:
Incorrect or missing functions.
Interface errors.
Errors in data structures.
Performance errors.
Initialization and termination errors.
WHITE BOX TESTING:

53

It is a test case design method that uses the control structures of the
procedural design to derive test cases. Using test cases this testing software Engineer can
derive the following test cases:

Exercise all the logical decision on either true or false sides.

Executing all loops at their boundaries and within their operational boundaries.

Executing the internal data structures to assure their validity.

5.2.4 SYSTEM SECURITY:

Checks and controls

Physical security:

Physical security is maintained by having the back up of all the data that is needed
for the project to run.

5.2.5 Os security:

The platform that we are using is Win NT which is protected made kernel and
this give the programming to run on its own protected made which makes project to
be handled on its won resources and which also works as the client in many cases.

5.2.6 Application level security

54

Application maintains the security by handling clients request properly


which makes it to be very efficient at critical time .The project makes to be very
reliable at crash times thus not distributing the other process on the system .This
makes the application to have efficient security concerns.

55

OUTPUT SCREENS

HOME PAGE

56

ORDERING PAGE

57

SUBCATEGORIES PAGE

58

ADDING TO THE CART

59

PINCODE FOR DELIVERY

60

CHECK PINCODE

61

PINCODE OUT OF DELIVERY

62

REGISTRATION FORM

63

FILL REGISTRATION FORM

64

REGISTRATION COMPLETED

65

LOIGIN OPTION

66

REQUEST TO CLEAR CART

67

CART CLEARED
68

VIEW CART

69

INCREASE/DECREASE QUANTITY OF AN ITEM

70

INVALID QUANTITY

71

CLEAR SHOPPING BASKET

72

CHECKOUT FORM

73

LOGOUT FORM

74

75

SYSTEM TOOLS

76

7.1 FEATURES OF LANGUAGE USED

Java Database connectivity


What is JDBC?
JDBC is a Java API for executing SQL .it consists of a set of classes and interfaces
written in the Java programming language. JDBC provides a standard API for
tool/database developers and makes it possible to write database applications using a pure
Java API.
USING jdbc, it is easy to send SQL statements to virtually any relational database.
One can write a single program using the JDBC API, and the program will be able to
send SQL statements to the appropriate data base. The combination of java and JDBC lets
a programmer write it once and run it anywhere.

What does JDBC do?


JDBC makes it possible to do three things:

Establish a connection with a database.

Send SQL statements.

Process the results.

JDBC verses ODBC and other APIs


At this point, Microsofts ODBC (Open Database Connectivity) API is that
probably the most widely used programming interface for accessing relational databases.
It offers the ability to connect to almost all databases on almost all platforms. So why not
just use ODBC from Java? The answer is that you can use ODBC from Java. But this is
best done with the help of JDBC in the form of JDBC-ODBC Bridge, which we will

77

cover shortly. The question now becomes why do you need JDBC?There are several
answers to this question:

1. ODBC is not appropriate for direct for direct use from Java because it uses a C
interface. Calls from Java to native C code have a number of drawbacks in the
security implementation, robustness, and automatic portability of applications.
2. A literal translation ODBC C API in to java API would not be desirable for
example, java has no pointers and ODBC makes copious use of them, including
the notoriously error prone generic pointer void*. You can think of JDBC as
ODBC translated in object-oriented interface that is natural for java program.
3

DBC is hard to learn. It mixes simple and advanced features together, and it has
complex options even for simple queries. JDBC, on the other hand, was designed
to keep simple things simple while allowing more advanced capabilities where
required
4. A Java API like JDBC is needed in order to enable a pure java solution. When
ODBC is used, the ODBC driver manger and drive must be manually installed
on every client machine. When the JDBC driver is written in java, however,
JDBC code is automatically installable, portable and secure on all java
platforms from network computers to mainframes

JDBC driver types


The JDBC drivers that we are aware are of at this time fit in to one of the four
categories

JDBC-ODBC Bridge plus ODBC driver


78

Native-Api partly-java driver

JDBC Net pure java drive

Native-protocol pure java driver

JDBC-ODBC Bridge
If possible, use a pure Java JDBC driver instead of the Bridge and an ODBC
driver. This completely eliminates the client configuration required by ODBC. It also
eliminates the potential that the java VM could be corrupted by an error in the native
code brought in by the Bridge (that is, the Bridge native library, the ODBC driver
manager library, the ODBC driver library, and the data base client library
What is the JDBC-ODBC Bridge?
The JDBC ODBC Bridge is a Jdbc driver, which implements JDBC
operations by translating them in to ODBC operations. To ODBC it appears as a
normal application program, the Bridge implements JDBC for any data base for
which an ODBC driver is available the bridge is implemented as the Sun.jdbc.odbc
java package and contains a native library used to access ODBC. The Bridge is a joint
development of intervolve and java soft.
JAVA SERVER PAGES (JSP)

Java server pages are a simple, yet powerful technology for creating and
maintaining dynamic-content web pages. Based on the Java programming language, Java
server pages offers proven portability, open standards, and a mature re-usable component
model. The Java server pages architecture enables the separation of content generation
from content presentation. This separation not ease maintenance headaches, it also allows
web team members to focus on their areas of expertise .Now, web page designer can

79

concentrate on layout, and web application designers on programming, with minimal


concern about impacting each others work.

Features of JSP:
Portability:

Java server pages files can be run on any web server or web-enabled application
server that provides support for them. Dubbed the JSP engine, this support involves
recognition, translation, and management of the Java Server Pages life cycle and its
components.

Components:

It was mentioned earlier that the Java Server Pages architecture can include
reusable Java components. The components currently supported include Servlets.

Processing:

A Java Server Pages file is essentially an HTML document with JSP scripting or
tags. The Java Server Pages file has a JSP extension to the Server as a Java Server Pages
file.
Before the page is served, the Java Server Pages syntax is parsed and processed into
a Servlet on the server side .The Servlet that is generated outputs real content in straight
HTML for responding to the client.

80

Steps in the execution of a JSP Application:


1. The client sends a request to the web server for a JSP file by giving the name of the
JSP file within the form tag of a HTML page.
2. This request is transferred to the JavaWebServer .At the server side JavaWebServer
receives the request to the JSP engine.
3. JSPengine is program, which can understand the tags of the JSP, and then it converts
those tags into a Servlet program and it is stored at the server side. This Servlet is
loaded in the memory and the result is given back to the JavaWebServer and then it
is transferred back to the result is given back to the JavaWebserver and then it is
transferred back to the client.
JDBC connectivity
The JDBC provides data base- independent connectivity between the J2EE
platform and wide range of wide range of tabular data source. JDBC technology allows
an application component provider to:

Perform connection and authentication to database server Manager transactions.

Move SQL statements to data base engine for preprocessing and execution
Execute stored procedures.
Inspect and modify the results from the select statements.

FEATURES OF ORACLE
Some of the features of oracle supported for the project are as follows:

81

Large Database Managements System


Oracle supports large databases potentially tear bites in size
Many Concurrent data base users
Oracle supports large numbers of concurrent users executing a variety of
database applications operating on same data .It minimizes data contention and
guarantees data concurrency.

High transaction processing performance


Oracle maintains the preceding features with a high degree of overall system
performance. Database users do not suffer from slow processing performance.,Security
By providing proper authentication oracle provides security to the database
users.
ROLE OF ORACLE IN DATABASE:
ORACLE9i is one of the many database services that plug into a client/server
model.
It works efficiently to manage resources, a database information, among the
multiple clients requesting & sending.

STRUCTURED QUERY LANGUAGE (SQL):


SQL is an inter-active language used to query the database and access data in
databases has the following features:

82

1. It is a unified language.
2. It is a common language for relational database.
3. It is a non-procedural language.

83

CONCLUSION

84

Conclusion

The theme of the project is to provide service smart, security to the customer. This
site provides a good and efficient way of ordering food through online which saves the
time of the customer.
This system provides good and efficient information and thus making the
service smarter. It is an interface for customers to browse the catalogue and order the
food online. ESC makes customer service easier as required by the customer. ESC system
maintains and processes all sort of information pertaining to the order type options
control the life cycle of an order. By following this new approach the information can be
accessed from anywhere just with a mouse click. This helps the users by saving lot of
time and providing the user with up to date information. The Internet also provides an
inexpensive and secured method for capturing orders electronically and easily integrated
with the customers.
This site also provides a feedback form such that any customer can give
comments to the storeowner.

Scope for Future Work:

Powerful search capabilities enable user to instantly pinpoint any


product, using the hierarchy or product description.

To produce printed catalogue

Any other feature that client needs.

85

BIBILIOGRAPHY

86

BIBILIOGRAPHY

Software Engineering by Roger s. pressman, 4th Edition


Professional JSP by WROX publications
JSP A Beginners Guide by Madhushree Ganguli (Willey
DreamTechpublications)

87

Você também pode gostar