You are on page 1of 71

Alpha Book Store

A Project report
submitted in partial fulfillment of the requirements
for the award of the degree
of
BACHELOR OF TECHNOLOGY (B. TECH)
in
COMPUTER SCIENCE AND ENGINEERING
By

KULDEEP TOMAR
14015001007

Under the guidance of


Mr. Ram Kumar
Assistant Professor(CSE)

Department of Computer Science and Engineering


International Institute of Technology & Management
(Affiliated to Deenbandhu Chotu Ram University of Science & Technology)
(April 2018)
Candidate’s Declaration

I declare that the work which is being presented in this project entitled “Alpha Book Store” is
authentic record of my work carried out under the guidance of Mr. Ram Kumar, Assistant
Professor (CSE). The matter embodied in this report has not been submitted to any other
University/ Institute for the award of any degree or diploma. I have followed all the guidelines
provided to me by the Institute in writing this thesis. I have also conformed to the norms and
guidelines given in the Ethical Code of Conduct of the Institute. Whenever I have used materials
(data, theoretical analysis, and text) from other sources, I have given due credit to them by citing

them in the text of the thesis and giving their details in the references.

KULDEEP TOMAR
Roll No.14015001007
Department of Computer Science and Engineering
International Institute of Technology & Management

ii
Certificate
This is to certify that the work in this project entitled “Alpha Book Store” submitted by Mr.
KULDEEP TOMAR in partial fulfillment of the requirements for the award of degree of Bachelor
of Technology in Computer Science is an authentic work carried out by him under my guidance
and supervision at the Department of Computer Science Engineering, International Institute of
Technology & Management, Murthal , Sonepat.

Signature of Supervisor Signature of H.O.D External

Mr. Ram Kumar Mr. Gaurav Gautam Examiner


(IITM, MURTHAL) (IITM,MURTHAL)

iii
Acknowledgments
First of all, I am thankful to almighty GOD to help me out in every odd and buts. There are
numerous people without whom this project might never have been completed. Among those who
deserve credit and our heartfelt gratitude is the most important Mr. Ram Kumar, Assistant
Professor (CSE) for his valuable guidance and support. Without him this work would not have
been possible. I am also thankful to my cousin sister Ms. Shelja Malik for her constant
encouragement and guidance. Last but not the least I would like to thank the faculty members of
the Department of Computer Science Engineering for being very supportive to me throughout
these years. I am also thankful to my friends and classmates for their valuable suggestions.

KULDEEP TOMAR

Roll No. 14015001007

iv
Abstract
After the years of stagnation, there are indications that the typical “Indian Consumer” has finally
come online for not most, but at least few sectors of online purchases of items some including
books, electronics, gaming, entertainment, and even more. This case study is to build a web site to
sell the books over a finite geographical area.
Since Internet technology is rapidly improving, more and more people are using the Internet for
their business growth and cost reduction in order to achieve their business goals. Business
consumers want more convenient and straightforward access to Web applications. There are
many technologies that can be used to build Web services and Web applications. This web
application does implement the technologies provided by Java namely JSPs, JSTL, Servlets and
Java Beans.
This application allows users to register online, make purchases online, and track the order and
shipping status online. It stores the persistent data into Xampp database and uses Java Database
Connectivity (JDBC) to manipulate the data through calls made by the JDBC from the Web
Application. The application was built using the current latest web standards. The services were
designed using Java as its core programming for its business logics, while the presentational part
was being done on varied technologies some including Ajax with jQuery, CSS3, and HTML5. The
statistical reports were been designed and presented with Google charts API. For the most of the
application’s part, the images and resources were only used when it was in a real need to have its
presence to signify the item, while the rest of the presentation was done using Cascading Style
Sheets. It seems varied and different streams of information meet together, when we in particular
create something out of it. Here we see the structural Knowledge Management and Statistics
moving hand in hand with Computing and Logical Reasoning.

v
Table of Contents
Content Page
Candidate’s Declaration ii
Certificate iii
Acknowledgement iv
Abstract v
Table of Contents vi
List of Figures viii
List of Tables x

Chapter 1 Introduction 1-6


1.1 E Commerce 1
1.2 Problem Statement 2
1.3 Limitation of Current System 3
1.4 Motivation and its Advantages 4
1.5 Feasibility Study 4
1.6 Fact Finding Techniques 6

Chapter 2 Architecture Used 7


2.1 Hardware Used 7
2.2 Software Used 7

Chapter 3 Tools and Technology Used 8-20


3.1 Introduction 8
3.2 Overview of java technology 8
3.3 NetBeans IDE 15
3.4 Overview of Servlet Technology 16
3.5 Overview of JSP Technology 17
3.6 Java Database Connectivity 18
3.7 Xampp 29
3.8 jQuery 20

vi
Chapter 4 System Design 21-27
4.1 User Case Diagram 21
4.2 Package Diagram 24
4.3 List of Tables 25

Chapter 5 Screenshots 28-44

Chapter 6 Conclusion and Future Scope 45


6.1 Conclusion 45
6.2 Future Scope 45

Bibliography 46
Appendix 47-59

vii
List of Figures

Content Page

3.1 Features of Java 10

3.2 Java platform independence 12

3.3 Java programs run inside virtual machine sandbox 13

3.4 NetBeans IDE Logo 15

3.5 Servlet Working 16

3.6 JDBC Architecture 19

4.1 Admin user case diagram 21

4.2 Customer/user subsystem user case diagram 22

4.3 Management purchase subsystem user case diagram 22

4.4 Login/register subsystem user case diagram 23

4.5 Package Diagram of Alpha Book Store 24

5.1 Alpha Book Store home page when no user login 29

5.2 Alpha Book Store home page when login form extended 29

5.3 User is registering an account on Alpha Book Store Website 30

5.4 Logged In userinfo.jsp page with no details added 30

5.5 Logged in userinfo.jsp page when user’s details added 31

5.6 User Filtering the list of Products 31

5.7 User viewing the full details of a chosen product 32

5.8 User Cart (list of products user have chosen) 32

5.9 User have to fill their details before purchasing items 33

viii
5.10 User have filled their details here and ready to go 33

5.11 User’s whole order list is shown here 34

5.12 User has confirmed their order and its status is pending 34

5.13 User order has been approved and ready to deliver 35

5.14 User order has been delivered, now user can print their bill 35

5.15 User order printed bill 36

5.16 Alpha Book Store search bar 36

5.17 Alpha Book Store admin login page 37

5.18 Admin home page 37

5.19 The Alpha Book Store performance through Line graph and Pie Chart 38

5.20 Items viewed by Category through pie chart & product sold through line graph 38

5.21 Top 10 products sold and views on Alpha Book Store 39

5.22 Here Admin has started adding a product 39

5.23 Admin has added the name of the publisher 40

5.24 Admin has added the Category and SubCategory name of the book 40

5.25 Admin has added the book name and its search tag 41

5.26 Admin has added the book price, quantity and a brief summary 41

5.27 Admin has uploaded the image of the book 42

5.28 List of products pending and need an approval from the admin 42

5.29 List of products pending and need an approval from the admin 43

5.30 Admin setting page, here admin can add a user to admin panel 43

5.31 Admin setting page, here admin can delete the selected category or subcategory 44

ix
List of Tables
Content Page
4.1 Product table structure 25

4.2 Category table structure 25

4.3 Subcategory table structure 25

4.4 User table structure 26

4.5 Administrators table structure 26

4.6 Company table structure 26

4.7 Expenses table structure 26

4.8 Images table structure 27

4.9 Sales table structure 27

4.10 User-details table structure 27

4.11 Order table structure 27

x
xi
Chapter 1
INTRODUCTION

1.1 E-commerce

E-commerce (electronic commerce or EC) is the buying and selling of goods and services, or the
transmitting of funds or data, over an electronic network, primarily the internet. These business
transactions occur either as business-to-business, business-to-consumer, consumer-to-consumer or
consumer-to-business. The terms e-commerce and e-business are often used interchangeably. The
term e-tail is also sometimes used in reference to transactional processes for online shopping.

1.1.1 History of e-commerce

The beginnings of e-commerce can be traced to the 1960s, when businesses started
using Electronic Data Interchange (EDI) to share business documents with other companies. In
1979, the American National Standards Institute developed ASC X12 as a universal standard for
businesses to share documents through electronic networks. After the number of individual users
sharing electronic documents with each other grew in the 1980s, in the 1990s the rise of eBay
and Amazon revolutionized the e-commerce industry. Consumers can now purchase endless
amounts of items online, both from typical brick and mortar stores with e-commerce capabilities
and one another.

1.1.2 E-commerce applications

E-commerce is conducted using a variety of applications, such as email, online catalogs and
shopping carts, EDI, File Transfer Protocol, and web services. This includes business-to-business
activities and outreach such as using email for unsolicited ads (usually viewed as spam) to
consumers and other business prospects, as well as to send out e-newsletters to subscribers. More
companies now try to entice consumers directly online, using tools such as digital coupons, social
media marketing and targeted advertisements.

The benefits of e-commerce include its around-the-clock availability, the speed of access, the wide
availability of goods and services for the consumer, easy accessibility, and international reach. Its
perceived downsides include sometimes-limited customer service, consumers not being able to see
or touch a product prior to purchase, and the necessitated wait time for product shipping.

The e-commerce market continues to grow: Online sales accounted for more than a third of total
U.S. retail sales growth in 2015, according to data from the U.S. Commerce Department. Web
sales totaled $341.7 billion in 2015, a 14.6% increase over 2014. E-commerce conducted using
mobile devices and social media is on the rise as well: Internet Retailer reported that mobile
accounted for 30% of all U.S. e-commerce activities in 2015. And according to Invesp, 5% of all
online spending was via social commerce in 2015, with Facebook, Pinterest and Twitter providing
the most referrals.

The rise of e-commerce forces IT personnel to move beyond infrastructure design and maintenance
and consider numerous customer-facing aspects such as consumer data privacy and security.
When developing IT systems and applications to accommodate e-commerce activities, data
governance related regulatory compliance mandates, personally identifiable information privacy
rules and information protection protocols must be considered.

1.1.3 Government regulations for e-commerce

In the United States, the Federal Trade Commission (FTC) and the Payment Card Industry (PCI)
Security Standards Council are among the primary agencies that regulate e-commerce activities.
The FTC monitors activities such as online advertising, content marketing and customer privacy,
while the PCI Council develops standards and rules including PCI-DSS compliance that outlines
procedures for proper handling and storage of consumers' financial data.

1.2 Problem Statement

At present the work is currently been processed through all the papers and registers, every possible
data entry has to be done in the registers every day after the shop has been closed. Here all the
records of the items sold, purchased, are maintained by separate registers. Keeping track of the
members who are on credit balance and credit purchases are been done in separate registers as well
which is time consuming process.

2
There is a separate track of records been maintained in a separate register for all those dealers and
merchants who provide goods and/or services to them. The entire process is done all throughout
the monthly basis and finally a record is kept track for all those products which were sold as per
user’s requirements and a track of all those products help them to make their next orders on safer
side.

After the records have been tracked each month, every month is being compared to the sales,
purchases and businesses of the previous months, this helps them to keep records on the future
gains and the development of their business.

Goods once purchased are kept aside for thorough checking process for any defects/counterfeit,
once done are kept at their respective categorized places and checked regularly

Goods Sold are kept records every night before closing time for their appropriate buying decisions
from dealer next time

Every month a transaction process is record which gives the owner the track of their current gains
in their business.

1.3 Limitations of the present system

1. The system is manual thus it does not provide a graphical user interface.

2. Needs more space for maintenance, the current system is very time consuming.

3. It is very difficult to search the detail of a customer or the event detail for anyone unless he/she

wastes his time to search it manually.

4. It is very difficult to create the report manually.

5. It creates confusion and makes it difficult to find the details of the customer. Many a times the

records are not found.

6. This type of working system increases the workload of the person who is looking after these

diaries.
3
7. Due to calculations error in the bill may lead to loss either to dealers or customers. Sometimes
it may lead to quarrel between dealers & customers.

1.4 Motivation and its advantages

1. The proposed automated system will be a database comprising of brief compact, systematic
organization of the information which are currently recorded and may be redundant in nature.

2. System will be website based, user friendly and efficient, so that even a non‐technical user can
use the system without any difficulty.

3. The proposed system will be computerized system, so this system will not be time consuming.

4. Appropriate master tables must be present so that user will be able to find any kind of records
and details.

5. Security will be maintained in this system. No one will be able to see the undesired data unless
the administrator permits him.

6. Reports should be generated as follows:


Bill generation.
Selling detail report
Purchases Registration report (Customer wise)

7. It will overcome the limitations of the current system.

1.5 Feasibility study


The feasibility study is used to determine if the project should get the go-ahead. If the project is to
proceed, the feasibility study will produce a project plan and budget estimates for the future stages
of development. Feasibility study is carried out to select the best system that meets system
performance requirements.

4
1.5.1 Different types of feasibility study:

 Technical feasibility

 Operational feasibility

 Economic feasibility

1.5.1.1 Technical Feasibility:

This is concerned with the specifying equipment and software that will successfully satisfy the
requirements. The proposed system is technically feasible as it can be developed easily with the
help of available technology. The proposed system requires Xampp which is used as backend and
JSP and Servlet as front end.

In the technical needs of the system these points are considered.

 The facility to produce in given time.

 Response time under conditions.

1.5.1.2 Economical Feasibility:

Economic analysis is the most frequently used technique for evaluating the effectiveness of the
proposed system. The producer is to determine the benefits and the saving that are expected from
a proposed system and compare them with the proposed system. The only tangible benefits
proposed that the manual work and burden is reduced maximum as possible, resulting the reduction
in manpower requirement and cost incurred on manpower as well. The system provides many
benefits that can’t be measured in terms of money for e.g. user friendliness, more efficient user
response, maintenance of database etc.

1.5.1.3 Operational Feasibility:

The proposed system is highly user friendly and it is much easily to interact with the user.
Therefore, the user will easily accept the system as data entry system and queries can be easily
solved.

It is mainly related to human organizational and political aspects in it we consider:

 What changes will be brought with the system?

 What new skill will be required?

5
1.6 Fact finding techniques
Few personal interview questions:

1) What is your system working?

Everything is recorded manually onto books or paper, Expenses being done in registers and thus
finally records are currently saved manually, no automation.

2) What types of items you people deal with?

We deal in every type of book from Medical, Management, Engineering and School.

3) Are you interested in having software that will publish your products online or in other
words do you want to be a Web Merchant?

After the success story of Flipkart, Homeshop18, Amazon, and many online megastores even I am
interested in being a web merchant that will just increase my sales just double and will lead to
greater revenue.

4) How are your products being categorized?

Firstly, we have a varied stock of category, namely the major products are categorized as follows,
we have Medical, Management, Engineering and School. Now these major categories are then
classified into minor sub‐categories, take the example of here an Engineering, An Engineering
branch may be Civil, Electrical, Electronics and Computer etc.

5) Will you deal with courier system if the system will be online?

Definitely, if the sales given online may be of a value, we may not have any issues in having the
product delivered to the consumer, provided that the verification of the address proof ad the
consumer will be done beforehand.

6) How will and till what range will you considered to have couriered?

As of now, we need courier system till the range of only a diameter of the entire Delhi because we
need not want counterfeit in credit cards as we even had not being using credit/debit cards for
online purchases

6
Chapter 2
ARCHITECTURE USED

2.1 Hardware Used:

 Processor: Intel Core i5 1.80 GHz

 RAM: 8GB

2.2 Software Used:

 OS: Window 10

 Environment: Java Runtime Environment

 Front end: J2EE JDK 8.2

 Database: Xampp v7.1.9

7
Chapter 3
TOOLS AND TECHNOLOGY USED

3.1 Introduction
In this project the tools and technology we have used are as follows:

 Java
 NetBeans IDE
 Servlet
 JSP
 JDBC
 Xampp
 jQuery

3.2 Overview of java technology


3.2.1 History of java:
Java language was developed by James Gosling and his team at sun micro systems and released
formally in 1995. Its former name is oak. Java Development Kit 1.0 was released in 1996. Java is
a programming language and a platform. Java is a high level, robust, secured and object-
oriented programming language.

3.2.2 Where it is used?

According to Sun, 3 billion devices run java. There are many devices where Java is currently used.
Some of them are as follows:

1. Desktop Applications such as acrobat reader, media player, antivirus etc.

2. Web Applications such as irctc.co.in, javatpoint.com etc.

3. Enterprise Applications such as banking applications.

4. Mobile

5. Embedded System
8
6. Smart Card

7. Robotics

8. Games etc.

3.2.3 Java Platforms / Editions

There are 4 platforms or editions of Java:

1) Java SE (Java Standard Edition)

It is a java programming platform. It includes Java programming APIs such as java.lang, java.io,
java.net, java.util, java.sql, java.math etc. It includes core topics like OOPs, String, Regex,
Exception, Inner classes, Multithreading, I/O Stream, Networking, AWT, Swing, Reflection,
Collection etc.

2) Java EE (Java Enterprise Edition)

It is an enterprise platform which is mainly used to develop web and enterprise applications. It is
built on the top of Java SE platform. It includes topics like Servlet, JSP, Web Services, EJB, JPA
etc.

3) Java ME (Java Micro Edition)

It is a micro platform which is mainly used to develop mobile applications.

4) JavaFx

It is used to develop rich internet applications. It uses light-weight user interface API.

9
3.2.4 Features of Java

There is given many features of java. They are also known as java buzzwords. The Java Features
given below are simple and easy to understand.

Figure 3.1: Features of Java

1. Simple
2. Object-Oriented
3. Portable
4. Platform independent
5. Secured
6. Robust
7. Architecture neutral
8. Dynamic
9. Interpreted
10. High Performance
11. Multithreaded
12. Distributed

10
Simple

According to Sun, Java language is simple because:

 Syntax is based on C++ (so easier for programmers to learn it after C++).

 Removed many confusing and/or rarely-used features e.g., explicit pointers, operator
overloading etc.

 No need to remove unreferenced objects because there is Automatic Garbage Collection in


java.

Object-oriented

Object-oriented means we organize our software as a combination of different types of objects


that incorporates both data and behavior.

Object-oriented programming(OOPs) is a methodology that simplify software development and


maintenance by providing some rules.

Basic concepts of OOPs are:

1. Object
2. Class
3. Inheritance
4. Polymorphism
5. Abstraction
6. Encapsulation

11
Platform Independent

Figure 3.2: Java platform independence

A platform is the hardware or software environment in which a program runs.

There are two types of platforms software-based and hardware-based. Java provides software-
based platform.

The Java platform differs from most other platforms in the sense that it is a software-based
platform that runs on the top of other hardware-based platforms. It has two components:

1. Runtime Environment

2. API (Application Programming Interface)

Java code can be run on multiple platforms e.g. Windows, Linux, Sun Solaris, Mac/OS etc. Java
code is compiled by the compiler and converted into bytecode. This bytecode is a platform-

12
independent code because it can be run on multiple platforms i.e. Write Once and Run
Anywhere(WORA).

Secured

Java is secured because:

o No explicit pointer

o Java Programs run inside virtual machine sandbox

Figure 3.3: Java programs run inside virtual machine sandbox

o Classloader: adds security by separating the package for the classes of the local file system
from those that are imported from network sources.

o Bytecode Verifier: checks the code fragments for illegal code that can violate access right
to objects.

o Security Manager: determines what resources a class can access such as reading and
writing to the local disk.

These securities are provided by java language. Some security can also be provided by application
developer through SSL, JAAS, Cryptography etc.

Robust

Robust simply means strong. Java uses strong memory management. There is lack of
pointers that avoids security problem. There is automatic garbage collection in java.

13
There is exception handling and type checking mechanism in java. All these points
make java robust.

Architecture-neutral

There are no implementation dependent features e.g. size of primitive types is fixed.

In C programming, int data type occupies 2 bytes of memory for 32-bit architecture and 4 bytes of
memory for 64-bit architecture. But in java, it occupies 4 bytes of memory for both 32 and 64-bit
architectures.

Portable

We may carry the java bytecode to any platform.

High-performance

Java is faster than traditional interpretation since byte code is "close" to native code still somewhat
slower than a compiled language (e.g., C++)

Distributed

We can create distributed applications in java. RMI and EJB are used for creating distributed
applications. We may access files by calling the methods from any machine on the internet.

Multi-threaded
A thread is like a separate program, executing concurrently. We can write Java programs that deal
with many tasks at once by defining multiple threads. The main advantage of multi-threading is
that it doesn't occupy memory for each thread. It shares a common memory area. Threads are
important for multi-media, Web applications etc.

14
3.3 NetBeans IDE

NetBeans is a software development written in Java. The NetBeans Platform allows applications
to be developed from a set of modular software components called modules. Applications based
on the NetBeans Platform, including the NetBeans integrated development environment (IDE),
can be extended by third party developers.

The NetBeans IDE is primarily intended for development in Java, but also supports other
languages, in particular PHP, C/C++ and HTML5.

NetBeans is cross-platform and runs on Microsoft Windows, Mac OS X, Linux, Solaris and other
platforms supporting a compatible JVM

The NetBeans Team actively support the product and seek feature suggestions from the wider
community. Every release is preceded by a time for Community testing and feedback.

Figure 3.4: Netbeans IDE Logo

15
3.4 Overview of Servlet technology
3.4.1 Servlet:
Servlet technology is used to create web application (resides at server side and generates dynamic
web page).

Servlet technology is robust and scalable because of java language. Before Servlet, CGI (Common
Gateway Interface) scripting language was popular as a server-side programming language. But
there were many disadvantages of this technology. We have discussed these disadvantages below.

There are many interfaces and classes in the servlet API such as Servlet, Generic Servlet, HTTP
Servlet, Servlet Request, Servlet Response etc.

3.4.2 Features of Servlet

o Servlet is a technology i.e. used to create web application.

o Servlet is an API that provides many interfaces and classes including documentations.

o Servlet is an interface that must be implemented for creating any servlet.

o Servlet is a class that extend the capabilities of the servers and respond to the incoming request. It
can respond to any type of requests.

o Servlet is a web component that is deployed on the server to create dynamic web page.

Figure 3.5: Servlet Working

16
3.5 Overview of JSP technology
JSP:

JSP technology is used to create web application just like Servlet technology. It can be thought of
as an extension to servlet because it provides more functionality than servlet such as expression
language, jstl etc.

A JSP page consists of HTML tags and JSP tags. The jsp pages are easier to maintain than servlet
because we can separate designing and development. It provides some additional features such as
Expression Language, Custom Tag etc.

3.5.1 Advantage of JSP over Servlet

There are many advantages of JSP over servlet. They are as follows:

1) Extension to Servlet

JSP technology is the extension to servlet technology. We can use all the features of servlet in JSP.
In addition to, we can use implicit objects, predefined tags, expression language and Custom tags
in JSP, that makes JSP development easy.

2) Easy to maintain

JSP can be easily managed because we can easily separate our business logic with presentation
logic. In servlet technology, we mix our business logic with the presentation logic.

3) Fast Development: No need to recompile and redeploy

If JSP page is modified, we don't need to recompile and redeploy the project. The servlet code
needs to be updated and recompiled if we have to change the look and feel of the application.

4) Less code than Servlet

In JSP, we can use a lot of tags such as action tags, jstl, custom tags etc. that reduces the code.
Moreover, we can use EL, implicit objects etc.

17
3.6 Java database connectivity

JDBC is a Java database connectivity technology (Java Standard Edition platform) from Oracle
Corporation. This technology is an API for the Java programming language that defines how a
client may access a database. It provides methods for querying and updating data in a database.
JDBC is oriented towards relational databases. A JDBC-to-ODBC bridge enables connections to
any ODBC-accessible data source in the JVM host environment.
The JDBC library includes APIs for each of the tasks mentioned below that are commonly
associated with database usage.

 Making a connection to a database.

 Creating SQL or MySQL statements.

 Executing SQL or MySQL queries in the database.

 Viewing & Modifying the resulting records.

Fundamentally, JDBC is a specification that provides a complete set of interfaces that allows for
portable access to an underlying database. Java can be used to write different types of executables,
such as –

 Java Applications

 Java Applets

 Java Servlets

 Java Server Pages (JSPs)

 Enterprise JavaBeans (EJBs).

All of these different executables are able to use a JDBC driver to access a database, and
take advantage of the stored data

18
Figure 3.6: JDBC Architecture.

3.7 Xampp

XAMPP is a free and open source cross-platform web server solution stack package developed
by Apache Friends, consisting mainly of the Apache HTTP Server, MariaDB database,
and interpreters for scripts written in the PHP and Perl programming languages. XAMPP stands
for Cross-Platform (X), Apache (A), MariaDB (M), PHP (P) and Perl (P). It is a simple, lightweight
Apache distribution that makes it extremely easy for developers to create a local web server for
testing and deployment purposes. Everything needed to set up a web server – server application
(Apache), database (MariaDB), and scripting language (PHP) – is included in an extractable file.
XAMPP is also cross-platform, which means it works equally well on Linux, Mac and Windows.
Since most actual web server deployments use the same components as XAMPP, it makes
transitioning from a local test server to a live server extremely easy as well.
19
3.8 jQuery

jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document
traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-
use API that works across a multitude of browsers. With a combination of versatility and
extensibility, jQuery has changed the way that millions of people write JavaScript.

jQuery, at its core, is a Document Object Model (DOM) manipulation library. The DOM is a tree-
structure representation of all the elements of a Web page. jQuery simplifies the syntax for finding,
selecting, and manipulating these DOM elements. For example, jQuery can be used for finding an
element in the document with a certain property (e.g. all elements with an h1 tag), changing one
or more of its attributes (e.g. color, visibility), or making it respond to an event (e.g. a mouse click).

jQuery also provides a paradigm for event handling that goes beyond basic DOM element selection
and manipulation. The event assignment and the event callback function definition are done in a
single step in a single location in the code. jQuery also aims to incorporate other highly used
JavaScript functionality (e.g. fade ins and fade outs when hiding elements, animations by
manipulating CSS properties).

The principles of developing with jQuery are:

 Separation of JavaScript and HTML: The jQuery library provides simple syntax for
adding event handlers to the DOM using JavaScript, rather than adding HTML event
attributes to call JavaScript functions. Thus, it encourages developers to completely
separate JavaScript code from HTML markup.

 Brevity and clarity: jQuery promotes brevity and clarity with features like chainable functions
and shorthand function names.

 Elimination of cross-browser incompatibilities: The JavaScript engines of different


browsers differ slightly so JavaScript code that works for one browser may not work for
another. Like other JavaScript toolkits, jQuery handles all these cross-browser inconsistencies
and provides a consistent interface that works across different browsers.

 Extensibility: New events, elements, and methods can be easily added and then reused as a
plugin.

20
Chapter 4
SYSTEM DESIGN

4.1 User Case Diagram


4.1.1 Admin user case diagram

Admin Log In

Add Products

Update Product
Details
Manage/Delete
Products

Approve Websites

Moderate Website
Management
View Profits

Delete Orders

Add User as Admin


Panel
Admin Logs Out

Figure 4.1: Admin user case diagram.

21
4.1.2 Customer/user subsystem user case diagram

Management Buys Product

Admin Logs in

Management Add Details of the Purchase

Product Stock Update

Figure 4.2: Customer/user subsystem user case diagram.

4.1.3 Management purchase subsystem user case diagram

User Buys Product

Add Details of Sales

Add User Details


User

User Log In

Management
Change Status on
Verification

Figure 4.3: Management purchase subsystem user case diagram.


22
4.1.4 Login/Register subsystem user case diagram

User Registers

User Log In

Add Details of the


User User

Management Update User


Password
Add Administrator

Figure 4.4: Login/Register subsystem user case diagram.

23
4.2 Package Diagram

Domain

LoginServlet.java

RegisterServlet.java
view
BuyItems.java
index.jsp
Order.java
admin_.jsp ProductBean.java

addToCart.jsp UserBean.java

AddProduct.java
viewProducts.jsp
DeleteProduct.java
searchLoad.jsp

product.jsp

admin_Dashboard.jsp

admin_Orders.jsp Data Access


setting.jsp Administrator.db
header.jsp Category.db
buyItems.jsp
SubCategory.db
userInfo.jsp
Company.db
showMyBill.jsp
Product.db

Images.db

User.db

User_Details.db

Order.db

Sales.db

Expenses.db

Figure 4.5: Package diagram of Alpha Book Store

24
4.3 List of Tables:

1. product Table

Table 4.1: Product table structure

3. category table

Table 4.2: Category table structure

4. subcategory table

Table 4.3: Category table structure

25
5. user table

Table 4.4: User table structure

6. administrators table

Table 4.5: Adminstrators table structure

7. company table

Table 4.6: Company table structure

8. expenses table

Table 4.7: Expenses table structure


26
9. images table

Table 4.8: Images table structure

9. sales table

Table 4.3: Sales table structure

10. user-details table

Table 4.10: Category table structure

11. order table

Table 4.11: Order table structure


27
Chapter 5
SCREENSHOTS

1. index.jsp

28
Figure 5.1: Alpha Book Store home page when no user login.

2. index.jsp

Figure 5.2: Alpha Book Store home page when login form extended.

29
3. index.jsp

Figure 5.3: User is registering an account on Alpha Book Store Website.

4. userinfo.jsp

Figure 5.4: Logged In userinfo.jsp page with no details added.

30
5. userinfo.jsp

Figure 5.5: Logged in userinfo.jsp page when user’s details added.

6. viewProduct_.jsp

Figure 5.6: User Filtering the list of Products (Here the Filter is Engineering(Computer/IT)).
31
7. product.jsp

Figure 5.7: User viewing the full details of a chosen product.

8. addToCart.jsp

Figure 5.8: User Cart(list of products user have chosen).


32
9. buyItems.jsp

Figure 5.9: User have to fill their details before purchasing items.

10. buyItems.jsp

Figure 5.10: User have filled their details here and ready to go.
33
11. userinfo.jsp

Figure 5.11: User’s whole order list is shown here.

12. showMyBill.jsp

Figure 5.12: User has confirmed their order and its status is pending.

34
13. showMyBill.jsp

Figure 5.13: User order has been approved and ready to deliver.

14. showMyBill.jsp

Figure 5.14: User order has been delivered , now user can print their bill.
35
15. showMyBill_Print.jsp

Figure 5.15: User order printed bill.

16. index.jsp

Figure 5.16: Alpha Book Store search bar.


36
17. admin_.jsp

Figure 5.17: Alpha Book Store admin login page.

18. admin_Performance.jsp

Figure 5.18: Admin home page.


37
19. admin_Performance.jsp

Figure 5.19: The Alpha Book Store performance through Line graph and Pie Chart.

20. admin_Performance.jsp

Figure 5.20: Items viewed by Category through pie chart and product sold through line graph.

38
21. admin_Performace.jsp

Figure 5.21: Top 10 product sold and views on Alpha Book Store.

22. admin_addProduct.jsp

Figure 5.22: Here Admin has started adding a product.


39
23. admin_addProduct_1.jsp

Figure 5.23: Admin has added the name of the publisher.

24. admin_addProduct_2.jsp

Figure 5.24: Admin has added the Category and SubCategory name of the book.
40
25. admin_addProduct_3.jsp

Figure 5.25: Admin has added the book name and its search tag.

26. admin_addProduct_4.jsp

Figure 5.26: Admin has added the book price, quantity and a summary.
41
27. uploadImage.jsp

Figure 5.27: Admin has uploaded the image of the book.

28. admin_pendingOrders.jsp

Figure 5.28: List of product pending and need an approval from the admin.
42
29. admin_approvedOrders.jsp

Figure 5.29: The approved order and need further approval.

30. admin_settings.jsp

Figure 5.30: Admin setting page, here admin can add a user to admin panel.
43
31. admin_settings.jsp

Figure 5.31: Admin setting page, here admin can delete the selected category or subcategory.

44
Chapter 6
CONCLUSION AND FUTURE WORK

6.1 Conclusion
The software development is never completed. There is always a need for modification. There
could have been other approaches to implement the system. I have tried to my level best to make
the system an interactive as possible.

The developed system is flexible, and changes whenever can be made easy. Using the facilities
and functionalities of J2EE and jsp, the website has been developed in a neat and simple manner,
thereby reducing the operators work. The speed and accuracy are maintained in proper way. The
user-friendly nature of this website developed in J2EE and jsp is very easy to work with both for
the admin as well as other users with little knowledge of computer.

6.2 Future Work

This project can be easily implemented under various situations. We can add new features as and
when we require. Reusability is possible as and when require in this project. There is flexibility
in all the modules.

We can also include online payment services to this project using PayPal. This will help
customers to pay online for their purchases using Credit/Debit card. There are many features
which could be added to this project for making this project more productive.

45
BIBLIOGRAPHY
Reference Books
 Thomas A. Powell, The Complete Reference to HTML5 and CSS3, McGraw Hill

 Kathy Seirra and Bert Bates, Head First Java and Head First JSPs and Servlets, McGraw Hill

 Lynn Beighley, Head First SQL, McGraw Hill

 James Groff, The Complete Reference SQL, McGraw Hill

 Ronan Cranley, Head First SQL, McGraw Hill

Website Reference

 www.oracle.com/technetwork

 www.tutorialspoint.com

 www.w3schools.com

 www.javatpoint.com

 www.mysirg.com

 www.youtube.com

 www.youtube.com/udacity

46
APPENDIX
 Modules and files used in Alpha Book Store

Figure I: Files used in Alpha Book Store (part 1)

47
 Modules and files used in Alpha Book Store

Figure II: Files used in Alpha BookStore (part 2).

48
 Modules and files used in Alpha Book Store

Figure III : Files used Alpha Book Store (part 3).

49
 web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-
app_3_1.xsd">
<servlet>
<servlet-name>addAnAdministrator</servlet-name>
<servlet-class>admin.addAnAdministrator</servlet-class>
</servlet>
<servlet>
<servlet-name>administrator</servlet-name>
<servlet-class>admin.administrator</servlet-class>
</servlet>
<servlet>
<servlet-name>registerServlet</servlet-name>
<servlet-class>admin.registerServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>_logoutServlet</servlet-name>
<servlet-class>loginRegister._logoutServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>admin_login</servlet-name>
<servlet-class>loginRegister.admin_login</servlet-class>
</servlet>
<servlet>
<servlet-name>changeMyPass</servlet-name>
<servlet-class>loginRegister.changeMyPass</servlet-class>
</servlet>
<servlet>
<servlet-name>changeMyPassword</servlet-name>
<servlet-class>loginRegister.changeMyPassword</servlet-class>
50
</servlet>
<servlet>
<servlet-name>loginServlet</servlet-name>
<servlet-class>loginRegister.loginServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>registerServlett</servlet-name>
<servlet-class>loginRegister.registerServlett</servlet-class>
</servlet>
<servlet>
<servlet-name>changeProductStatus</servlet-name>
<servlet-class>orders.changeProductStatus</servlet-class>
</servlet>
<servlet>
<servlet-name>addCategory</servlet-name>
<servlet-class>product.addCategory</servlet-class>
</servlet>
<servlet>
<servlet-name>addCompany</servlet-name>
<servlet-class>product.addCompany</servlet-class>
</servlet>
<servlet>
<servlet-name>addProduct</servlet-name>
<servlet-class>product.addProduct</servlet-class>
</servlet>
<servlet>
<servlet-name>addSubCategory</servlet-name>
<servlet-class>product.addSubCategory</servlet-class>
</servlet>
<servlet>
<servlet-name>buyItems</servlet-name>
<servlet-class>product.buyItems</servlet-class>
</servlet>
51
<servlet>
<servlet-name>getProductSubCategory</servlet-name>
<servlet-class>product.getProductSubCategory</servlet-class>
</servlet>
<servlet>
<servlet-name>removeCartProduct</servlet-name>
<servlet-class>product.removeCartProduct</servlet-class>
</servlet>
<servlet>
<servlet-name>removeCategory</servlet-name>
<servlet-class>product.removeCategory</servlet-class>
</servlet>
<servlet>
<servlet-name>removeCompany</servlet-name>
<servlet-class>product.removeCompany</servlet-class>
</servlet>
<servlet>
<servlet-name>removeSubCategory</servlet-name>
<servlet-class>product.removeSubCategory</servlet-class>
</servlet>
<servlet>
<servlet-name>getCompanyNames</servlet-name>
<servlet-class>product.addProductPack.getCompanyNames</servlet-class>
</servlet>
<servlet>
<servlet-name>addUserDetalsServlet</servlet-name>
<servlet-class>user.addUserDetalsServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>addAnAdministrator</servlet-name>
<url-pattern>/addAnAdministrator</url-pattern>
</servlet-mapping>
<servlet-mapping>
52
<servlet-name>administrator</servlet-name>
<url-pattern>/administrator</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>registerServlet</servlet-name>
<url-pattern>/registerServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>_logoutServlet</servlet-name>
<url-pattern>/_logoutServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>admin_login</servlet-name>
<url-pattern>/admin_login</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>changeMyPass</servlet-name>
<url-pattern>/changeMyPass</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>changeMyPassword</servlet-name>
<url-pattern>/changeMyPassword</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>loginServlet</servlet-name>
<url-pattern>/loginServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>registerServlett</servlet-name>
<url-pattern>/registerServlett</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>changeProductStatus</servlet-name>
53
<url-pattern>/changeProductStatus</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>addCategory</servlet-name>
<url-pattern>/addCategory</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>addCompany</servlet-name>
<url-pattern>/addCompany</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>addProduct</servlet-name>
<url-pattern>/addProduct</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>addSubCategory</servlet-name>
<url-pattern>/addSubCategory</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>buyItems</servlet-name>
<url-pattern>/buyItems</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>getProductSubCategory</servlet-name>
<url-pattern>/getProductSubCategory</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>removeCartProduct</servlet-name>
<url-pattern>/removeCartProduct</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>removeCategory</servlet-name>
<url-pattern>/removeCategory</url-pattern>
54
</servlet-mapping>
<servlet-mapping>
<servlet-name>removeCompany</servlet-name>
<url-pattern>/removeCompany</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>removeSubCategory</servlet-name>
<url-pattern>/removeSubCategory</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>getCompanyNames</servlet-name>
<url-pattern>/getCompanyNames</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>addUserDetalsServlet</servlet-name>
<url-pattern>/addUserDetalsServlet</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>

55
 JSP File
 index.jsp
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@page import="database.DB_Conn"%>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Alpha BookStores</title>
<!-- Default Stylesheets -->
<%@include file="includesPage/_stylesheets.jsp" %>
<link rel="stylesheet" href="css/slider.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/slider.js"></script>
<script type="text/javascript" >
// This is the script for the banner slider
$(document).ready(function() {
$('#slider').s3Slider({
timeOut: 7000
});
});
</script>
<script type="text/javascript" src="js/myScript.js"></script>
</head>
<body>
<%
if (session.getAttribute("user") == null ){// THen new user, show join now
%>
<jsp:include page="includesPage/_joinNow.jsp"></jsp:include>
<%
}else {
56
%>
<jsp:include page="includesPage/_logout.jsp"></jsp:include>
<%
}
%>
<%@include file="includesPage/_search_navigationbar.jsp" %>
<%@include file="includesPage/_facebookJoin.jsp" %>
<div id = "banner">
<div class="container_16">
<div class="grid_16" style="padding-left: 20px; " id="slider">
<ul id="sliderContent">
<!-- Duplicate this code for each image -->
<li class="sliderImage" style="display: none; ">
<img src="images/banner/a2.jpg" width="900" height="300" />
<span class="top" style="display: none; ">
<strong>Alpha BookStore...</strong>
<br>Alpha BookStore provides Engineering,Medical,Management and School books
available now at your doorsteps.
</span>
</li>
<div class="clear sliderImage"></div>
</ul>
</div>
</div>
</div>
<div class="container_16">
<div id = "contents">
<!-- LeftSide -->
<%
Connection c = new DB_Conn().getConnection();
Statement st = c.createStatement();
String getCategory = "SELECT * FROM `category` ";
ResultSet rs = st.executeQuery(getCategory);
57
%>
<div id="leftside" class="grid_3">
<div>
<ul id="leftsideNav">
<li><a href="#"><strong>Categories</strong></a></li>
<%
while (rs.next()){
String category = rs.getString ("category_name");
%>
<li><a href="viewProducts_.jsp"><%= category %></a></li>
<%
}
%>
</ul>
</div>
<div class="adv">
<h2><br/>This is The Header of an Advertisement</h2>
<p>We offer Advertisement display here </p>
</div>
</div>
</div>
<!-- Middle -->
<div id="middle"class="grid_13">
<jsp:include page="includesPage/mainHeaders/topMostViewedProducts_4.jsp"></jsp:include>
</div>
<!--The Middle Content Div Closing -->
</div>
<jsp:include page="includesPage/_footer.jsp"></jsp:include>
</body>
</html>

58
 Java file
 DB_Conn.java
package database;
import java.sql.*;
public class DB_Conn {
private String database="alpha", username = "root", password = "";
private Connection con;
public Connection getConnection() throws SQLException, ClassNotFoundException {
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/"+database+"",""+username+"
",""+password+"");
return con;
}
public String getDatabase() {
return database;
}
public void setDatabase(String database) {
this.database = database;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}

59
60

You might also like