Mom's Choice Website

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 46

SIDHO-KANHO-BIRSHA UNIVERSITY

PURULIA
A Project submitted in
partial fulfillment of the
requirement for the
Honours Degree of
Bachelor of Computer
Application

Mom’s Choice
Paper Code: BBCACCHS602
Year of Examination: 2021-2022
6thSEMESTER

Submitted By

Mili Karmakar Sanchayeta Nandi


Roll -120661 No – 1915490 Roll- 120661 No-1915498
Reg. No. - 013670 of 2019-2020 Reg. No. - 013678 of 2019-2020

Nurjahan Khatun
Roll - 120661 No – 1915491
Reg. No. - 013671 of 2019-2020

Of

RAGHUNATHPUR COLLEGE

Page | 1
We express our special thanks of gratitude to our project guide Mr.Sougata Mukherjee
and Mrs. Sanchita Banerjee, professor of BCA department in Raghunathpur College. We also
express our special thanks to our Principal Dr. Phalguni Mukhopadhyay who gave us the
golden opportunity to do this project on the topic Moms Choice. Which help us in doing lot
of research and we come to know about many new things so we are very thankful to them.
We deeply appreciate our acknowledgement to Mr. Sougata Mukherjee and Mrs. Sanchita
Banerjee professors for their support and help for the development of the project.

I am very thankful for the open–handed support extended by many people. While no
list would be complete, it is my pleasure to acknowledge the assistance of my friends who
provided encouragement, knowledge and constructive suggestions.

Date:

________________
Nurjahan Khatun

___________________
Sanchayeta Nandi

____________________
Mili Karmakar

Page | 2
This is to certify that the project entitled “Mom’s Choice” is done by me, and it is
authentic work carried out for the partial fulfillment of the requirements for the degree of
BCA under the guidance of Mr. Sougata Mukharjee. I also certify that that I am aware of
the “BCA PROJECT, SIDHO-KANHO-BIRSHA UNIVERSITY, PURULIA” issued by
Sidho-Kanho-Birsha university, Purulia and this project report is based on that standard. The
matter embodies in this project has not submitted earlier for award of any degree or diploma
to the best of my knowledge and belief.

Signature of the Teacher

Sanchayeta Nandi
Roll: 120661 No:1915498
Registration No:013678 of 2019-2020
Raghunathpur College, Purulia

Page | 3
This is to certify that the project entitled “Mom’s Choice” is done by me, and it is
authentic work carried out for the partial fulfillment of the requirements for the degree of
BCA under the guidance of Mr. Sougata Mukharjee. I also certify that that I am aware of
the “BCA PROJECT, SIDHO-KANHO-BIRSHA UNIVERSITY, PURULIA” issued by
Sidho-Kanho-Birsha university, Purulia and this project report is based on that standard. The
matter embodies in this project has not submitted earlier for award of any degree or diploma
to the best of my knowledge and belief.

Signature of the Teachers

Nurjahan Khatun
Roll: 120661 No:1915491
Registration No:013671 of 2019-2020
Raghunathpur College, Purulia

Page | 4
This is to certify that the project entitled “Mom’s Choice” is done by me, and it is
authentic work carried out for the partial fulfillment of the requirements for the degree of
BCA under the guidance of Mr. Sougata Mukharjee. I also certify that that I am aware of
the “BCA PROJECT, SIDHO-KANHO-BIRSHA UNIVERSITY, PURULIA” issued by
Sidho-Kanho-Birsha university, Purulia and this project report is based on that standard. The
matter embodies in this project has not submitted earlier for award of any degree or diploma
to the best of my knowledge and belief.

Signature of the Teacher

Mili karmakar
Roll: 120661 No:1915490
Registration No:013670 of 2019-2020
Raghunathpur College, Purulia

Page | 5
Our “Mom’s Choice” website is a shopping system with full source code of online
shopping ordering system. This website has been developed to override the problems
prevailing in the practicing manual system.

INTRODUCTION:
In fast pace of time today everyone is squeeze for time people want to easily
shopping without going to shop. The software has ability to host allow a user to maintain the
online shopping system. In the online grocery shop to provide many facilities like home
delivery at the time, debit card/credit card/net banking/cash on delivery payments system,
add cart or remove etc. Basically this website is designed to enable customer to order the
groceries they need from home through this online website.

User Modules:
People can easily get their daily needs grocery items by using this online grocery
shopping website.

Page | 6
Chapter Contents Page No.
No.

1. INTRODUCTION
8-14
1.1 Motivation
1.2 Aim of Software
1.3 Benefits
1.4Theoretical Background
2. OBJECTIVES

2.1 Requirement Analysis


2.2 User Interface 15-21
2.3 Hardware and Software Requirement
2.4 Product Function
2.5 User Characteristics
2.6 Technology Used

3. IMPLEMENTATION
22-23
 Scope of the Project
4. SYSTEM DESIGN
4.1 Entity Relationship Diagram(ERD) 24-31
4.2 Data Flow Diagram(DFD)
4.3 Table Design
5. Coding 32-39
6. Snapshots of the Project 40-43
7. Conclusion 44
8. Future Scope 45
9. Bibliography 46

Page | 7
CHAPTER 1

Now a days, shopping online is occupying an essential part of shopping, big and
small companies or stores need to have its commercial website ,any serious business can`t be
improved and reaches all over the world unless it has web site, even most families, clubs and
pet snakes do, too.

Having a web site gives people around the world opportunity to know your
business or provided services. It can spread your business so fast, therefore you can achieve
success. It’s easier for everyone to do shopping online and buy what needed without moving
from their home. Also another reason let people buy online, is that one line grocery stores
have a wider range of products and various kinds of the same products whereas the online
ones don`t have.

The “MOMS CHOICE PEOJECT” has been developed to override the problems
prevailing in the practicing manual system. This software is supported eliminate and in
some cases reduce the hardships faced by this existing system. Moreover this system is
designed for the particular need of the company carry out operations in a smooth and
effective manner.

This application is reduced as much as possible to avoid errors while entering the
data. It also provides error message while entering invalid data. No formal knowledge
is needed for the user to use this system. Thus by this all it proves it is user-friendly,
Moms Choice management system as described above, can lead to error free, secure,
reliable and fast management system. It can assist the user to concentrate on their other
activities rather to concentrate on record keeping. Thus it will help organization in
better utilization of resources.

Page | 8
1.1 MOTIVATION

The motivation for designing this shopping-cart application came because I


love online shopping rather than spending lot of time at physical markets. Further, using the
available stores to sell the products, there is also the possibility of designing one’s own
customized shopping-cart application from scratch because custom-designed platforms are
expensive. Moreover, I value recent learning about the Java and JavaScript programming
languages as well as seeing how powerful and dynamic they are when it comes to web
designing and applications. Apart from helping computer science students understand the
concepts of web-application designing, it would be very easy to incorporate the idea of using
programming techniques from the available visuals to understand how a piece of code
appears on a user interface. The languages used to build this application are JavaScript,
HTML, and Java because I found them to be extremely useful while working on the
technologies at my workplace, Thomson Reuters.

1.2 AIM OF THE SOFTWARE

This software is developed to help computer science students learn about


application designing using JavaScript and HTML from their basic capabilities. This
application allows the student to understand the basics about the appearance of a first web
page and how a complete working application can be built from scratch. It allows students to
understand the concept of user-integrated graphics and how JavaScript can be embedded into
HTML. Further, it gives insight about how the client-side language interacts with the server-
side language, Java, and finally with the database. This shopping-cart application is designed,
primarily, for computer science students to learn and understand the concept of application
development, and can also be used to teach ecommerce and web-application topics. The
application can be downloaded and installed on different machines, and students can view
the source code for all the different parts shown on the UI to visually understand how a
particular piece of code works. This shopping-cart application is very versatile and can be
enhanced by adding more functions and modified graphics for use with commercial
purposes.
1.3 BENEFITS

Technology today has made the overall shopping experience easier and
convenient for many consumers. The online shopping experience is also improving based on
the continual technology advancements in the industry. For example, consumers today opt to
look to shop online whenever possible. They do so because they are now able to do much
more research on the products they are looking at before buying. Consumers also can look at
many different websites to compare costs before making a purchasing decision without
having to leave the convenience of their home. This provides the customers with better
knowledge of the products being purchased as well as providing them to potentially get the
best deal with relatively lost time investment. Compare that to a customer having to drive
from store to store looking for the best deal.
Page | 9
1.4 THEORETICAL BACKGROUND
HTML:
Hypertext markup language (HTML) is a Hypertext markup language, the
standard markup language for documents designed to displayed and viewed on the online
during a browser also helps to create the structure of the web page. because it is a markup
language, it consists of many tags. There are tags to display text, tables, ordered lists and
unordered lists, etc. There are two main sections on the HTML page: head and body
section. The data that describes the page also termed as metadata is inside the head section
while the body section includes all the tags that are necessary to represent the visible
content of the web page HTML is a platform-independent language so that can be made in
use in any platform like Windows, Linux, Macintosh, etc.
There are various HTML versions. The newest version is HTML 5. it’s more advanced
features like Geo-location, native audio, and video support, Canvas, web socket, etc.
Usually, HTML is a simple language to find out and use. A programmer can create an
HTML file employing a simple text editor and execute it employing a browser.
Advantages of HTML:

 HTML helps to build structure of a website and is a widely used Markup language.
 It is easy to learn.
 Every browser supports HTML Language.
 HTML is light weighted and fast to load.
 Storage of big files are allowed because of the application cache feature.
 Do not get to purchase any extra software because it’s by default in every window.
 Loose syntax (although, being too flexible won’t suit standards).
 HTML is simple to edit as being a plain text.
 It integrates easily with other languages such as JavaScript, CSS etc.
 HTML is that it is easy to code even for novice programmers.
 HTML also allows the utilization of templates, which makes designing a webpage easy.
 It is fast to download as the text is compressible.
 Very useful for beginners in the web designing field.

Page | 10
CSS:
Cascading Style Sheets, fondly referred to as CSS, is a simply designed language
intended to simplify the process of making web pages presentable. CSS allows you to apply
styles to web pages. More importantly, CSS enables you to do this independent of the
HTML that makes up each web page. It describes how a webpage should look: it prescribes
colors, fonts, spacing, and much more. In short, you can make your website look however
you want. CSS lets developers and designers define how it behaves, including how
elements are positioned in the browser.

Cascading Style Sheets (CSS): CSS is defined as a method sheet language that
provides web designers control over how an internet site communicates with web browsers
including the formatting and display of their HTML documents.
CSS or cascading sheet may be a text-based coding language that specifies the website
formats and the way a site communicates with web browsers. The language allows web
developers to regulate various style elements and functionalities, like layout, color, fonts,
and therefore the formatting and display of HTML documents.
The main goal (as a method sheet language) was to separate document content
from document presentation, which incorporates style elements, like color, layout, and
fonts. CSS handles the design and feel a part of an internet page. Using CSS, you will
control the color of the text, the design of fonts, the spacing between paragraphs, how
columns are sized and laid out, etc.
CSS instructs the display of the HTML on how the web site will display at the
user’s end. Let us have a glance on the benefits and drawbacks of CSS.
Advantages of CSS:
 CSS plays an important role, by using CSS you simply got to specify a repeated style for
element once & use it multiple times as because CSS will automatically apply the
required styles.
 The main advantage of CSS is that style is applied consistently across variety of sites.
One instruction can control several areas which is advantageous.
 Web designers needs to use few lines of programming for every page improving site
speed.
 Cascading sheet not only simplifies website development, but also simplifies the
maintenance as a change of one line of code affects the whole web site and maintenance
time.
It helps to form spontaneous and consistent changes.
 CSS changes are device friendly. With people employing a batch of various range of
smart devices to access websites over the web, there’s a requirement for responsive web
design.

Page | 11
PHP:
PHP is known as the general purpose programming language. It is used as a server-side
scripting language that is mainly used for the development of web sites. The PHP
frameworks also make web development easier. This framework helps in reusing the same
code and there is no need to write the lengthy and complex code for the web
applications. PHP frameworks are mainly open source and can be used easily. It was
developed by Rasmus Lerdorf and it was developed in the year 1994. PHP was written in C
language primarily but some of the components were written in C++ language as well.

Advantages of PHP:
 many available specialists;

 a large base of reference and educational materials;

 better loading speed of websites;

 more options for database connectivity;

 a large collection of open-source addons;

 inexpensive website hosting;

 great synergy with HTML;

 excellent flexibility and combinability;

 various benefits provided by cloud solutions.

Page | 12
JS:
JavaScript is an object-based client-side scripting language that is very popular and used to
create dynamic and interactive web pages. Javascript is an interpreted language usually used
with HTML, and programs written in JavaScript are called lightweight scripts.

Earlier, JavaScript was named LiveScript, but later, Netscape changed its name to JavaScript
because its origin was from Java which was very popular at that time. JavaScript released its
first look for Netscape 2.0 in 1995 under the name "LiveScript".

 JavaScript can interact with HTML DOM elements and dynamically control the
webpage.
 You can perform client-side validation using Javascript.
 Using JavaScript, you can create drop-down menus, pop-up windows, and dialog
boxes.
 JavaScript can be used to load asynchronous data without refreshing the webpage.
 JavaScript can be used in game development.

Advantages of JS:

 Speed: Client-side JavaScript is very fast because it can be run immediately within the
client-side browser. Unless outside resources are required, JavaScript is unhindered by
network calls to a backend server.

 Simplicity: JavaScript is relatively simple to learn and implement.

 Popularity: JavaScript is used everywhere on the web.

 Interoperability: JavaScript plays nicely with other languages and can be used in a huge
variety of applications.

 Server Load: Being client-side reduces the demand on the website Server.

 Gives the ability to create rich interfaces.

Page | 13
MYSQL:

Some of these advantages have been explained below.


Reduced Total Cost of Ownership:
MySql one of the most popular open source database management system that allows
you to manage relational database. Since MySql open source, you can use MySql free and if
you want, you can tailor its source code according to your requirement. Most of the
companies prefer MySQL because they don't have to pay anything for this excellent product.
Portability:
MySQL is cross platform database server. It can run on different plateform like
Linux,Solaris and Windows etc. It is good choice for those project that target multiple
platforms particularly web application. In fact, MySQL is a part of the famous LAMP (Linux
Apache MySQL PHP) server stack which is used worldwide for web application
development. MySql support many plateform with different languages like C, C++, PHP,
PERL, JAVA, Python etc.
Seamless Connectivity:
There are various secure and seamless connection mechanisms are available in order
to connect with MySQL server. These connections include named pipes, TCP/IP sockets and
UNIX Sockets.
Rapid Development and Round-the-Clock Uptime:
MySQL comes with the assurance of 24x7 uptime and offers a wide range of high-
availability solutions, including specialized cluster servers and master/slave replication
configurations. MySQL has a very large developer community which releases regular
patches and updates for MySQL.
Data Security:
MySQL is globally recognize the most secure and reliable database management
system used in popular web applications including WordPress, Drupal, Joomla, Facebook
and Twitter. Data protected via password and good thing about these passwords is that they
are stored in encrypted form and cannot break these complex encryption algorithms.

Page | 14

CHAPTER 2

The Online Shopping System (OSS) is a web-based application. The purpose of the
application is to automate and facilitate the whole process of shopping. This application fixes
the limitation and problems of paper based processes. The main goal to increase the quantity
of sales by making the new technology of web pages design more attractive and to search a
lot of customers and company to their location. By this system we can advertise and send
procure to a lot of customer by sending email.

2.1 REQUIREMENT ANALYSIS

The requirements analysis and gathering processes are critical for the success of any software
engineering project. Requirements analysis in software engineering is a process that
determines the tasks that are required to determine the needs and conditions to design a
new product or to make modifications in any existing product/application. This process
considers all the stakeholders’ conflicting requirements, and analyzes the documentation and
validation of the system. The requirements should be actionable, measurable, testable, and
related to the defined needs of the system design. From the software-engineering perspective,
requirements analysis is a three-step process.

1. Requirements Elicitation:
Elicitation of requirements, also known as requirements gathering, includes the task
of identifying various requirement types from stakeholders or from project documentation.

2. Requirements Analysis:
Analysis of requirements determines if the gathered requirements are clear,
complete, and consistent. The analysis also handles any ambiguous requirements that do not
clearly state what needs to be implemented, which could create a loss of resources and time if
identified later in the development or testing phase .

Requirement analysis requires identifying the stakeholders and taking their


needs into account to help them understand the implications of designing the new system,
along with what modules are worth implementing and which ones are more cost efficient,
and then to create a software-requirement specification document. To clearly elicit
the stakeholders requirements, different processes, such as developing a scenario or user
stories, and identifying the use case which is being used for the project, can be utilized.

Page | 15
Stakeholder analysis says that, to clearly gather the requirements of the project, analysts first
need to identify the stakeholders. Stakeholders are people or organizations that have a valid
interest or use in the system. The steps to identify the stakeholders are as follows:

 Anyone who operates the system.

 Anyone who benefits from the system

 Anyone who is directly or indirectly involved in purchasing the system

 People or organizations opposed to the system

 Organizations responsible for the system design

 Organizations that regulate the financial or safety aspects of the system Once the
stakeholders are successfully identified, interviews are conducted through different
processes; the needs and requirements of the system are identified, and are
requirements specification document is prepared. The document is then discussed with
the major stakeholders to identify any ambiguity with the requirements and
understanding of the system.

3. Requirements Documentation:
This step involves documenting the requirements in
various forms, including summary lists, natural language documents, visual documents, use
cases, user stories, or process specifications. A requirement specification document is
categorized in different ways according to the stakeholders’ need, helping to create a clear
contract between development and business. The following sections include the
different categories of requirements specification document that are essential for designing
this application: the functional requirements, constraints, system requirements, etc.

Page | 16
2.2 HARDWARE AND SOFTWARE INTERFACE

Hardware Interface
The online shopping-cart application shall provide minimum hardware requirements. The
following hardware configurations are required for a PC using the online shopping-cart
application:

 Pentium processor 10

 32 MB of free hard-drive space

 128 MB of RAM

Software Interface
This section lists the requirements that are needed to run the system efficiently. The
operating system needed for the system to run effectively, the interface to run the
application, the driver for running Java web applications, the integrated development
environment to develop the application, and the third-party tool used for editing purposes are
as follows:
 OPERATING SYSTEM (Any one of the following):

 Windows 7
 Windows 8
 Windows 10

 Web Brower (Any one of the following):

 Internet Explorer

 Mozilla Firefox

 Google Chrome

 Third-Party Tool: Microsoft Word

Page | 17
2.3 USER INTERFACE
The two interface types found in the online shopping-cart application are as follows:

1. User Interface:
Users are able to view the home page of the shopping-cart application, browse the different
categories, browse and add any number of items from any categories in the shopping cart,
look for information about each product, delete the items in the shopping cart, save the cart
for later viewing, check out or continue shopping after adding the item to the cart, and
check out the items by completing the required information in the order form.

2. Admin Interface:
The administrator is able to view the users’ information that was entered during checkout in
the database, can update the information, price, shipping costs of the items, add or remove
items from the main display.

2.4 PRODUCT FUNCTION

 The online shopping-cart application would have the following basic functions: 1.

 Display all the categories available for shopping on the system’s main page.2.

 Display all the items linked to each category listed on the main page.3.

 Allow the administrator to add new items to the existing list of available items.4.

 Allow users/administrator to remove items.5.

 Allow the administrator to modify the price of each item.6.

 Allow the administrator to update the description about each item.

Page | 18
2.5 User Characteristics
The users of the online shopping-cart application, based on their roles, are customers(users)
and the administrator (owner). These users are identified based on their experience and
technical expertise.

1. Admin:
The administrator is the owner of this online shopping-cart application. One must have a
basic understanding of computers and the internet as well as prior knowledge for operating
the eclipse and Java programming languages. The administrator is responsible for
maintaining all the training documents required for the system. The administrator
can perform the following functions:

 Assign or change the price of the items, update the items in the list, and delete the
items.

 Assign sales tax for different states at the time of checkout.

 View the history of the customers who purchased the items.

2. Users:
The users of this online shopping-cart application are all customers who would shop to test
the application. These users are anyone with shopping experience and the know-how to
browse through a shopping-cart application. They must have basic understandings about
computers and the internet. The users should be able to perform the following functions
using this system:

 View, browse, and select a category on the home page.

 View, add, and update items in the cart.

 Delete items from the cart.

 Check out the items from the application or continue shopping.

 Sign-on/login using a username and password.

 Place the order by completing the order form.

Page | 19
2.6 TECHNOLOGY USED

Server: Apache 2.4.4

Front-end: HTML, CSS, JS

Back-end: MySQL 5.5.32(using phpmyadmin 4.0.6), PHP 7.4

Integrated Development Environment(IDE): Notepad++, Visual Studio Code

Platform: Windows 7

We have used XAMPP 1.8.2 which is a free and Open Source Cross-Platform Web
Server Solution Stack. It comes with Apache Web Server, MySQL Database, PHP and Perl
Programming Languages. A couple of advantages of using XAMPP for development are:

1. You can start and stop the whole web server + database stack with one command.

2. XAMPP is portable so you can carry it around on a thumb drive.

3. The security settings are strict by default, nobody but you will be able to access the
web server.

4. PHP error reporting is enabled by default, which helps when debugging scripts.

5. Easy to install.

Apache Server:
Web server apache is an open source server application. There are a lot of benefits and
advantages that are provided from the server. Numerous features like the openness,
extensibility, portability and flexibility of apache server provide advantages to administrator
leading to higher efficiency and utility.

MySQL:
MySQL is easy to use, yet extremely powerful, secure, and scalable. And because of
itssmall size and speed, it is the ideal database solution for Web sites. Some of its
advantages include the following:

Page | 20
1. It's easy to use:
While a basic knowledge of SQL is required—and most relational databases require
the same knowledge — MySQL is very easy to use. With only a few simple SQL statements,
you can build and interact with MySQL.
2. It's secure:
MySQL includes solid data security layers that protect sensitive data from intruders.
Rights can be set to allow some or all privileges to individuals. Passwords are encrypted.
3. It's inexpensive:
MySQL is available by free download from MySQL Web site.
4. It's fast:
In the interest of speed, MySQL designers made the decision to offer fewer features
than other major database competitors, such as Sybase* and Oracle*.However, despite
having fewer features than the other commercial database products, MySQL still offers all of
the features required by most database developers.
5. It's scalable:
MySQL can handle almost any amount of data, up to as much as 50million rows or
more. The default file size limit is about 4 GB. However, you can increase this number to a
theoretical limit of 8 TB of data.
6. It manages memory very well:
MySQL server has been thoroughly tested to prevent memory leaks.
7. It runs on many operating systems:
MySQL runs on many operating systems, including Novell NetWare, Windows*
Linux*, many varieties of UNIX* (such as Sun* Solaris*, AIX, and DEC* UNIX), OS/2,
FreeBSD*, and others.
8. It supports several development interfaces:
Development interfaces include JDBC,ODBC, and scripting (PHP and Perl),
letting you create database solutions that run not only in your NetWare 6.5 environment, but
across all major platforms, including Linux, UNIX, and Windows.

Page | 21
CHAPTER 3

This chapter includes the detailed design used to build the online shopping-cart
application. The system's design is used to create the functions and operations of the gathered
requirements in detail, including screen layouts, business rules, process diagrams, and other
documentation. The output of this chapter describes the new system which is defined as a
collection of modules and subsystems. This design stage takes the initial input requirements
that were identified in the approved requirements specification document. For each
requirement, there is a set of one or more design elements that are produced using the
different prototypes. These design elements describe the desired software features, in detail,
including functional hierarchy diagrams, screen layouts, activity diagrams, and class
diagrams. The intention of these diagrams is to describe the software in detail so that the
system can develop the application with less additional design input. The
system’s mock screen shots are shown later in this chapter.

3.1 SCOPE OF THE PROJECT

The scope of this work is to design, develop, and test the application according to the
time table using Microsoft word database and Visual Studio code/Notepad++. In addition, we
will need to use Some Designer software to design the interface and system logo and photos.

This project is supposed to be delivered in three phases, with each phase being an
add-onto the project that makes it more usable and acceptable.

1. In the first delivery, the application must be able to add an item to the shopping cart
and case.

 Browse categories on the home page

 Select a category and browse through the items

 View more information about an item.

 Add an item to the shopping cart.

 Continue shopping or go to checkout for the item.

Page | 22
2. The application must be able to check out the items in the cart.

 Check out the items.

 Continue shopping.

 Delete the items to update the shopping cart.

3. The application asks for user authentication before checking out.

 Add items to the cart.

 Check out the items

 Log in with a valid username and password.

4. The application must bring up the order form for the check out.

 Complete the information on the order form.

 Place the order.

Page | 23
CHAPTER 4
DETAILED LIFE CYCLE OF THE PROJECT

ENTITY RELATIONSHIP DIAGRAM DEFINITION:


An entity-relationship diagram is a data modeling technique that creates a graphical representation of the
entities, and the relationships between entities, within an information system.
The three main components of an ERD are:

 The entity is a person, object, place or event for which data is collected. The entity is
represented by a rectangle and labeled with a singular noun.
 The relationship is the interaction between the entities. A relationship may be
represented by a diamond shape, or more simply, by the line connecting the entities.
In either case, verbs are used to label the relationships.
 The cardinality defines the relationship between the entities in terms of numbers. An
entity may be optionalor mandatory. There are several different types of cardinality
notation; crow's foot notation, used here, is a common one. In crow's foot notation, a
single bar indicates one, a double bar indicates one and only one, a circle indicates
zero, and a crow's foot indicates many. The three main cardinal relationships are:
one- to-one, expressed as 1:1; one-to-many, expressed as 1: M; and many-to-many,
expressed as M: N.

The Standard Shapes Used Are:

Entity Relationship

Connector Attribute

The steps involved in creating an ERD are:

 Identify the entities

 Determine all significant interactions

 Analyze the nature of the interactions

 Draw the ERD

Page | 24
4.1 ENTITY RELATIONSHIP DIAGRAM
name password

id
image
Users

IS A
User
type id

User
type name
Admin user

email

Buy Create password


Add Create
product wishlist cart
s
Create User_type
message
e
image
cart
Product wishlist
message

id image produce

price
name
id Payment_status
order
details
categories
User_id
Placed_on
name
Total_price
e
number
email Total_product

method

address

Page | 25
4.2 DATA FLOW DIAGRAM

A Data Flow Diagram (DFD) is a graphical representation of the "flow" of data through an
information system. A data flow diagram can also be used for the visualization of data processing (structured
design).

(a) Elements of a DFD:


There are 4 key elements in a Data Flow diagram; Processes, Data Flows, Data Stores &
External entities and each element is drawn differently.

Process entity:
The Process entity identifies a process taking place; it must have at least oneinput and output. A process
with no input is known as a "miracle process" and one with nooutput is a "black hole process". Each process has the
following:

 A Number
 A Name (verb phrase)
 A Description
 At least one input
 At least one output

Data flow entity:


The Data Flow entity identifies the flow of data between processes, data stores & external entities. A data
flow cannot connect an external entity to a data source; at least one connection must be with a process. There are also
"physical" flows, i.e. those that use a physical medium. Each data flow has the following:

 A Name (Noun)
 A Description
 One or more connections to a process.

Data Store entity:


The Data Store entity identifies stores of data, both manual and electronic.
Each data store has the following:

 A Number
 A Name
 A Description
 One or more input data flows.
 One or more output data flows.

External entity:
The External Entity identifies external entities which interacts with the system,usually clients
but can be within the same organization. Each external entity has the following:

 A Name (Noun)
 A Description

Page | 26
The different notations to draw data flow diagrams, defining different visual
representations for Processes, Data Stores, Dataflow, and External Entities are as follows:

External Data store


Entity

Process Dataflow (Out)

Dataflow (In)

Page | 27
TOP LEVEL DFD

MOM’S
Request Request
CHOICE
USER ADMIN
Response Response
Level 0

User User user


details
userid+
password uers id+ Registration user details
password
Admin
0.1
Details
Generate
message userid+
password
Products

Message product details


Add
Products

0.2 Wishlist
Product details + Product details +
userid + password userid + password

Cart

Create Create
Cart Product details
+userid+password Wishlist
0.3 0.4

Order
Product details Generation Bill
+userid+password
0.5

Page | 28
4.3 TABLE DESIGN

Database Tables:
Name: Cart
Description: Cart is to track and maintain all the products selecting by the users to complete a purchase
from shopping portal.

Name: Message
Description: Online retailers use messaging for customer sevice to differentiate themselves from
Competitors, provide a frictionless customer experience, drive waste out of the consumers
Path-to-purchase,
se, and meet their customers where they already are.

Page | 29
Name: Orders
Description: The goal of an order m
management system is to get a product into cu
ustomer’s hand as
efficiently as possible.. It manage the journey of each item in the cu ustomer’s order, from the
time it goes into theirr cart to the moment it arrives on their doorsteep- and any returns that
may follow.

Name: Products
Description: Online store enables the customer to brows the range of products and services, view
photos product specification, features and price.

Page | 30
Name: Users
Description: Users determine whether or not a user can connect to a computer, network or similar
Networks.

Name: Wishlist
Description: It allows shoppers to create personalized collections of products they want to buy and save
them in their user a/c for future reference.

Page | 31
CHAPTER 5
CODE
Config.php
<?php

$db_name = "mysql:host=localhost;dbname=shop_db";
$username = "root";
$password = "";

$conn = new PDO($db_name, $username, $password);

?>

contact.php
<?php

@include 'config.php';

session_start();

$user_id = $_SESSION['user_id'];

if(!isset($user_id)){
header('location:login.php');
};

if(isset($_POST['send'])){

$name = $_POST['name'];
$name = filter_var($name, FILTER_SANITIZE_STRING);
$email = $_POST['email'];
$email = filter_var($email, FILTER_SANITIZE_STRING);
$number = $_POST['number'];
$number = filter_var($number, FILTER_SANITIZE_STRING);
$msg = $_POST['msg'];
$msg = filter_var($msg, FILTER_SANITIZE_STRING);

$select_message = $conn->prepare("SELECT * FROM `message` WHERE name = ? AND email = ? AND number
= ? AND message = ?");
$select_message->execute([$name, $email, $number, $msg]);

if($select_message->rowCount() > 0){


$message[] = 'already sent message!';
}else{

$insert_message = $conn->prepare("INSERT INTO `message`(user_id, name, email, number, message)


VALUES(?,?,?,?,?)");
$insert_message->execute([$user_id, $name, $email, $number, $msg]);

$message[] = 'sent message successfully!';

Page | 32
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>contact</title>

<!-- font awesome cdn link -->


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">

<!-- custom css file link -->


<link rel="stylesheet" href="css/style.css">

</head>
<body>

<?php include 'header.php'; ?>

<section class="contact">

<h1 class="title">get in touch</h1>

<form action="" method="POST">


<input type="text" name="name" class="box" required placeholder="enter your name">
<input type="email" name="email" class="box" required placeholder="enter your email">
<input type="number" name="number" min="0" class="box" required placeholder="enter your number">

<textarea name="msg" class="box" required placeholder="enter your message" cols="30" rows="10"></textarea>


<input type="submit" value="send message" class="btn" name="send">
</form>

</section>

<?php include 'footer.php'; ?>

<script src="js/script.js"></script>

</body>
</html>
Page | 33
admin_users.php
<?php

@include 'config.php';

session_start();

$admin_id = $_SESSION['admin_id'];

if(!isset($admin_id)){
header('location:login.php');
};

if(isset($_GET['delete'])){

$delete_id = $_GET['delete'];
$delete_users = $conn->prepare("DELETE FROM `users` WHERE id = ?");
$delete_users->execute([$delete_id]);
header('location:admin_users.php');

?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>users</title>

<!-- font awesome cdn link -->


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">

<!-- custom css file link -->


<link rel="stylesheet" href="css/admin_style.css">

</head>
<body>

<?php include 'admin_header.php'; ?>

<section class="user-accounts">

<h1 class="title">user accounts</h1>

<div class="box-container">

<?php
$select_users = $conn->prepare("SELECT * FROM `users`");
$select_users->execute();
Page | 34
while($fetch_users = $select_users->fetch(PDO::FETCH_ASSOC)){
?>
<div class="box" style="<?php if($fetch_users['id'] == $admin_id){ echo 'display:none'; }; ?>">
<img src="uploaded_img/<?= $fetch_users['image']; ?>" alt="">
<p> user id : <span><?= $fetch_users['id']; ?></span></p>
<p> username : <span><?= $fetch_users['name']; ?></span></p>

<p> email : <span><?= $fetch_users['email']; ?></span></p>

<p> user type : <span style=" color:<?php if($fetch_users['user_type'] == 'admin'){ echo 'orange'; }; ?>"><?=
$fetch_users['user_type']; ?></span></p>
<a href="admin_users.php?delete=<?= $fetch_users['id']; ?>" onclick="return confirm('delete this user?');"
class="delete-btn">delete</a>
</div>
<?php
}
?>
</div>

</section>

login.php
<?php

@include 'config.php';

session_start();

if(isset($_POST['submit'])){

$email = $_POST['email'];
$email = filter_var($email, FILTER_SANITIZE_STRING);
$pass = md5($_POST['pass']);
$pass = filter_var($pass, FILTER_SANITIZE_STRING);

$sql = "SELECT * FROM `users` WHERE email = ? AND password = ?";


$stmt = $conn->prepare($sql);
$stmt->execute([$email, $pass]);
$rowCount = $stmt->rowCount();

$row = $stmt->fetch(PDO::FETCH_ASSOC);

if($rowCount > 0){

if($row['user_type'] == 'admin'){

$_SESSION['admin_id'] = $row['id'];
header('location:admin_page.php');

Page | 35
}elseif($row['user_type'] == 'user'){

$_SESSION['user_id'] = $row['id'];
header('location:home.php');

}else{
$message[] = 'no user found!';
}

}else{
$message[] = 'incorrect email or password!';

?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>login</title>

<!-- font awesome cdn link -->


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">

<!-- custom css file link -->


<link rel="stylesheet" href="css/components.css">

</head>
<body>

<?php

if(isset($message)){
foreach($message as $message){
echo '
<div class="message">
<span>'.$message.'</span>
<i class="fas fa-times" onclick="this.parentElement.remove();"></i>
</div>
';
}
}

?>

<section class="form-container">

<form action="" method="POST">


Page | 36
<h3>login now</h3>
<input type="email" name="email" class="box" placeholder="enter your email" required>
<input type="password" name="pass" class="box" placeholder="enter your password" required>
<input type="submit" value="login now" class="btn" name="submit">
<p>don't have an account? <a href="register.php">register now</a></p>
</form>

</section>

</body>
</html>

<script src="js/script.js"></script>

</body>
</html>

register.php

<?php

include 'config.php';

if(isset($_POST['submit'])){

$name = $_POST['name'];
$name = filter_var($name, FILTER_SANITIZE_STRING);
$email = $_POST['email'];
$email = filter_var($email, FILTER_SANITIZE_STRING);
$pass = md5($_POST['pass']);
$pass = filter_var($pass, FILTER_SANITIZE_STRING);
$cpass = md5($_POST['cpass']);
$cpass = filter_var($cpass, FILTER_SANITIZE_STRING);

$image = $_FILES['image']['name'];
$image = filter_var($image, FILTER_SANITIZE_STRING);
$image_size = $_FILES['image']['size'];
$image_tmp_name = $_FILES['image']['tmp_name'];
$image_folder = 'uploaded_img/'.$image;

$select = $conn->prepare("SELECT * FROM `users` WHERE email = ?");


$select->execute([$email]);

if($select->rowCount() > 0){


$message[] = 'user email already exist!';
}else{
if($pass != $cpass){
$message[] = 'confirm password not matched!';
}else{
$insert = $conn->prepare("INSERT INTO `users`(name, email, password, image) VALUES(?,?,?,?)");
Page | 37
$insert->execute([$name, $email, $pass, $image]);

if($insert){
if($image_size > 2000000){
$message[] = 'image size is too large!';
}else{
move_uploaded_file($image_tmp_name, $image_folder);
$message[] = 'registered successfully!';

header('location:login.php');
}
}

}
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>register</title>

<!-- font awesome cdn link -->


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">

<!-- custom css file link -->


<link rel="stylesheet" href="css/components.css">

</head>
<body>

<?php

if(isset($message)){
foreach($message as $message){
echo '
<div class="message">
<span>'.$message.'</span>
<i class="fas fa-times" onclick="this.parentElement.remove();"></i>
</div>
';
}
}

?>

<section class="form-container">
Page | 38
<form action="" enctype="multipart/form-data" method="POST">
<h3>register now</h3>
<input type="text" name="name" class="box" placeholder="enter your name" required>
<input type="email" name="email" class="box" placeholder="enter your email" required>
<input type="password" name="pass" class="box" placeholder="enter your password" required>
<input type="password" name="cpass" class="box" placeholder="confirm your password" required>
<input type="file" name="image" class="box" required accept="image/jpg, image/jpeg, image/png">
<input type="submit" value="register now" class="btn" name="submit">
<p>already have an account? <a href="login.php">login now</a></p>

</form>

</section>

</body>
</html>

logout.php

<?php

@include 'config.php';

session_start();
session_unset();
session_destroy();

header('location:login.php');

?>

Page | 39
CHAPTER 6

Home page

Page | 40
Shop page

Page | 41
Orders page

About page

Page | 42
Contact page

Page | 43
CHAPTER 7

Technology has made significant progress over the years to provide consumers a better online
shopping experience and will continue to do so for years to come. With the rapid growth of products and
brands, people have speculated that online shopping will overtake in-store shopping. While this has been the
case in some areas, there is still demand for brick and mortar stores in market areas where the consumer feels
more comfortable seeing and touching the product being bought. However, the availability of online
shopping has produced a more educated consumer that can shop around with relative ease without having to
spend a large amount of time. In exchange, online shopping has opened up doors to many small retailers
that would never be in business if they had to incur the high cost of owning a brick and mortar store. At the
end, it has been a win-win situation for both consumer and sellers.

Page | 44
CHAPTER 8

Our designed online shopping system provides a 24×7 service, that is


customers can surf the website, place orders anytime they wish to. Also, the delivery system
works 24×7 hours a week. Some of the features that can be modified and added to this
system in the future involve its implementation by local shopkeepers, where shops will be
providing an online interface to customers for shopping and placing orders.
Then some delivery persons can perform their work. This will be adding on benefit for the
customers as it will save their time, plus it adds on for the shopkeepers also, as people will
continue to shop from local shops rather than preferring to supermarkets every time.
Also, since the deliveries from these local vendors will not be as time-consuming as these
days Flipkart, Amazon, etc. take but rather will be delivered the same day of an order placed.
Else the shopkeeper can ask the customer that the product will be available by the next day,
so if he/she still wants to place the order, it can be done.
Again, return or exchange will be easy since the delivery boy can even do it as the store is
nearby. Including a chatbox for public benefit is also a great idea via which people can
directly have a conversation with some officials regarding any type of queries.

Page | 45
CHAPTER 9

Book Reference

 Learning PHP, MySQL, JavaScript, CSS, and HTML

 Beginning PHP and MySQL: From Novice to Professional, W. Jason Gilmore,


Apress

 Murach's PHP and MySQL, Joel Murach, Mike Murach& Associates

 Dreamweaver 8 Bible, Joseph W. Lowery, Wiley

Website Reference

 www.w3schools.com/php/

 http://phpacademy.org/

 www.mysqltutorial.org/

Page | 46

You might also like