You are on page 1of 146

Online Grocery Shopping System

Mercearia

By

Chittadip Bag (544-1111-0369-18)


Indrani Dutta Gupta (544-1211-1609-18)
Maitrayee Majumdar (544-1211-0381-18)
Shreyasi Batabyal (544-1211-0377-18)
Sk Sarafad (544-1115-1645-18)

B.Sc.(Hons.) in Computer Science


UNIVERSITY OF CALCUTTA
2021

1|Page
Online Grocery Shopping System

The project titled “Mercearia”, submitted by

• Chittadip Bag (544-1111-0369-18)


• Indrani Dutta Gupta (544-1211-1609-18)
• Maitrayee Majumdar (544-1211-0381-18)
• Shreyasi Batabyal (544-1211-0377-18)
• Sk Sarafad (544-1115-1645-18)

Under the guidance of Prof. Amitava Biswas, Lecturer, Vivekananda


College, Thakurpukur.
This project thesis is submitted in partial fulfilment of the
requirement for the B.Sc. (Hons.) in Computer Science under
University of Calcutta.

Vivekananda College, 269, Diamond Harbour Road,


Thakurpukur, Kolkata – 700063

2|Page
CERTIFICATE

This is to certify that this Project entitled “Online Grocery Shopping System” is a
bonafide record of work done by

Mr. Chittadip Bag (Roll No: 183544-21-0056, Reg. No: 544-1111-0369-18)


Ms. Indrani Dutta Gupta (Roll No: 183544-11-0185, Reg. No: 544-1211-1609-18)
Ms. Maitrayee Majumdar (Roll No: 183544-11-0046, Reg. No: 544-1211-0381-18)
Ms. Shreyasi Batabyal (Roll No.: 183544-11-0042, Reg. No.: 544-1211-0377-18)
Mr. Sk Sarafad (Roll No: 183544-21-0227, Reg. No: 544-1115-1645-18)

Under my guidance and supervision and submitted in partial fulfilment of the


requirements for the award of Paper CC-13-P of 6th Semester B.Sc. (Hons.) Degree in
Computer Science Degree by the University of Calcutta. These candidates have
completed the total parameters and requirement of the entire project. I wish them
success in the future.

Prof. Amitava Biswas


(INTERNAL EXAMINER)

Prof. Samiran Panda


(EXTERNAL EXAMINER)

3|Page
ACKNOWLEDGEMENT

It is our prime duty to express our sincere gratitude to all those who have
helped us to complete this project successfully. We want to express our
respectful and sincere thanks to our respected and honourable project guide
Prof. Amitava Biswas, Department of Computer Science, Thakurpukur
Vivekananda College, for the valuable cooperation, guidance and continuous
support rendered by him throughout our project works, which helped us in
learning many new things. We are extremely thankful to our teachers for their
guidance and constant support rendered by him throughout our project works.
At last we would like to express our thanks and gratitude to Prof. Jhuma
Mazumder, Dept. Co-ordinator, along with other Dept. Teacher, staff and all
other classmates for giving needful advice and support for completion of this
project.

Prof. Jhuma Mazumder


(Dept. Co-ordinator)

Prof. Amitava Biswas


(Internal Examiner)

4|Page
CONTENTS

TOPICS PAGE NO.


1. ABSTRACT 8
2. INTRODUCTION 9
▪ Manual System 9
▪ Proposed System 9
▪ Domain Description 10
▪ Motivation 10
▪ Scope of the System 10

3. BACKGROUND AND REVIEW OF RELATED WORK 12


▪ Software Development Life Cycle 13
• SDLC Models 13
▪ Iterative Waterfall Model 13
• Applications 14
• Advantages 15
• Disadvantages 15
▪ Development Schedule 15
▪ Functional and Operational Requirements 16
• Feasibility Study 17
• Requirement Analysis and Specification 19
▪ Project Category 21
▪ Technology Used 22
• Introduction to MySQL 22
• Introduction to PHP 23
• Introduction to XAMPP 24
• Introduction to phpMyAdmin 25
• Introduction to HTML 26
• Introduction to CSS 27

5|Page
• Introduction to Bootstrap 28
• Introduction to JavaScript 29
• Software and Hardware Requirements 30

4. METHODOLOGY 31
▪ Design 32
• Output Design 32
• Input Design 33
• Design Considerations 34
• Database Design 36
• Entities 37
• Attributes 37
• Relationships 38
• Entity-Relationship Diagram 38
• Data Dictionary 39
• Normalization 42
▪ Data Flow Diagrams 43
• Level-0 Data Flow Diagram 43
• Level-1 Data Flow Diagram 44
• Level-2 Data Flow Diagram 45
▪ Activity Diagram 46
▪ Use Case Diagram 47

5. IMPLEMENTATION 48
▪ Coding and Output 49
▪ Testing 134
• Test Planning 135
• Correctness testing 136
• Black-box testing 136
• White-box testing 137
• Performance testing 138
• Reliability testing 139
• Security testing 140
▪ Maintenance 140
• Corrective Maintenance 140

6|Page
• Adaptive Maintenance 140
• Perfective Maintenance 140
• Process 141
• Models 141

6. RESULTS AND DISCUSSION 142


▪ Benefits of the System 142
▪ Limitations of the System 142

7. CONCLUSION 144
▪ Future Scope 144

8. REFERENCES 145

7|Page
ABSTRACT

The main objective of this project on Online Grocery Shopping System is to


build an application program that reduces the manual work for grocery
shopping and for managing the details about the customer, product, address,
order, stock, delivery, payment.
Nowadays e-commerce websites have become very convenient to purchase
products and services online. Online grocery shopping is a form of e-commerce
that enables vendors and consumers to directly buy fresh groceries over the
internet. Customers can purchase products through 24/7 service comfortably
and conveniently.

8|Page
INTRODUCTION

Internet access has vastly grown across the world today and has given rise to
interconnectivity, even to the remotest areas. Online grocery shopping is a
form of e-commerce that allows consumers to directly buy fresh groceries over
the internet. In reaching out to various customers over the internet, the
concept is aimed at penetrating a fraction of our population who are generally
pre-occupied with activities, which makes it impossible for them to step out of
their daily activities to purchase their needs.
Also due to the ongoing COVID-19 pandemic, it has become immensely difficult
for people to purchase items from crowded markets. So, shopping through the
Internet is very convenient in this situation.
Thus, this project is based on an online grocery shopping website providing
customers with online services of purchasing groceries.

Manual System
A manual grocery shopping system presents many inconveniences to the
customer satisfaction. Most markets are so crowded and disorganized that it is
hard for customers to locate the items they want. Besides this, sellers in the
market sell what they have in the market rather than sell what customers
actually want. This usually leaves customers unsatisfied with the products they
find. In manual grocery shopping system, a customer walks up to a market to
buy their needs and they are served by the seller and then the customer walks
away. The seller at this point has no record of the customer and this means no
way of getting feedback from the customer, which goes a long way to grow
business.

Proposed System
The grocery shopping website provides the solution to manual shopping
through online shopping for consumers and vendors. The website is proposed
to be an extension of the market to customers who find it difficult to arrive at
the markets which are located in busy business districts of most cities.
Moreover, during the ongoing COVID-19 pandemic, it has become difficult for
many customers to leave their homes and purchase items from the crowded
markets.

9|Page
The proposed system will provide vendor or administration functionality to
manage categories and products. A customer will be able to browse and search
products under different categories. Selected products or items will be added
into their virtual shopping cart which can be managed separately by the
customer. The customer can examine their cart for selected products, their
quantity, availability and price. After selecting the products to purchase from
the virtual cart, the customer is directed to the payment methods from which
they can choose one.

Domain Description
This project is based on an online grocery shopping website providing
customers with online services of ordering groceries. A customer needs to
create an account on the website by registering. A user can also change the
password of the account if they forget it. The customer can search for a
grocery item by its name in the search bar and buy that item by simply clicking
on an ‘Add To Cart’ button. The item will now be available in the ‘cart’. The
admin can add, edit and delete products from the database but a customer can
add products to and remove them from their personal ‘cart’ only.

Motivation
The motivation for doing this project was primarily making it easy for people to
avail products they need without having to step out of their homes and hop
from one shop to another in search for groceries during the ongoing COVID-19
pandemic, which has made it difficult for many people to do so. Customers are
finding it increasingly difficult to get groceries in the crowded markets when
they run of out of the items they already had in their homes, or when they
require new items for immediate use.
In light of the current situation, the demand for online shopping services has
increased rapidly, so an online grocery shopping website serves the right
purpose.

Scope of the System


One purpose of the online grocery market is to increase the profit margin of
business owners and conveniently grant access to products available in the
supermarket to potential customers. The scope of this system can be
categorized by the computerization of the following tasks:

10 | P a g e
• Product catalog: An organization of the products is made for clear
navigation of the website, which makes it easily accessible for all.
• Product attributes: Customers can log in on their accounts and search
for the products they wish to purchase. Product attributes are generally
accepted as product name, category, description, price, and image of the
product.
• Check out: The e-commerce checkout provides a way to take payment,
append relevant taxes (if necessary), compute the cost of transportation
and handling of products, provide a sub-total of the amount due, collect
billing and delivery information from the customer.
• Reporting and order tracking: There is a way to track the status of the
order through the fulfilment and delivery stages.

11 | P a g e
BACKGROUND AND REVIEW OF
RELATED WORK

12 | P a g e
Software Development Life Cycle
Software Development Life Cycle (SDLC) is a process followed for a software
project, within a software organization. It consists of a detailed plan describing
how to develop, maintain, replace and alter or enhance specific software. SDLC
defines a methodology for improving the quality of software and the overall
development process.
The traditional development methodology called Systems Development Life
Cycle (SDLC) consists of a set of development activities that have a prescribed
order. Once a problem for the existing Jaico Payroll System 2009 is recognized,
a request for developing a new system is forwarded for approval. If approved,
a study is conducted to ensure that the proposed System is feasible. If feasible,
the System Requirements are specified followed by phases of System design,
System implementation, Testing, Conversion and Evaluation. A recycling of
development activities may occur following System evaluation if System still
requires modification or redevelopment. The term “Development Cycle” is
used to acknowledge the importance of recycling in meeting information
needs.

SDLC Models

The following 5 Software Development Life Cycle (SDLC) models are used:
1. Waterfall Model
2. Prototyping Model
3. Incremental Model
4. Evolutionary Model
5. Spiral Model

Iterative Waterfall Model


We have used Iterative Waterfall Model for our project.
In this model, the software development activity is divided into different
phases, and each phase consists of series of tasks and has different objectives.
The output of one phase becomes the input of the next phase. Iterative
waterfall model provides feedback paths from every phase to its preceding
phase.

13 | P a g e
Once a defect is detected in any phase, engineers need to go back to the phase
where the defect has occurred and redo some of the work done during that
phase and subsequent phases to correct them and its effect on the later
phases.
There is a working model of the system at a very early stage of development,
which makes it easier to find functional or design flaws, thus enabling to take
corrective measures in a limited budget.
The diagrammatic representation of this model resembles a cascade of
waterfalls, thus justifying its name.
Diagrammatic Representation of Iterative Waterfall Model:

Application of Iterative Waterfall Model:


• Major requirements are defined but the minor details might involve as
time goes.
• New technologies are being used and there is a learning curve for the
programmers to learn.
• Resources are limited to do a huge project as if a small project
automates are in contact rather than permanent.
• There is a very high risk as a goal of the project might change from time
to time.
14 | P a g e
Advantages of using Iterative Waterfall Model:
• This model allows the mechanism of error connection because there is a
feedback path from one phase to its preceding phase.
• This model is simple to understand and use. It is the most widely used
software development model evolved so far.
• Parallel development can be done.
Disadvantages of using Iterative Waterfall Model:
• Sometimes customer requirement changes after development phase
starts, and it is difficult to incorporate the requests made for change.
• Project is prone to many types of risks but there is no risk handling
mechanism.
• This model is not suitable for a small project.

Development Schedule

Development schedule is one of the important parts of the planning, there are
different ways of making development here we used Gantt chart for
development schedule. The development schedule must be independent as
possible. Ideally the components should be stand-alone so that it does not
need any other component to operate. This is only possible for every simple
component and more complex component is inevitably having some
dependencies on other component. The schedule gives the time estimation of
the project. In the project or development of software there are different
phases like study, design, implementation and test. Our project also has
different phases and each phase takes different time for development.

Our project starts on 5th May 2021 and ends on 25th July 2021. The total time
taken by our project is 82 days. The project consists of different phases like
analysis, design, implementation and testing.

15 | P a g e
5th May – 20th May
Analysis

21st May – 15th June


Design
P
H 16th June – 10th July
A
Implementation
S
E
S 11th July – 15th July
Testing

16th July – 25th July


Deployment

TIME

Fig: Gantt chart

Total Project time: 82 days

Analysis – 5th May to 20th May (16 days)


Design – 21st May to 15th June (26 days)
Implementation – 16th June to 10th July (25 days)
Testing – 11th July to 15th July (5 days)
Deployment – 16th July to 25th July (10 days)

Functional and Operational Requirements


Requirement analysis is performed by the senior members of the team with
inputs from the customer, the sales department, market surveys and domain
experts in the industry. Information regarding what kind of input is required
and what output is expected is collected during this stage, and is then used to

16 | P a g e
plan the basic project approach and to conduct product feasibility study in the
economical, operational and technical areas. Planning for the quality assurance
requirements and identification of the risks associated with the project is also
done.
The first step in the system development life cycle is the preliminary
investigation to determine the feasibility of the system. The purpose of the
preliminary investigation is to evaluate the project request. It is neither a
design study nor does it include the collection of details to describe the system
in all respect. Rather it is collection of information that helps the maker to
evaluate the merits of the project requests and make an informed judgment
about the proposed project. The report analyses accomplish the following
objective:

• Clarifying and determining the project request.


• Determining the size of the project.
• Accessing costs and benefits of alternatives approaches.
• Reports of the finding to the organization, with recommendations
outlining the acceptance of the proposal.

Reviewing Organization document: In this, the investigation is made about the


organization involved in, or affected by the project. So the present activities
are studied in order to develop a fully automated system. For this, feasibility
study is done.

Feasibility Study
Feasibility Study is an analysis that takes all of the project factors into account
– including Operational, Technical, Economic and Time Feasibility studies to
ascertain the likelihood of completing the project successfully.

Operational Feasibility

Proposed project is beneficial only if it can be turned into information systems


that will meet the operating requirements of the organization. This feasibility
asks if the system will work when it is developed and installed. So, in this
project we tested the operational feasibility by determining:

• Whether there is sufficient support for the project from the


organization.

17 | P a g e
• Is the current system being acceptable by them?
• Will the proposed system cause harm?
• Will customers be satisfied with the quality of the products delivered?
• Will suppliers always be able to supply products on time?
• Will the supply of products be enough according to customers’
demands?

Technical Feasibility

There are number of technical issues which are generally raised during the
technical feasibility. They are determined as follows:

• Does the necessary technology assist to do what is suggested?


• Will the system be easily accessible?
• Can customers easily find the product they want to buy?
• How easy is the process of purchase of a product?
• Can the system be upgraded once developed?
• Security of the system.
• Regular updating of the system.

Economic Feasibility

A system that can be developed technically and that will be used if installed
must still be profitable for the organization. The first purpose of this effort is to
financially model the venture opportunity and achieve a break-even analysis.
These scenarios will be critical in strategic planning, milestone development
and venture valuation analysis. Financial benefits must equal or exceed the
costs. The analysis raises various financial questions during the investigation to
estimate the following:

• The cost of conduct, a full system investigation.


• The cost of hardware and software for the application being used.
• The benefits in the form of cost or fewer costly errors.
• The cost if nothing changes.

To be judged feasible, a proposal for the specific project must pass all these
tests. Otherwise it is not considered as economically feasible. In general,
requests that do not pass all the feasibility tests are not persuaded further,
unless they are modified and resubmitted as new proposals.

18 | P a g e
Time Feasibility

The required systems development was expected to be successfully completed


within the stipulated time, as the constraints of time placed on the process
was of crucial importance. Thus it can be finally concluded that the proposed
project fulfilled all feasibility requirements, the implementation of the project
was progressed with. Thus everything has been done while taking time into
consideration.

Requirement Analysis and Specification

The requirement analysis and specification phase starts once feasibility study
phase is complete and the project is found to be financially sound and
technically feasible. The goal of this phase is to clearly understand the
customer requirements and to systematically organize these requirements in a
specification document. This phase consists of the following two activities:

1) Requirement gathering and analysis:

System analysts (who gather and analyse customer requirements and write the
requirements specification document as SRS) collect data pertaining to the
product to be developed and analyse these data to conceptualize what exactly
needs to be done. Once the system analyst understands the precise user
requirements, he analyses the requirements to weed out inconsistencies,
anomalies and incompleteness. Then he writes the software requirement
specification (SRS) document. SRS is the final output of Requirement analysis
and Specification phase.

a) Requirement gathering: This activity typically involves interviewing the end-


users and customers and studying the existing documents to collect all the
possible information regarding the system.

b) Analysis of gathered requirement: The main purpose of this activity is to


clearly understand the exact requirements of the customer. The following
basic questions should be answered to obtain a good grasp of the problem:
• What is the problem?
• Why is it important to solve the problem?
• What are the possible solutions to the problem?

19 | P a g e
• What exactly the data input and data output of the system?
• What is the likely complexity to arise during the system development?
• What exactly the data interchange with the external interface?

2) Requirements Specification:

The Software Requirement Specification (SRS) document is the basis for all
future development activities what the software will do and how it will be
expected to perform and also serves as a contract document between the
customer and the development organization.

Reasons for using SRS:

• It describes how a software system should be developed to meet the


actual needs, that is most important for both the users/customers as
well as developers.
• It provides everyone involved with a road map for the project
• It creates the basis for all documentation well enough to write the users
manuals also.
• It helps to understand the product
• It sets communication on the right track and grows development
standard.
• It helps to cover the risks in all development stages.
• The SRS can be used as a legal document to settle disputes between
customers and developers.
Qualities of SRS:

• Correct: SRS should be correct and concise.


• Unambiguous: The interpretations of the requirements should be
unambiguous.
• Complete: It should be complete and relevant that reduce the error
possibilities.
• Consistent: The specified requirements should not contradict another.
• Ranked for importance and/or stability: The requirements should be
specified and developed according to the priority basis.
• Structured: It should be well structured that is easy to understand.
• Verifiable: It should be possible to determine whether or not
requirements have been met in an implementation.

20 | P a g e
• Modifiable: It should be modifiable as SRS document undergoes several
revisions to cope with the customer requirements.
• Tracible: Each functional requirement should be unique and consistent.
It would be possible to tell
• which design component corresponds to which requirement and which
code corresponds to which design component and so on.
• Black-box view: It should view the system to be developed as a black-box
and should specify the externally visible behavior of the system. It
should consider conceptual integrity so that users can easily trace the
contents.

The important parts of the SRS document are:

• Functional Requirements: It should discuss the functionalities required


from the system. Each function ‘f’ of the system can be considered as a
transformation of a set of input data ‘i’ to the corresponding set of
output data ‘o’. This functional requirements should clearly describe
each function which the system would support along with the
corresponding input data items and the output data set.

• Non-functional Requirements: The non-functional requirements deal


with the characteristics of the system that cannot be expressed as
functions. It includes aspects concerning maintainability, portability and
usability, reliability issues, accuracy of result, human-computer interface
issues etc.

• Goals of implementation: This section includes document issues such as


revisions to the system functionalities that may be required in the future
,new devices to be supported in the future, reusability issues, etc.
Qualitative aspects whose compliance by the developed system need
not be verified but are merely included as suggestions to the developers
are documented as goals of the implementations.

Project Category
It is a standalone machine software or automation system, which means it runs
on local machine or local server through LAN. Data are maintained in a
database stored in the server machine. The tables of the database are
interlinked. Database operations like data insertion, deletion, modification,

21 | P a g e
etc. are performed, and the relations are stored in tables. So, we can say, that
this is also an RDBMS.

Why RDBMS?

RDBMS approach is used for developing this project because it provides the
minimum scope of data redundancy. Data redundancy may sometimes affect
the efficiency of the whole system. An important advantage of RDBMS is that a
single database can be spread across several tables. This differs from flat-file
databases, where each database is self-contained in a single table. Other
advantages are:

• Better techniques for data storage


• Less data retrieval time
• Better space management
• Scope of creating logical relationships among entities

Why Automated System?

An automated system is a system that is used to reduce the need for human
work in the production of goods and services. They include washing machines,
calculators, dryers, and computers. They increase productivity and the quality
of the goods produced. Automated system is secure and fully dedicated to
fulfill the needs of an organization.

Technology Used

Introduction to MySQL

MySQL is an open-source relational database management system (RDBMS).


Its name is a combination of "My", the name of co-founder Michael Widenius's
daughter, and "SQL", the abbreviation for Structured Query Language. A
relational database organizes data into one or more data tables in which data
types may be related to each other; these relations help structure the data.
SQL is a language programmers use to create, modify and extract data from
the relational database, as well as control user access to the database. In
addition to relational databases and SQL, an RDBMS like MySQL works with an
operating system to implement a relational database in a computer's storage

22 | P a g e
system, manages users, allows for network access and facilitates testing
database integrity and creation of backups.

MySQL is free and open-source software under the terms of the GNU General
Public License, and is also available under a variety of proprietary licenses.
MySQL was owned and sponsored by the Swedish company MySQL AB, which
was bought by Sun Microsystems (now Oracle Corporation). In 2010, when
Oracle acquired Sun, Widenius forked the open-source MySQL project to
create MariaDB.

MySQL has stand-alone clients that allow users to interact directly with a
MySQL database using SQL, but more often, MySQL is used with other
programs to implement applications that need relational database capability.
MySQL is a component of the LAMP web application software stack (and
others).

Introduction to PHP

PHP is a general-purpose scripting language geared towards web development.


It was originally created by Danish-Canadian programmer Rasmus Lerdorf in
1994. The PHP reference implementation is now produced by The PHP Group.
PHP originally stood for Personal Home Page, but it now stands for the
recursive initialism PHP: Hypertext Preprocessor.

PHP code is usually processed on a web server by a PHP interpreter


implemented as a module, a daemon or as a Common Gateway Interface (CGI)
executable. On a web server, the result of the interpreted and executed PHP
code – which may be any type of data, such as generated HTML or binary
image data – would form the whole or part of an HTTP response. Various web
template systems, web content management systems, and web frameworks
exist which can be employed to orchestrate or facilitate the generation of that
response. Additionally, PHP can be used for many programming tasks outside
of the web context, such as standalone graphical applications and robotic
drone control. PHP code can also be directly executed from the command line.

PHP files can contain text, HTML, CSS, JavaScript, and PHP code. PHP code are
executed on the server, and the result is returned to the browser as plain
HTML. PHP files have extension “.php”.

PHP can generate dynamic page content. PHP can create, open, read, write,
delete, and close files on the server. PHP can collect form data. PHP can send

23 | P a g e
and receive cookies. PHP can add, delete, modify data in a database. PHP can
be used to control user-access. PHP can encrypt data. With PHP one is not
limited to output HTML. One can output images, PDF files, Flash movies, and
any text, such as XHTML and XML.

Why PHP?

PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.). It is


compatible with almost all servers used today (Apache, IIS, etc.). It supports a
wide range of databases. PHP is free, easy to learn and runs efficiently on the
server side.

Introduction to 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. Since most actual web server deployments use
the same components as XAMPP, it makes transitioning from a local test server
to a live server possible. XAMPP's ease of deployment means a WAMP or
LAMP stack can be installed quickly and simply on an operating system by a
developer.

XAMPP is regularly updated to the latest releases of Apache, MariaDB, PHP and
Perl. It also comes with a number of other modules including OpenSSL,
phpMyAdmin, MediaWiki, Joomla, WordPress and more. Self-contained,
multiple instances of XAMPP can exist on a single computer, and any given
instance can be copied from one computer to another. XAMPP is offered in
both a full and a standard version.

The most obvious characteristic of XAMPP is the ease at which a WAMP


webserver stack can be deployed and instantiated. XAMPP also provides
support for creating and manipulating databases in MariaDB and SQLite among
others. Once XAMPP is installed, it is possible to treat a localhost like a remote
host by connecting using an FTP client. Using a program like FileZilla has many
advantages when installing a content management system (CMS). It is also
possible to connect to localhost via FTP with an HTML editor.

Introduction to phpMyAdmin

24 | P a g e
phpMyAdmin is a free and open source administration tool for MySQL and
MariaDB. As a portable web application written primarily in PHP, it has become
one of the most popular MySQL administration tools, especially for web
hosting services.

Tobias Ratschiller, then an IT consultant and later founder of the software


company Maguma, started to work on a PHP-based web front-end to MySQL in
1998, inspired by MySQL-Webadmin. He gave up the project in 2000 because
of lack of time.

By that time, phpMyAdmin had already become one of the most popular PHP
applications and MySQL administration tools, with a large community of users
and contributors. In order to coordinate the growing number of patches, a
group of three developers (Olivier Müller, Marc Delisle and Loïc Chapeaux)
registered The phpMyAdmin Project at SourceForge and took over the
development in 2001.

In July 2015, the main website and the downloads left SourceForge and moved
to a content delivery network. At the same time, the releases began to be
PGP-signed. Afterwards, issue tracking moved to GitHub and the mailing lists
migrated. Before version 4, which uses Ajax extensively to enhance usability,
the software used HTML frames.

Features provided by phpMyAdmin include:

• Web interface
• MySQL and MariaDB database management
• Import data from CSV, JSON and SQL
• Export data to various formats: CSV, SQL, XML, JSON, PDF (via the TCPDF
library), ISO/IEC 26300 - OpenDocument Text and Spreadsheet, Word,
Excel, LaTeX, SQL, and others
• Administering multiple servers
• Creating PDF graphics of the database layout
• Creating complex queries using query-by-example (QBE)
• Searching globally in a database or a subset of it
• Transforming stored data into any format using a set of predefined
functions, like displaying BLOB-data as image or download-link
• Live charts to monitor MySQL server activity like connections, processes,
CPU/memory usage, etc.
• Network traffic to the SQL server

25 | P a g e
• Working with different operating systems like Windows*, Linux*, OS/2,
Free BSD* Unix* ( such as Sun* Solaris* , AIX) and others.
• Make complex SQL queries easier.

Introduction to HTML
The HyperText Markup Language, or HTML is the standard markup language
for documents designed to be displayed in a web browser. It can be assisted by
technologies such as Cascading Style Sheets (CSS) and scripting languages such
as JavaScript.

Web browsers receive HTML documents from a web server or from local
storage and render the documents into multimedia web pages. HTML
describes the structure of a web page semantically and originally included cues
for the appearance of the document.

Filename extension: .html, .htm

Internet media type: text/html

Type code: TEXT

Uniform Type Identifier (UTI): public.html

Developed by: WHATWG

Initial release: 1993

Latest release: Living Standard (2021)

Type of format: Document file format

Container for: HTML elements

Contained by: Web browser

Extended from: SGML

Extended to: XHTML

HTML elements are the building blocks of HTML pages. With HTML constructs,
images and other objects such as interactive forms may be embedded into the
rendered page. HTML provides a means to create structured documents by

26 | P a g e
denoting structural semantics for text such as headings, paragraphs, lists, links,
quotes and other items. HTML elements are delineated by tags, written using
angle brackets. Tags such as <img> and <input> directly introduce content into
the page. Other tags such as <p> surround and provide information about
document text and may include other tags as sub-elements. Browsers do not
display the HTML tags, but use them to interpret the content of the page.

HTML can embed programs written in a scripting language such as JavaScript,


which affects the behaviour and content of web pages. Inclusion of CSS defines
the look and layout of content. The World Wide Web Consortium (W3C),
former maintainer of the HTML and current maintainer of the CSS standards,
has encouraged the use of CSS over explicit presentational HTML since 1997.

Introduction to CSS
Cascading Style Sheets (CSS) is a style sheet language used for describing the
presentation of a document written in a markup language such as HTML. CSS is
a cornerstone technology of the World Wide Web, alongside HTML and
JavaScript.

Filename extension: .css

Internet media type: text/css

Type code: TEXT

Uniform Type Identifier (UTI): public.css

Developed by: World Wide Web Consortium (W3C)

Initial release: December 17, 1996

Latest release: CSS 2.1 : Level 2 Revision 1 (April 12, 2016)

Type of format: Style sheet language

Container for: Style rules for HTML elements (tags)

Contained by: HTML documents

Each web browser uses a layout engine to render web pages, and support for
CSS functionality is not consistent between them. Because browsers do not
parse CSS perfectly, multiple coding techniques have been developed to target
27 | P a g e
specific browsers with workarounds (commonly known as CSS hacks or CSS
filters). Adoption of new functionality in CSS can be hindered by lack of support
in major browsers. For example, Internet Explorer was slow to add support for
many CSS 3 features, which slowed adoption of those features and damaged
the browser's reputation among developers. In order to ensure a consistent
experience for their users, web developers often test their sites across multiple
operating systems, browsers, and browser versions, increasing development
time and complexity. Tools such as BrowserStack have been built to reduce the
complexity of maintaining these environments.

Advantages of CSS:

• Site-wide consistency: When CSS is used effectively, in terms of


inheritance and "cascading," a global style sheet can be used to affect
and style elements site-wide. If the situation arises that the styling of the
elements should need to be changed or adjusted, these changes can be
made by editing rules in the global style sheet. Before CSS, this sort of
maintenance was more difficult, expensive and time-consuming.
• Bandwidth: A stylesheet, whether internal to the source document or
separate, will specify the style once for a range of HTML elements
selected by class, type or relationship to others. This is much more
efficient than repeating style information inline for each occurrence of
the element. An external stylesheet is usually stored in the browser
cache, and can therefore be used on multiple pages without being
reloaded, further reducing data transfer over a network.
• Page reformatting: With a simple change of one line, a different style
sheet can be used for the same page. This has advantages for
accessibility, as well as providing the ability to tailor a page or site to
different target devices. Furthermore, devices not able to understand
the styling still display the content.

Introduction to Bootstrap
Bootstrap is a free and open-source CSS framework directed at responsive,
mobile-first front-end web development. It contains CSS-based and (optionally)
JavaScript-based design templates for typography, forms, buttons, navigation,
and other interface components.

Original author(s): Mark Otto, Jacob Thornton

Developer(s): Bootstrap Core Team

28 | P a g e
Initial release: August 19, 2011

Repository: Bootstrap Repository

Written in: HTML, CSS, JavaScript

Platform: Web platform

As of April 2021, Bootstrap is the tenth most starred project on Github, with
more than 150,000 stars. Bootstrap is an HTML, CSS & JavaScript Library that
focuses on simplifying the development of informative web pages (as opposed
to web apps). The primary purpose of adding it to a web project is to apply
Bootstrap's choices of colour, size, font and layout to that project. As such, the
primary factor is whether the developers in charge find those choices to their
liking. Once added to a project, Bootstrap provides basic style definitions for all
HTML elements. The result is a uniform appearance for prose, tables and form
elements across web browsers. In addition, developers can take advantage of
CSS classes defined in Bootstrap to further customize the appearance of their
contents. For example, Bootstrap has provisioned for light-coloured and dark-
coloured tables, page headings, more prominent pull quotes, and text with a
highlight.

The most prominent components of Bootstrap are its layout components, as


they affect an entire web page. The basic layout component is called
"Container", as every other element in the page is placed in it. Developers can
choose between a fixed-width container and a fluid-width container. While the
latter always fills the width of the web page, the former uses one of the five
predefined fixed widths, depending on the size of the screen showing the page
smaller than 576 pixels, 576–768 pixels, 768–992 pixels, 992–1200 pixels or
larger than 1200 pixels. Once a container is in place, other Bootstrap layout
components implement a CSS Flexbox layout through defining rows and
columns.

Introduction to JavaScript
JavaScript often abbreviated as JS, is a programming language that conforms to
the ECMAScript specification. JavaScript is high-level, often just-in-time
compiled, and multi-paradigm. It has curly-bracket syntax, dynamic typing,
prototype-based object-orientation, and first-class functions.

Paradigm: event-driven, functional, imperative

29 | P a g e
Designed by: Brendan Eich of Netscape initially; others have also contributed
to the ECMAScript standard

First appeared: December 4, 1995


Filename extensions: .js , .cjs , .mjs

As a multi-paradigm language, JavaScript supports event-driven, functional,


and imperative programming styles. It has application programming interfaces
(APIs) for working with text, dates, regular expressions, standard data
structures, and the Document Object Model (DOM). JavaScript engines were
originally used only in web browsers, but they are now core components of
other software systems, most notably servers and a variety of applications.

Software and Hardware Requirements


Software used:
Platform: Windows 10, Linux
Web Server: XAMPP
Database Connectivity: PHP, MySQL

Hardware used:
Processor: Intel Core i3-1005G1, up to 1.19 GHz
RAM: 8 GB
Hard Disk Drive: 1 TB
Keyboard
Mouse
Monitor

30 | P a g e
METHODOLOGY

31 | P a g e
Design

The most challenging phase of the system life cycle is system design. The term
design describes a final system and the process by which it is developed. It
refers to the technical specifications that will be applied in implementing the
candidate system. It also includes the construction of programs and program
testing. System design is a solution, a “how to” approach the creation of a new
system. This important phase is composed of several steps. It provides
understanding and procedural details necessary for implementing the system
recommended in the feasibility study. Emphasis is on translating the
performance requirements into design specifications. The first step is to
determine how the output is to be produced and int what format. Samples of
the output and input are also presented. Second, input data and master files
(database) have to be designed to meet the requirements of the proposed
output. The operational (processing) phases are handled through program
construction and testing, including a list of programs needed to meet the
systems objectives and to complete documentation. Finally, details related to
justification of the system and an estimate of the impact of the candidate
system on the user and the organization are documented and evaluated by
management as a step toward implementation. The basic steps in designing
are:

▪ Output Design

▪ Input Design

▪ Data Design

▪ Process Design

Output Design
Computer output is the most important and direct source of information to the
user. Efficient, intelligible output design should improve the system’s
relationships with the user and help in decision making. A major form of
output is hard copy from the printer. Output from computer system is required
to communicate the result of processing to users. Designing computer output
should process in an organized, well thought out manner. The right output
must be developed while ensuring that each output element is designed so

32 | P a g e
that the user will find the system easy to use effectively. The term ‘output’
applies to any information by an information system, whether printed or
displayed. While designing computer outputs, the following steps have to be
followed.
In addition to deciding on the output device, the systems analyst must
consider the print format and the editing for the final printout. The task of
output preparation is critical, requiring skill and ability to align user
requirements with the capabilities of the system in operation. The design
considerations we have followed while designing output are:

▪ Name or title.

▪ Space and arrangement

▪ Headers and footers.

In online applications, the layout sheet for displayed output is similar to the
layout chart used for designing input. In these cases, the output forms are
similar to the input forms. Other type of applications output forms like reports
used to make decisions must be designed carefully. The following layout
describes our report designing.

Input Design
Inaccurate input data are the most common cause of errors in data processing.
Errors entered by data entry operators can be controlled by input design. Input
design is the process of converting user-originated inputs to a computer-based
format. In the system design phase, the expanded data flow diagram identifies
logical data flows, data stores, sources and destinations. A system flowchart
specifies master files (database), transaction files and computer programs.
Input Media
In this project, earlier stages identified the data that is input to the
transactions. The next step is what media should be used for the input. Since
this is an online data entry project, we need computer based online forms as
the media for input entry. There are three approaches for data entry with
forms: menu based formatted forms, and prompts. We adopted the formatted
form approach for entering data. A formatted form is a pre-printed form or a
template that requests the user to enter data in appropriate locations. It is a
fill-in-blank type. The form is flashed on the screen as a unit. The cursor is
33 | P a g e
usually positioned at the first blank. After the user responds by filling in the
appropriate information, the cursor automatically moves to the next line, and
so on until the form is completed.
Form Types
There are three types of forms classified by what it does in the system. They
are: action forms – to perform some action such as storing, modifying, and
deleting data, memory forms – to perform extraction and display operations
on existing historical data, and report forms – to generate decision support
data from existing records. We used reports as output forms. As an input
media we used both action and memory forms in combination.
Form Layout
When form is designed, a list is prepared of all the items to be included on the
form and the maximum space to be reserved. The form user has to make sure
that it has the required details which should check the list.

▪ Title

▪ Data Zoning

▪ Rules and Captions

Design Considerations
In designing these forms, we have taken care several attributes that are
mentioned below:
▪ Identification and wording.

- Form titles and labels.

▪ Maximum readability and use.

- Legible, intelligible, uncomplicated, and space.

▪ Physical factors.

- Composition, color, layout.

▪ Order of data items.

34 | P a g e
- Logical sequence, data relation.

▪ Ease of data entry.

- Field positions.

▪ Size and arrangement.

- Size, storing, filing, and space for signs.

▪ Use of instructions.

- Online help for data entry, status info.

The following diagram describes the sample form layout we used to design
forms in our project.

Form Title

Data Zone
Record
Navigation

Action Commands

Online Help

35 | P a g e
Database design

Database design is the process of developing database structures to hold data


to cater to user requirements. The final design must satisfy user needs in terms
of completeness, integrity, performance and other factors. For a large
enterprise, the database design will turn out to be an extremely complex task
leaving a lot to the skill and experience of the designer. A number of tools and
techniques, including computer-assisted techniques, are available to facilitate
database design. The primary input to the database design process is the
organizations’ statement of requirements. Poor definition of these
requirements is a major cause of poor database design, resulting in databases
of limited scope and utilities which are unable to adapt to changes.
The major step in database design is to identify the entities and
relationships that reflect the organizations’ data, naturally. The objective of
this step is to specify conceptual structure of the data and is often referred to
as data modelling. There are several methodologies to model the data
logically. We adopted E-R modelling as our data modelling technique. E-R
model is a technique for analysis and logical modelling of systems data
requirements. It uses three basic concepts: entities, attributes and relations.
Entity:

Entity is a distinguishable object. These entities are classified into regular


entities and weak entities. A weak entity is an entity that is existence
dependent on some other entity i.e., it does not exist if that other entity does
not exist. A regular entity is an entity that is not weak. The graphical notation
of entity is shown below:

Regular Entity Weak Entity

Attribute:

Entities have properties known as attributes. All entities of a given type have
certain kinds of properties in common. Each kind of property draws its value
from a corresponding value set. Properties can be of various types: Simple or
composite, key, single or multi, missing, and base or derived. Attributes are
graphically represented as shown below:

36 | P a g e
Attribute

Relationship:

Relationship defines an association among entities. The entities involved in a


given relationship are said to be participants in that relationship. The number
of participants in a given relationship is called the degree of that relationship.
An ER relationship can be one – one, one – many, and many - many.
Cardinality of a relationship refers to representing the number of occurrences
of entities in a given relationship. The graphical notation of relation is
represented as shown below:

Relationship

In our project we have identified entities, attributes for those entities, and
relationships between those entities from data collected at analysis phase.
These are listed below:

Entities:

▪ Admin
▪ Suppliers
▪ Registered Users
▪ Products
▪ Categories
▪ Cart
▪ Payment
▪ Shipment
▪ Purchase History
▪ Reviews

Attributes:
37 | P a g e
Entities Attributes
Admin ID,Name,Email_ID,Phone_no,Password,Status,Image
Suppliers ID,Name,Email_ID,Phone_no,Password,Status,Image
Registered ID,Name,Email_ID,Phone_no,Password,Status,Image
Users
Products ID,Name,Cat_ID,Description,Price,Suppliers_ID,Status,Image,
CreatedAt,UpdatedAt
Categories ID,Name,Status
Cart ID,RegUser_ID,Products_ID,Quantity
Payment ID,RegUser_ID,Pay_amt,Pay_date,Pay_desc
Shipment ID,RegUser_ID,Address
Purchase ID,RegUser_ID,Products_ID, Status,PurchasedOn
History
Reviews ID,Name,Email_ID,Phone_no,Comment

Relationships:
▪ Admin Manages Suppliers
▪ Admin Manages Registered Users
▪ Suppliers Supply Products
▪ Registered Users Can search for Products
▪ Products Are divided into Categories
▪ Products Are added to Cart
▪ Cart Proceeds to Payment
▪ Payment Proceeds to Shipment
▪ Registered Users Have Purchase History
▪ Registered Users Can give Reviews

Entity-Relationship Diagram:
Entity-relationship (E-R) diagram is the detailed logical representation of data
for an organization. It is the data-oriented model of a system. It shows entities,
their attributes and the relationships between them.

The E-R diagram of our online grocery shopping system is as follows:

38 | P a g e
Data dictionary

A data dictionary is a catalogue – a repository – of the elements in a system. As


the name suggests, these elements center around data the way they are
structured to meet user requirements and organization needs. In a data
dictionary, one will find a list of the elements composing the data flow through
a system.

Table Name: Registered Users


Description: This data structure defines the Registered Users details.
online_grocery_sto customers 335e4b747f677e29 table

Name Type Null Key

39 | P a g e
ID int(11) Not Null Primary key

Name varchar(255)

Email_ID varchar(100)

Password varchar(100)

Phone_no bigint(10)

Image varchar(255)

Status varchar(10)

Table Name: Suppliers


Description: This data structure defines the Suppliers details.

Name Type Null Key


ID int(11) Not Null Primary key

Name varchar(255)

Email_ID varchar(100)

Password varchar(100)

Phone_no bigint(10)

Image varchar(255)

Status varchar(10)

Table Name: Products


Description: This data structure defines the Products details.
online_grocery_sto customers 335e4b747f677e29 table

40 | P a g e
Name Type Null Key
ID int(11) Not Null Primary key

Cat_ID int(50) Not Null Foreign Key

Name varchar(255)

Description varchar(255)

Price int(20)

Image varchar(255)

Suppliers_ID int(11) Not Null Foreign key

CreatedAt date
UpdatedAt date
Status varchar(10)

Table Name: Categories


Description: This data structure defines the Categories details.
online_grocery_sto customers 335e4b747f677e29 table

Name Type Null Key


ID int(155) Not Null Primary key

Name varchar(155)

Status varchar(155)

Table Name: Cart


Description: This data structure defines the Cart details.
online_grocery_sto customers 335e4b747f677e29 table

41 | P a g e
Name Type Null Key
ID int(11) Not Null Primary key

RegUser_ID int(11) Not Null Foreign key

Products_ID int(11) Not Null Foreign key

Quantity int(11)

Table Name: Purchased History


Description: This data structure defines the details of the previous purchases.
online_grocery_sto customers 335e4b747f677e29 table

Name Type Null Key


ID int(11) Not Null Primary key

RegUser_ID int(11) Not Null Foreign key

Products_ID int(11) Not Null Foreign key

PurchasedOn date
Status varchar(40)

Normalization
Normalization is the process of refining the data model built by the ER
diagram. The normalization technique, logically groups the data over the
number of tables, with minimum redundancy of data. The entities or tables
resulting from normalization contain data items, with relationships being
represented by replication of key data items.
The goal of relational database design is to generate a set of relation
schemes that allow us to store information with minimum redundancy of data
and allow us to retrieve information easily and efficiently. The approach
followed is to design schemas that are in an appropriate form one of the so-
called normal form.

42 | P a g e
The first step towards normalization is to convert the ER model into
tables or relations. The next step is to examine the database for redundancy
and if necessary, change them to non-redundant forms. This non-redundant
model is then converted into a database definition, which achieves the
objective of the database design phase. We defined database from the above
ER model by normalizing it to 3rd normal form. We will show the definitions of
those database tables later at the time of physical database design phase.

Data Flow Diagram


A data flow diagram (DFD) is a graphic tool used to describe and analyse the
movement of data through a system - manual or automated – including the
processes, stores of data, and delays in the system. Data flow diagrams are the
central tools and the basis from which other components are developed. The
transformation of data from input to output, through processes, may be
described logically and independently of the physical components associated
with the system.

The Data Flow Diagrams of our project are as follows:

43 | P a g e
44 | P a g e
45 | P a g e
Activity Diagram:
Activity diagram is basically a flowchart to represent the flow from one activity
to another. The activity can be described as an operation of the system. The
control flow is drawn from one operation to another. This flow can be
sequential, branched, or concurrent.

The activity diagram for our system is as follows:

46 | P a g e
Use Case Diagram:
A use case diagram is a graphical depiction of a user's possible interactions
with a system, showing various use cases and different types of users the
system has. The use cases are represented by circles or ellipses.
The Use Case Diagram of our project is as follows:

47 | P a g e
IMPLEMENTATION

48 | P a g e
Coding and Output

Homepage :-
Source code:-
<html>
<head>
<title>MERCERIA</title>
<style>
body {
background-color: powderblue;
}
div.header {
padding: 10px;
text-align: center;
color: mediumblue;
//background-color: green;
font-size: 20px;
font-family: Times New Roman;
}
#SearchProductName{
width: 80px; height: 25px;
<!--,width:10em,height:2em,-->
}
input {
font-family: Arial;
font-size: 15px;
49 | P a g e
}
input[type=submit] {
background-color: mediumblue;
color: white;
align-content: center;
width: 20em; height: 2em;
}
table, th, td {
font-family: Arial;
border: 1px;
color: white;
text-align: center;
font-size: 15px;
}
div.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
text-align: left;
}
div.transbox {
margin: 30px;
background-color: #ffffff;
border: 1px solid black;
opacity: 0.8;

50 | P a g e
text-align: left;
}
div.transbox p {
margin: 1%;
font-size: 20px;
color: #000000;
}
</style>
</head>
<body>
<div class="header">
<h1>HOME</h1>
</div>
<form action="homepage.php" method="post">
<!--Search button-->
<br><br>
<input type="text" size="50" name="valueToSearch"
placeholder="Search products here by name">
<input type="submit" id="SearchProductName" name="search"
value="Search">
</form>
<p style="text-align: right;font-family: Arial;color: mediumblue;
margin-right:3%; ">Click here to login as customer || Click here to login as
supplier</p>
<?php
include('config.php');
if(isset($_POST['search']))

51 | P a g e
{
$item=strtolower($_POST['valueToSearch']);

$sql="SELECT `products`.* FROM `products` WHERE


`products`.`Name`='$item'";
$result=mysqli_query($dbcon,$sql);
?>
<table width="80%" border="1" cellspacing="2" cellpadding="5"
align="center">
<tr>
<td align="center"
style="color:blue;"><strong><u>Name</strong></td>
<td align="center"
style="color:blue;"><strong><u>Description</strong></td>
<td align="center"
style="color:blue;"><strong><u>Price</strong></td>
<td align="center"
style="color:blue;"><strong><u>Image</strong></td>
<td align="center"
style="color:blue;"><strong><u>Status</strong></td>
</tr>

<?php
session_start();

if (mysqli_num_rows($result)>0)
{
while($row=mysqli_fetch_array($result))

52 | P a g e
{
?> <tr>
<!--<td><?php //echo $r['ID']; ?></th> --
>
<td><?php echo $row['Name']; ?></td>
<td><?php echo $row['Description'];
?></td>
<td><?php echo $row['Price']; ?></td>
<td>
<div class="container main">
<div class="img-block">
<img
class="img-responsive" src="<?php echo $row['Image'];?>" alt="Card Image
Caption" width="50" height ="50" >
</div>
</div>
</td>
<td><?php echo $row['Status']; ?></td>
<?php }
}
else
echo '<tr><td align="center" colspan="5" style="color:red;">No
Record Found</td></tr>' ;
}
?>
<br><br>
<form name="homepage.php" method="post" action="homepage.php">
<table width=100%>

53 | P a g e
<tr><th colspan="5" style="background-color: slategray; width: 25em; height:
2em;">Categories</th></tr>
<tr><td><input type="submit" name="sub_btn" value="Vegetables"></td>
<td><input type="submit" name="sub_btn" value="Fruits"></td>
<td><input type="submit" name="sub_btn" value="Dairy"></td>
<td><input type="submit" name="sub_btn" value="Meat"></td>
<td><input type="submit" name="sub_btn" value="Pulses"></td>
</tr>
<tr><td><input type="submit" name="sub_btn" value="Spices"></td>
<td><input type="submit" name="sub_btn" value="Vegetable
Oils"></td>
<td><input type="submit" name="sub_btn" value="Breakfast
Essentials"></td>
<td><input type="submit" name="sub_btn" value="Health Drinks and
Juices"></td>
<td><input type="submit" name="sub_btn" value="Soft Drinks"></td>
</tr>
<tr><td><input type="submit" name="sub_btn" value="Tea and
Coffee"></td>
<td><input type="submit" name="sub_btn" value="Rice and
Flour"></td>
<td><input type="submit" name="sub_btn" value="Salt and
Sugar"></td>
<td><input type="submit" name="sub_btn" value="Chocolates and
Chips"></td>
<td><input type="submit" name="sub_btn" value="Sauces and
Pickles"></td> </tr>
<tr><td><input type="submit" name="sub_btn" value="Baby Food"></td>
<td><input type="submit" name="sub_btn" value="Soups"></td>
<td><input type="submit" name="sub_btn" value="Eggs"></td>
54 | P a g e
<td><input type="submit" name="sub_btn" value="Bread"></td>
<td><input type="submit" name="sub_btn" value="Spreads"></td>
</tr>
<!--
<tr>
<td align="center"><h3><a href="index.php">Home</a></h3></td>
</tr>-->
</table>
</form>
<?php
include("config.php");
if(isset($_POST['sub_btn'])){
$p=$_POST['sub_btn'];
$sql="SELECT `products`.* FROM `products`,`categories` WHERE
`categories`.`Cat_ID`=`products`.`Cat_ID` AND `categories`.`Name`='$p'";
$result=mysqli_query($dbcon,$sql);
?>

<table width="80%" border="1" cellspacing="2" cellpadding="5"


align="center">
<tr>
<td align="center"
style="color:blue;"><strong><u>Name</strong></td>
<td align="center"
style="color:blue;"><strong><u>Description</strong></td>
<td align="center"
style="color:blue;"><strong><u>Price</strong></td>

55 | P a g e
<td align="center"
style="color:blue;"><strong><u>Image</strong></td>
<td align="center"
style="color:blue;"><strong><u>Status</strong></td>
</tr>

<?php
if (mysqli_num_rows($result)>0)
{
while($row=mysqli_fetch_array($result))
{
?> <tr>
<!--<td><?php //echo $r['ID']; ?></th> --
>
<td><?php echo $row['Name']; ?></td>
<td><?php echo $row['Description'];
?></td>
<td><?php echo $row['Price']; ?></td>
<td>
<div class="container main">
<div class="img-block">
<img
class="img-responsive" src="<?php echo $row['Image'];?>" alt="Card Image
Caption" width="50" height ="50" >
</div>
</div>
</td>
<td><?php echo $row['Status']; ?></td>

56 | P a g e
<?php }
}
else
echo '<tr><td align="center" colspan="5" style="color:red;">No
Record Found</td></tr>' ;
}
?>
</table>
<br>
<?php
$sql="SELECT `products`.* FROM `products` WHERE
`products`.`status`='Available'";
$result=mysqli_query($dbcon,$sql);
?>

<table width="80%" border="1" cellspacing="2" cellpadding="5"


align="center">
<tr>
<td align="center"
style="color:blue;"><strong><u>Name</strong></td>
<td align="center"
style="color:blue;"><strong><u>Description</strong></td>
<td align="center"
style="color:blue;"><strong><u>Price</strong></td>
<td align="center"
style="color:blue;"><strong><u>Image</strong></td>
<td align="center"
style="color:blue;"><strong><u>Status</strong></td>

57 | P a g e
</tr>

<?php
if (mysqli_num_rows($result)>0)
{
while($row=mysqli_fetch_array($result))
{
?> <tr>
<!--<td><?php //echo $r['ID']; ?></th> --
>
<td><?php echo $row['Name']; ?></td>
<td><?php echo $row['Description'];
?></td>
<td><?php echo $row['Price']; ?></td>
<td>
<div class="container main">
<div class="img-block">
<img
class="img-responsive" src="<?php echo $row['Image'];?>" alt="Card Image
Caption" width="50" height ="50" >
</div>
</div>
</td>
<td><?php echo $row['Status']; ?></td>
<td><a href="vproduct.php?pid=<?php
echo $row['ID']; ?>">view product</a></td>
<?php }
}

58 | P a g e
else
echo '<tr><td align="center" colspan="5" style="color:red;">No
Record Found</td></tr>' ;
?>
</table>
</body>
</html>

Customer register:-
Source code:-
<html>
<head> <style>
body {

59 | P a g e
margin: 0;
padding: 0;
font-family: sans-serif;
background-image: url("f4.jpg");
background-size: cover;
opacity: 1.0;
}
.box{
width: 400px;
padding: 50px;
border-radius: 30px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
background-color: rgba(0,0,0,0.8);
text-align:center;
box-shadow: 2px 2px 15px rgba(0,0,0,0.3);
color: #fff;
}
div.main{
width: 400px;
margin: 100px auto 0px auto;
}
h1{
text-align: center;

60 | P a g e
padding: 20px;
font-family: sans-serif;
}
div.register{
<!--background-color: rgba(0,0,0,0.5);-->
width: 100%;
font-size: 18px;
border-radius: 10px;
<!-- border: 1px solid rgba(255,255,255,0.3);-->
box-shadow: 2px 2px 15px rgba(0,0,0,0.3);
color: #fff;
}
input[type=submit] {
background-color: #2eb935;
color: white;
align-content: center;
}
input[type=text] {
border:0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #3498db;
padding: 14px 10px;
width: 250px;

61 | P a g e
height:55px;
font-size: 22px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
}
input[type=email] {
padding: 5px 5px;
border:0;
background: none;
margin: 20px auto;
text-align: center;
border: 2px solid #3498db;
width: 250px;
height:55px;
font-size: 22px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
}
input[type=tel] {
padding: 5px 5px;
border:0;
background: none;

62 | P a g e
margin: 20px auto;
text-align: center;
border: 2px solid #3498db;
width: 250px;
height:55px;
font-size: 22px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
}
input[type=password] {
padding: 5px 5px;
border:0;
background: none;
margin: 20px auto;
text-align: center;
border: 2px solid #3498db;
width: 250px;
height:55px;
font-size: 22px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
}

63 | P a g e
input[type=file]{
padding: 5px 5px;
border:0;
background: none;
margin: 20px auto;
text-align: center;
width: 200px;
outline: none;
color: white;
transition: 0.25s;
}
.register input[type="text"]:focus,
input[type="email"]:focus,input[type="tel"]:focus, .register
input[type="password"]:focus{
width: 280px;
border-color: #2ecc71;
}
.box input[type="submit"]{
border:0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 40px;
outline: none;
color: white;

64 | P a g e
border-radius: 24px;
transition: 0.25s;
cursor: pointer;
}
.box input[type="submit"]:hover{
background: #2ecc71;
}
.login-register-text a {
text-decoration: none;
color: #6c5ce7;
}
</style>
<title>Customer registration page</title>
</head>
<body>
<form class="box" action="registeracc.php" method="POST">
<br><br>
<!--<div class="main">-->
<div class="register">
<h1>Registration</h1>
<input type="text" name="name" id="name" placeholder="enter your
name" required>
<input type="email" name="email" id="email" placeholder="enter your
email" required>
<input type="tel" name="phnno" id="phnno" placeholder="enter your
phone number" required>

65 | P a g e
<input type="password" name="password" id="password"
placeholder="enter your password" required>
<input type="submit" value="Register"></h2></center>
<!--</div>-->
</div>
<p class="login-register-text">Have an account?<a
href="login.php">Login Here</a></p>
</form>
</body>
</html>
Register action:-
<?php
include("config.php");
?>
<?php
session_start();
$cus_name=$_REQUEST['name'];
$cus_email=$_REQUEST['email'];
$cus_password=$_REQUEST['password'];
$cus_phnno=$_REQUEST['phno'];
$path="nil";
$sql="INSERT INTO `customers`(Name,Email_ID,
Password,Phone_no,Image,Status) VALUES
('$cus_name','$cus_email','$cus_password','$cus_phnno','$path','active')";
echo $sql;
if(mysqli_query($dbcon,$sql)){
echo "record Inserted";

66 | P a g e
$msg="welcome to your home page";
header("location:index.php?msg={$msg}");
}else{
echo "not inserted";
}
?>

Customer login page:-


Source code:-
<html>
<head>
<style>
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background-image: url("f4.jpg");

67 | P a g e
background-size: cover;
opacity: 1.0;
}
.box{
width: 400px;
padding: 40px;
border-radius: 30px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
background-color: rgba(0,0,0,0.8);
text-align:center;
box-shadow: 2px 2px 15px rgba(0,0,0,0.3);
color: #fff;
}
.box h1{
color: white;
text-transform: uppercase;
font-weight: 500;
}
.box input[type="email"], .box input[type="password"]{
border:0;
background: none;
display: block;
margin: 20px auto;

68 | P a g e
text-align: center;
border: 2px solid #3498db;
padding: 14px 10px;
width: 250px;
height:55px;
font-size:25px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
}
.box input[type="email"]:focus, .box input[type="password"]:focus{
width: 280px;
border-color: #2ecc71;
}
.box input[type="submit"]{
border:0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 40px;
outline: none;
color: white;
border-radius: 24px;

69 | P a g e
transition: 0.25s;
cursor: pointer;
}
.box input[type="submit"]:hover{
background: #2ecc71;
}
.login-register-text a {
text-decoration: none;
color: #6c5ce7;
}
</style>
<title>Customer Login</title>
</head>
<body>
<form class="box" action="loginacc.php" method='POST'>
<h1>LOGIN</h1>
<input type="email" name="email" id="email" placeholder="enter your
email" required><br>

<input type="password" name="password" id="password"


placeholder="enter your password" required><br>
<h4><input type="submit" value="Login"></h4><br>
<p class="login-register-text">Create new account?<a
href="register.php">Register Here</a></p>
</form>
</body>
</html>

70 | P a g e
Login action:-
<?php
include("config.php");
?>
<?php
$username=$_REQUEST['email'];
$password=$_REQUEST['password'];
$sql="SELECT `ID` FROM `customers` WHERE `Email_ID`='$username'
AND `Password`='$password' ";
$q1=mysqli_query($dbcon,$sql);
$num=mysqli_num_rows($q1);
if($num===1){
session_start();
$user=mysqli_fetch_array($q1);
$_SESSION['ID']=$user['ID'];
header('location:homepage.php');
//header('location:profile.php');
}
else{
header('location:login.php? message=Email or Password Incorrect
');
}
?>

71 | P a g e
Customer profile:-
Source code:-
<!DOCTYPE html>
<html>
<head>
<title>CUSTOMER PROFILE</title>
<style>
*{
margin-bottom: 0;
padding: 0;
font-family: century gothic;
}
body {
background-image:url("ww.jpg");
height:100vh;
background-size: cover;

72 | P a g e
background-position: center;
}
.main{
width: 400px;
padding: 50px;
border-radius: 30px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
background-color: rgba(0,0,0,0.8);
text-align:center;
box-shadow: 2px 2px 15px rgba(0,0,0,0.3);
color: #fff;
}
ul{
float: right;
list-style-type: none;
margin-top: 25px;
}
ul li{
display: inline-block;
}
ul li a{
text-decoration: none;
color:#fff;

73 | P a g e
padding: 5px 20px;
border: 1px solid #fff;
transition: 0.6s ease;
}
ul li a:hover{
background-color: #fff;
color: #000;
}
h1{
text-align: center;
display: block;
}
</style>
</head>
<body>
<header>
<div class="main">
<?php include("config.php"); ?>
<?php
session_start();
if (!isset($_SESSION['ID'])) {
header('location:login.php');
}
?>
<h1>Welcome to your profile!</h1>
<?php

74 | P a g e
$qr = "SELECT
*
FROM
`customers`
WHERE
`ID` = ".$_SESSION['ID'];

$q1 = mysqli_query($dbcon,$qr);
if(mysqli_num_rows($q1) > 0)
{
while($customer = mysqli_fetch_array($q1)) {
echo $customer["Name"];
}
}
?>
<ul>
<li><a href="categories1.php">Home</a></li>
<li><a href="chngpass1.php">Password Change</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</div>
</header>
</body>
</html>

75 | P a g e
Product details:-
Source code:-
<!DOCTYPE html>
<html>
<head>
<title>VIEWING PRODUCT</title>
<style>
body {
width: 100%;
min-height: 100vh;
background-image: url("bg6.jpg");
background-position: center;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
}
.box{
76 | P a g e
font-size:23px;
width: 300px;
padding: 40px;
border-radius: 30px;
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%,-50%);
background-color: rgba(3, 27, 178, 0.6);
text-align:center;
box-shadow: 2px 2px 15px rgba(0,0,0,0.3);
color: #fff;
}
.box input[type="button"]:hover{
background: #2ecc71;
}
.box .box1{
border-radius: 30px;
}
.box button:hover{
background: #2ecc71;
}
.box input[type="button"]:hover{
background: #2ecc71;
}
.button {

77 | P a g e
display: inline-block;
border-radius: 6px;
background-color: #f4511e;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 18px;
padding: 20px;
width: 200px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
}

.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}

.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;

78 | P a g e
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
</style>
</head>
<body>
<?php include("config.php"); ?>
<p class="box">
<?php
#ID is need to be fetched from previos page(home page).For tseting purpose
ID is set to static.
session_start();
$qry = "SELECT * FROM products WHERE ID='".$_REQUEST['pid']."' ";

$uid= $_SESSION['ID'];
#echo $uid;
$qryr= mysqli_query($dbcon,$qry);

while ($r = mysqli_fetch_array($qryr)) {


79 | P a g e
$pto=$r['Image'];
echo"Product Name: "; echo $r['Name']."<br><br><br>"."<img class='img-
set' src= '$pto' width='190' height='190' >"."<br><br><br>";
echo"Product Description: ";echo $r['Description']."<br>";
echo"Product Price: ";echo $r['Price']."<br>";
echo"Currently "; echo $r['Status']."<br>";
$pid= $r['ID'];
}
?>
<br><br>
<a href="cart.php?id=<?php echo $pid ;?>"><button class="button"
style="vertical-align:middle"><span>ADD TO CART</span></button></a>
</p>
</body>
</html>

View cart:-
Source code:-
<html>
<head>

80 | P a g e
<title>CART</title>
<style>
body {
background-image: url('bg2.jpeg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% 100%;
}
#customers {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 60%;
}

#customers td, #customers th {


border: 1px solid #ddd;
padding: 8px;
text-align: center;
}

#customers tr:nth-child(even){background-color: #f2f2f2;}


#customers tr:nth-child(odd){background-color: #C5C5C5;}
#customers tr:hover {background-color: #ddd;}
#customers th {
padding-top: 12px;
padding-bottom: 12px;

81 | P a g e
text-align: center;
background-color: #04AA6D;
color: white;
}
h3 {
text-align: center;
color: #FE4C40;
font-size: 73px;
text-shadow: 4px 4px 8px orange;
}
h1 {
text-align: center;
}
.button {
display: inline-block;
border-radius: 6px;
background-color: #f4511e;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 18px;
padding: 20px;
width: 200px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;

82 | P a g e
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}

.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}

.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
</style>
</head>

83 | P a g e
<body>
<br>
<h3 ><i class="cart"> CART </i></h3>
<?php include("config.php"); ?>
<?php

$prid=3;
session_start();
$id= $_REQUEST['id'];
$uid= $_SESSION['ID'];
//$uid= session_id();
$qcart="INSERT INTO carts (userId, productId, quantity) VALUES ('".$uid."',
'".$id."', '".$prid."')";
if(mysqli_query($dbcon,$qcart)) {
echo "Your product added to cart";
}
?>
<?php
?>
<table id="customers" width="50%" border="0" cellspacing="2"
cellpadding="10" align="center">
<tr>
<!--<td align="center"><strong>ID</strong></td>-->
<th align="center"><strong>Name</strong></th>
<th align="center"><strong>Description</strong></th>
<th align="center"><strong>Price</strong></th>
<th align="center"><strong>Qty</strong></th>

84 | P a g e
<th align="center"><strong>Image</strong></th>
<th align="center"><strong>Status</strong></th>
<th align="center"><strong>Delete from Cart</strong></th>

</tr>
<?php
$qr = "SELECT * FROM products WHERE Id IN(SELECT productId FROM
carts WHERE userId=".$uid.")";
$q1 = mysqli_query($dbcon,$qr);
while($r= mysqli_fetch_array($q1)) {
?>
<tr>
<!--<td><?php //echo $r['ID']; ?></th> --
>
<td><?php echo $r['Name']; ?></td>
<td><?php echo $r['Description'];
?></td>
<td><?php echo $r['Price']; ?></td>
<td><?php echo $prid; ?></td>
<td>
<div class="container main">
<div class="img-block">
<img
class="img-responsive" src="<?php echo $r['Image'];?>" alt="Card Image
Caption" width="50" height ="50" >
</div>
</div>

85 | P a g e
</td>
<td><?php echo $r['Status']; ?></td>
<td><a href="del_cart.php?id=<?php echo
$r['ID']; ?>">Delete</a></td>
</tr>
<?php
}
?>

</table>
<br><br>
<h1><a href="bnow.php?upid=<?php echo $uid ;?>"><button class="button"
style="vertical-align:middle"><span>BUY NOW</span></button></a></h1>
<h1><a href="productview.php" ><button class="button" style="vertical-
align:middle"><span>BUY MORE</span></button></a></h1>
</body>
</html>

Delete from cart:-

86 | P a g e
<?php include("config.php"); ?>
<?php
$id = $_REQUEST['id'];

$sql = "DELETE FROM `carts` WHERE productId = $id ";

if(mysqli_query($dbcon,$sql)){
echo "record Deleted";
header("location:cart.php");
}
else{
echo "Failed to delete";
}
?>
Buy now:-
Source code:-
<html>
<head>
<title>ORDER</title>
<style>
body {
background-image: url('order3.gif');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% 100%;

87 | P a g e
}

h3 {
text-align: center;
color: #FE4C40;
font-size: 73px;
text-shadow: 4px 4px 8px orange;
}
h5 {
text-align: center;
color: #329e35;
font-size: 55px;
text-shadow: 1px 1px 3px green;
}
h1 {
text-align: center;
}
.button {
background-color: #0081ff;
border: none;
color: white;
padding: 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;

88 | P a g e
margin: 4px 2px;
cursor: pointer;
border-radius: 15px;
}
</style>
</head>
<body>
<h3 > <br>MERCEARIA <br></h3>

<h5>Thank You</h5><br>
<br><br><h5>
<?php include("config.php"); ?>

<?php
session_start();
//$uid=$_REQUEST['upid'];
//$uid= session_id();
$uid= $_SESSION['ID'];

#echo $uid;
$qc="SELECT * FROM carts WHERE userId='".$uid."'";
$qcr=mysqli_query($dbcon,$qc);
while($c = mysqli_fetch_array($qcr)) {
# echo "in";
#echo $c['userId'];

89 | P a g e
#echo $c['productId'];
$upt= "INSERT INTO userProduct (userId, productId,purchasedOn,status)
VALUES ('".$c['userId']."','".$c['productId']."',CURRENT_DATE,'active')";
mysqli_query($dbcon,$upt);
$dc="DELETE FROM carts WHERE userId='".$c['userId']."' and
productId='".$c['productId']."'";
mysqli_query($dbcon,$dc);
}
echo " Order Placed Successfully!"."<br>";

?>
</h5>
<h1><a href="productview.php?upid=<?php echo $uid ;?>"><button
class="button" >BUY AGAIN</button></a></h1>
</body>
</html>

Customer logout:-
Source code:-
90 | P a g e
<?php
session_start();
if (!isset($_SESSION['ID'])) {
header('location:login.php');
}
?>
<?php
session_start();
session_destroy();
header('location:login.php');
?>
Supplier register:-
Source code:-
<!DOCTYPE html>
<html>
<head>
<style>
body {
width: 100%;
min-height: 100vh;
background-image: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.5)),
url(bg2.jpeg);
background-position: center;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
91 | P a g e
}

.container {
width: 400px;
min-height: 200px;
background: #FFF;
border-radius: 30px;
box-shadow: 0 0 5px rgba(0,0,0,.3);
padding: 60px 50px;
}
.container .login-text {
color: #111;
font-weight: 500;
font-size: 1.1rem;
text-align: center;
margin-bottom: 20px;
display: block;
text-transform: capitalize;
}
.container .login-social {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(50%, 1fr));
margin-bottom: 25px;
}
.container .login-social a {
padding: 12px;

92 | P a g e
margin: 10px;
border-radius: 3px;
box-shadow: 0 0 5px rgba(0,0,0,.3);
text-decoration: none;
font-size: 1rem;
text-align: center;
color: #FFF;
transition: .3s;
}
.container .login-social a i {
margin-right: 5px;
}
.container .login-email .input-group {
width: 100%;
height: 50px;
margin-bottom: 25px;
}
.container .login-email .input-group input {
width: 100%;
height: 100%;
border: 2px solid #e7e7e7;
padding: 15px 20px;
font-size: 1rem;
border-radius: 30px;
background: transparent;
outline: none;

93 | P a g e
transition: .3s;
}
.container .login-email .input-group input:focus, .container .login-email .input-
group input:valid {
border-color: #a29bfe;
}
.container .login-email .input-group .btn {
display: block;
width: 100%;
padding: 15px 20px;
text-align: center;
border: none;
background: #a29bfe;
outline: none;
border-radius: 30px;
font-size: 1.2rem;
color: #FFF;
cursor: pointer;
transition: .3s;
}
.container .login-email .input-group .btn:hover {
transform: translateY(-5px);
background: #6c5ce7;
}
.login-register-text {
color: #111;
font-weight: 600;
94 | P a g e
}

.login-register-text a {
text-decoration: none;
color: #6c5ce7;
}
<meta charset="utf-8">
<!--<meta name="viewport" content="width=device-width, initial-
scale=1.0">-->
<!--<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-
awesome.min.css">-->
<link rel="stylesheet" type="text/css" href="style.css">
<title>Register Form</title>
</style>
</head>
<body>
<div class="container">
<form action="sreg_acc.php" method="POST" class="login-
email">
<p class="login-text" style="font-size: 2rem; font-weight: 800;
">Register</p>
<div class="input-group">
<input type="text" id="name" name="name"
placeholder="name" required>
</div>
<div class="input-group">

95 | P a g e
<input type="email" placeholder="Email"
name="email" id="email" required>
</div>
<div class="input-group">
<input type="tel" id="phno" name="phno"
placeholder="Phone no." required>
</div>
<div class="input-group">
<input type="password" placeholder="Password"
name="password" id="passowrd" required>
</div>
<div class="input-group">
<button name="submit"
class="btn">Register</button>
</div>
<p class="login-register-text">Have an account? <a
href="slogin.php">Login Here</a>.</p>
</form>
</div>
</body>
</html>
Register action:-
<?php
include('config.php');
//$spassword=$_REQUEST['password'];
//$phash = password_hash($spassword,PASSWORD_DEFAULT);

96 | P a g e
$squery="INSERT INTO `suppliers` (Name, Email_ID, Password, Phone_no,
Image, Status) VALUES
('".$_REQUEST['name']."','".$_REQUEST['email']."','".$_REQUEST['password']."'
, '".$_REQUEST['phno']."', '0', '1')";
/*
// Verify the hash against the password entered
$verify = password_verify($plaintext_password, $hash);
//$hash->will retrive from database
// Print the result depending if they match
if ($verify) {
echo 'Password Verified!';
} else {
echo 'Incorrect Password!';
}
*/
echo $squery;
if(mysqli_query($dbcon,$squery)) {
echo "registered succesfully";
$msg="welcome to your home page";
header("location:pro_addfile.php?msg={$msg}");
}
else {
echo "can't register";
}
?>

97 | P a g e
Supplier login:-
Source code:-
<!DOCTYPE html>
<html>
<head>
<style>
body {
width: 100%;
min-height: 100vh;
background-image: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.5)),
url(bg2.jpeg);
background-position: center;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
}

98 | P a g e
.container {
width: 400px;
min-height: 200px;
background: #FFF;
border-radius: 30px;
box-shadow: 0 0 5px rgba(0,0,0,.3);
padding: 60px 50px;
}
.container .login-text {
color: #111;
font-weight: 500;
font-size: 1.1rem;
text-align: center;
margin-bottom: 20px;
display: block;
text-transform: capitalize;
}
.container .login-social {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(50%, 1fr));
margin-bottom: 25px;
}
.container .login-social a {
padding: 12px;
margin: 10px;
border-radius: 3px;

99 | P a g e
box-shadow: 0 0 5px rgba(0,0,0,.3);
text-decoration: none;
font-size: 1rem;
text-align: center;
color: #FFF;
transition: .3s;
}
.container .login-social a i {
margin-right: 5px;
}
.container .login-email .input-group {
width: 100%;
height: 50px;
margin-bottom: 25px;
}
.container .login-email .input-group input {
width: 100%;
height: 100%;
border: 2px solid #e7e7e7;
padding: 15px 20px;
font-size: 1rem;
border-radius: 30px;
background: transparent;
outline: none;
transition: .3s;
}

100 | P a g e
.container .login-email .input-group input:focus, .container .login-email .input-
group input:valid {
border-color: #a29bfe;
}
.container .login-email .input-group .btn {
display: block;
width: 100%;
padding: 15px 20px;
text-align: center;
border: none;
background: #a29bfe;
outline: none;
border-radius: 30px;
font-size: 1.2rem;
color: #FFF;
cursor: pointer;
transition: .3s;
}
.container .login-email .input-group .btn:hover {
transform: translateY(-5px);
background: #6c5ce7;
}
.login-register-text {
color: #111;
font-weight: 600;
}

101 | P a g e
.login-register-text a {
text-decoration: none;
color: #6c5ce7;
}
<meta charset="utf-8">
<!--<meta name="viewport" content="width=device-width, initial-
scale=1.0">-->

<!--<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-
awesome.min.css">-->
<link rel="stylesheet" type="text/css" href="style.css">
<title>GROCERY STORE-S_login</title>
</style>
</head>
<body>
<div class="container">
<form action="slogin_acc.php" method="POST" class="login-
email">
<p class="login-text" style="font-size: 2rem; font-weight:
800;">Login</p>
<div class="input-group">
<input type="email" placeholder="Email"
name="email" id="email" required>
</div>
<div class="input-group">
<input type="password" placeholder="Password"
name="password" id="password" required>

102 | P a g e
</div>
<div class="input-group">
<button name="submit" class="btn">Login</button>
</div>
<p class="login-register-text">Don't have an account? <a
href="sreg.php">Register Here</a>.</p>
</form>
</div>
</body>
</html>
Login action:-
<?php
/*include('config.php');
//$linemail=$_REQUEST['email'];
//$linpass=$_REQUEST['password'];
$lqy="select ID from suppliers where Email_ID = '".$_REQUEST['email']."' and
Password= '".$_REQUEST['password']."'";
$lq=mysqli_query($dbcon,$lqy);
$nor= mysqli_num_rows($lq);
if ($nor === 1) {
session_start();
$sup=mysqli_fetch_array($lq);
$_SESSION['ID']=$sup['ID'];
header('location:sprofile.php');
}
else {
header('location:slogin.php? message=Email or Password Incorrect ');

103 | P a g e
}
*/
?>
<?php
include("config.php");
?>
<?php
$username=$_REQUEST['email'];
$password=$_REQUEST['password'];
$sql="SELECT `ID` FROM `suppliers` WHERE `Email_ID`='$username' AND
`Password`='$password' ";
$q1=mysqli_query($dbcon,$sql);
$num=mysqli_num_rows($q1);
if($num===1){
session_start();
$user=mysqli_fetch_array($q1);
$_SESSION['ID']=$user['ID'];
header('location:pro_viewfile.php');
}
else{
header('location:slogin.php? message=Email or Password Incorrect ');
}
?>

104 | P a g e
Supplier profile:-
Source code:-
<!DOCTYPE html>
<html>
<head>
<style>
*{
margin-bottom: 0;
padding: 0;
font-family: century gothic;
}
body {
background-image:url("bb.jpg");
height:100vh;
background-size: cover;
background-position: center;
}
.main{
105 | P a g e
width: 400px;
padding: 50px;
border-radius: 30px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
background-color: rgba(0,0,0,0.8);
text-align:center;
box-shadow: 2px 2px 15px rgba(0,0,0,0.3);
color: #fff;
}
header{
height: 60px;
width: 100%;
background: rgba(0,0,0,0.6);
}
ul{
float: right;
list-style-type: none;
margin-top: 25px;
}
ul li{
display: inline-block;
}
ul li a{

106 | P a g e
text-decoration: none;
color:#fff;
padding: 5px 20px;
border: 1px solid #fff;
transition: 0.6s ease;
}
ul li a:hover{
background-color: #fff;
color: #000;
}
h1{
text-align: center;
display: block;
}
</style>
</head>
<body>
<header>
<ul>
<li style="float: right"><a href="chngpass.php">Password
Change</a></li>
<li style="float: right"><a href="slogout.php">Logout</a></li>
</ul>
</header>
<div class="main">
<?php include("config.php"); ?>
<?php
107 | P a g e
session_start();
if (!isset($_SESSION['ID'])) {
header('location:slogin.php');
}
?>
<h1>Welcome to your profile!</h1>
<?php
$qr = "SELECT
*
FROM
`suppliers`
WHERE
`ID` = ".$_SESSION['ID'];

$q1 = mysqli_query($dbcon,$qr);
if(mysqli_num_rows($q1) > 0)
{
while($customer = mysqli_fetch_array($q1)) {
echo $customer["Name"];
}
}
?>
<br>
<br>
<ul>

108 | P a g e
<li><a href="pro_viewfile.php">View product</a></li>
<li><a href="categories1.php">Home</a></li>
</ul>
</div>
</body>
</html>

Supplier Product addition:-


Source code:-
<!DOCTYPE html>
<html>
<head> <?php
session_start();
if (!isset($_SESSION['ID'])) {
header('location:slogin.php');
}?>
<title>Addition</title>
<style>
body {
109 | P a g e
margin: 0;
padding: 0;
font-family: sans-serif;
background-image: url("bg3.jpeg");
background-size: cover;
transform: translate(0%,425%);
//background-position: center;
opacity: 1.0;
font-size: 18px;
}
.container{
width: 400px;
padding: 40px;
border-radius: 30px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-60%,-33%);
background-color: rgba(0,0,0,0.7);
text-align:left;
box-shadow: 0px -1px 20px 0px darkgrey;
color: white;
}
.container input[type="submit"]{
border:0;
width: 130px;

110 | P a g e
background color: white;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 10px;
outline: none;
color: black;
border-radius: 24px;
transition: 0.25s;
cursor: pointer;
font-size: 18px;
}
.container input[type="submit"] {
background-color: white;
color: black;
border: 2px solid #555555;
}
.container input[type="submit"]:hover {
background-color: #555555;
color: white;
}
button{
font-size: 15px;
background-color: black;
color: white;

111 | P a g e
align: center;
transform: translate(20%,-400%);
border-radius: 50%;
padding: 14px 40px;
}
.msg{
color: white;
transform: translate(25%,800%);
}
</style>
</head>
<body> <div class="bt">
<h3><a href="pro_viewfile.php"><button type="button" class="btn btn-
primary ml-4 pl-2">View Products</button></a></h3>
</div>
<div class="container">
<h2 class="my-4">Add New Product</h2>
<form method="post" enctype="multipart/form-data">
<div class="form-group">
<label>Name</label>
<input type="text" class="form-control"
name="name" value="" required/>
</div>
<div class="form-group">
<br><label>Category</label>
<input type="radio" class="form-control" name="category"
value="1">

112 | P a g e
<label for="VEGETABLES">VEGETABLES</label>
<input type="radio" class="form-control" name="category"
value="2">
<label for="FRUITS">FRUITS</label>
<input type="radio" class="form-control" name="category"
value="3">
<label for="DAIRY PRODUCTS ">DAIRY PRODUCTS</label>
<input type="radio" class="form-control" name="category"
value="4">
<label for="PULSES">PULSES</label><br>
<input type="radio" class="form-control" name="category"
value="5">
<label for="COOKING OILS">COOKING OILS</label>
<input type="radio" class="form-control" name="category"
value="6">
<label for="RICE AND FLOURS">RICE AND FLOURS</label><br>
</div>
<div class="form-group">
<br><label>Description</label>
<input type="text" class="form-control"
name="description" value="" required/>
</div>
<div class="form-group">
<br><label>Price</label>
<input type="text" class="form-control"
name="price" value="" required/>
<!--<input type="radio" class="form-control" name="price"
value="per kg">
<label for="per kg">per kg</label>

113 | P a g e
<input type="radio" class="form-control" name="price" value="per
piece">
<label for="per piece">per piece</label><br>-->
</div>
<div class="image-box">
<br><label>Image</label>
<input type="file" class="file_input" name="image"
required/>
</div>
<div class="form-group">
<br><label>Creation Date</label>
<input type="date" class="form-control" placeholder=" Creation
Date" name="createdAt">
</div>
<div class="form-group">
<br><label>Item status</label>
<input type="radio" class="form-control" name="status"
value="available">
<label for="available">AVAILABLE</label>
<input type="radio" class="form-control" name="status"
value="unavailable">
<label for="unavailable">UNAVAILABLE</label><br>
</div>

<br><input type="submit" class="btn btn-primary"


value="Add Product" name="btn" />
</form>
<?php include("config.php");

114 | P a g e
if(isset($_POST["btn"])) {
$pro_cat=$_REQUEST['category'];
$pro_name=$_REQUEST['name'];
$pro_desc=$_REQUEST['description'];
$pro_price=$_REQUEST['price'];
$pro_create=$_REQUEST['createdAt'];
$pro_sts=$_REQUEST['status'];
$sup_id=$_SESSION['ID'];

// store n upload image


$image_name ="Upload/".$_FILES["image"]["name"];
$temp_name=$_FILES["image"]["tmp_name"];
$sql="INSERT INTO
`products`(`Cat_ID`,`Name`,`Description`,`Price`,`Image`,`Suppliers_ID`,`Create
dAt`,`Status`) VALUES
('$pro_cat','$pro_name','$pro_desc','$pro_price','$image_name','$sup_id','$pr
o_create','$pro_sts')";
move_uploaded_file($temp_name,$image_name);
if(mysqli_query($dbcon,$sql)){?>
<br><b text
align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <?php echo'Record inserted
successfully.'
;?></b>
<?php
}
}
?>

115 | P a g e
</body>
</html>

Supplier Products list view:-


Source code:-
<!DOCTYPE html>
<html>
<head>
<title>DISPLAYING ALL PRODUCTS</title>
<style>
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background-image: url("bg5.jpeg");
background-size: 120%;
transform: translate(0%,5%);
background-position: center;

116 | P a g e
opacity: 1.0;
text-decoration: none;
background-repeat: no-repeat;
font-size: 18px;
}
button{
font-size: 15px;
text-color:white;
border:0;
width: 150px;
background-color: black ;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid black;
padding: 10px 10px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
cursor: pointer;
}
button {
transition-duration: 0.4s;
}

117 | P a g e
button:hover {
background-color: silver;
color: white;
}
</style>
</head>
<body>
<?php include("config.php"); ?>
<table width="80%" border="0" cellspacing="2" cellpadding="5"
align="center">
<tr>
<td colspan="5" align="center">
<h1>PRODUCTS LIST</h1>
</td>
</tr>
<tr>
<td colspan="5" align="center">
<h3><a href="sprofile.php"><button type="button" class="btn
btn-primary ml-4 pl-2">Go to Profile</button></a></h3>
<div class="container-fluid my-4">
<div class="row my-2">
<a href="pro_addfile.php"><button type="button"
class="btn btn-primary ml-4 pl-2">Add New Product</button></a>
</div>
</div>
<br>
<br>

118 | P a g e
</td>
</tr>
<div align="center">
<?php
session_start();
$qr = "SELECT * FROM `products` WHERE
Suppliers_ID='".$_SESSION['ID']."'";
$q1 = mysqli_query($dbcon,$qr);
//if(mysqli_num_rows($q1) > 0)
//{
?><table>
<?php ?>
<tr>
<?php
$w=1;
while($r = mysqli_fetch_array($q1)) {
if($w <= 4){ ?>
<td>
<div align="center" class="card" style="width:
20rem;" >
<!--<td><?php //echo $r['ID']; ?></th> --
>
<?php echo 'Name:- ', $r['Name']; ?><br>
<img class="img-responsive" src="<?php
echo $r['Image'];?>" alt="Card Image Caption" width="150" height ="150"
><br>
<div class="card-body" color="red" >

119 | P a g e
<?php echo 'Description:- '
,$r['Description']; ?><br>
<?php echo 'Price:- ', $r['Price']; ?><br>
<?php echo 'CreatedAt:- ',
$r['CreatedAt']; ?> <br>
<?php echo 'UpdatedAt:- ',
$r['UpdatedAt']; ?><br>
<?php echo 'Status:- ', $r['Status'];
?><br>
<a href="pro_updtdfile.php?id=<?php
echo $r['ID']; ?>"><button type="button" class="btn btn-primary ml-4 pl-
2"><u>Edit</button></a>
<a href="pro_delfile.php?id=<?php echo
$r['ID']; ?>"><button type="button" class="btn btn-primary ml-4 pl-
2">Delete</button></a><br>
</div></div>
</td>
<?php
}
else{
?>
</tr> <?php
}
$w =$w +1;
?>
<?php }?>
</table>
<!--<table width="80%" align="center">
<tr>

120 | P a g e
<td colspan="5" align="center">
<br>
<br>
<br>
<br>
<h3><a href="logout.php">Logout</a></h3>
</td>
</tr>
</table>-->
</body>
</html>

Supplier Product update :-


Source code:-
<?php
include("config.php");

if(isset($_POST['btn']))

121 | P a g e
{
$pro_name=$_POST['name'];
$pro_desc=$_POST['description'];
$pro_price=$_POST['price'];
$pro_create=$_POST['createdAt'];
$pro_update=$_POST['UpdatedAt'];
$pro_sts=$_POST['status'];
$pro_id = $_GET['id'];

$q= "update products set Price= '$pro_price', UpdatedAt='$pro_update',


Status='$pro_sts' where ID=$pro_id";

$query=mysqli_query($dbcon,$q);

header('location:pro_viewfile.php');

}
else if(isset($_GET['id']))
{
$q = "SELECT * FROM products WHERE ID='".$_GET['id']."'";
$query=mysqli_query($dbcon,$q);
$res= mysqli_fetch_array($query);
}
?>
<!DOCTYPE html>
<html>
<head>
122 | P a g e
<title>Updation</title>
<style>
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background-image: url("bg4.jpeg");
background-size: cover;
transform: translate(0%,42%);
//background-position: center;
opacity: 1.0;
font-size: 18px;
}
.container{
width: 370px;
padding: 40px;
border-radius: 30px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-70%,10%);
background-color: rgba(0,0,0,0.7);
text-align:left;
box-shadow: 0px -1px 20px 0px darkgrey;
color: white;
}

123 | P a g e
.container input[type="submit"]{
border:0;
width: 130px;
background color: white;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 10px;
outline: none;
color: black;
border-radius: 24px;
transition: 0.25s;
cursor: pointer;
font-size: 15px;
}
button{
font-size: 15px;
background-color: black;
color: white;
align: center;
transform: translate(50%,50%);
border-radius: 50%;
padding: 14px 40px;
}
.container input[type="submit"] {

124 | P a g e
background-color: white;
color: black;
border: 2px solid #555555;
}
.container input[type="submit"]:hover {
background-color: #555555;
color: white;
}
</style>
</head>
<body>
<div class="f"><a href="pro_viewfile.php"><button type="button"
class="btn btn-primary ml-4 pl-2">BACK</button></a>
</div>
<div class="container">
<?php if(isset($fmsg)){ ?><div class="alert alert-danger" role="alert">
<?php echo $fmsg; ?> </div><?php } ?>
<h2 class="my-4">Update existing product</h2>
<form method="post" enctype="multipart/form-data">
<div class="form-group">
<label>Name</label>
<input type="text" class="form-control"
name="name" value="<?php echo $res['Name'];?>" disabled/>
</div>
<div class="form-group">
<br><label>Description</label>

125 | P a g e
<input type="text" class="form-control"
name="description" value="<?php echo $res['Description'];?>" disabled/>
</div>
<div class="form-group">
<br><label>New Price</label>
<input type="text" class="form-control"
name="price" value="<?php echo $res['Price'];?>" required/>
<!--<input type="radio" class="form-control" name="price"
value="per kg">
<label for="per kg">per kg</label>
<input type="radio" class="form-control" name="price" value="per
piece">
<label for="per piece">per piece</label><br>-->
</div>
<div class="form-group">
<br><label>Image</label>
<input type="file" class="file_input" name="image"
value="<?php echo $res['Image'];?>" disabled/>
</div>
<div class="form-group">
<br><label>Creation Date</label>
<input type="date" class="form-control"
placeholder=" Creation Date" name="createdAt" value="<?php echo
$res['CreatedAt'];?>" disabled/>
</div>
<div class="form-group">
<br><label>Updation Date</label>

126 | P a g e
<input type="date" class="form-control"
placeholder="Updation Date" name="UpdatedAt" value="<?php echo
$res['UpdatedAt'];?>" required/>
</div>
<div class="form-group">
<br><label>Item status</label>
<input type="radio" class="form-control"
name="status" value="available">
<label for="available">AVAILABLE</label>
<input type="radio" class="form-control"
name="status" value="unavailable">
<label for="unavailable">UNAVAILABLE</label><br>
</div>
<div class="form-group">
<br><input type="submit" class="btn btn-danger"
value="Update" name="btn">
</div>
</form>
</div>
</body>
</html>

127 | P a g e
Supplier Product deletion:-
Source code:-
<?php include("config.php"); ?>
<?php
$id = $_GET['id'];
$sql = "DELETE FROM `products` WHERE ID = $id ";
if(mysqli_query($dbcon,$sql)){
echo "record Deleted";
header("location:pro_viewfile.php");
}
else{
echo "Failed to delete";
}

?>
Supplier logout:-
Source code:-
<?php
session_start();

128 | P a g e
if (!isset($_SESSION['ID'])) {
header('location:login.php');
}
?>
<?php
session_start();
session_destroy();
header('location:slogin.php');
?>
Change password:-
Source code:-
<?php
include("config.php");
?>
<html>
<head>
<style>
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background-image: url("Upload/p1.jpg");
background-size: cover;
background-position: center center;
opacity: 1.0;
}

129 | P a g e
.box{
width: 320px;
padding: 40px;
border-radius: 30px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
background-color: rgba(0,0,0,0.8);
text-align:center;
box-shadow: 0px -1px 20px 0px darkgrey;
color: white;
}
.box h1{
text-align: center;
font-family: sans-serif;
margin-bottom: 10px;
padding: 13px 0;
color: white;
text-transform: uppercase;
font-weight: 500;
}
.box input[type="email"], .box input[type="password"]{
border:0;
background: none;
display: block;

130 | P a g e
margin: 20px auto;
text-align: center;
border: 2px solid #0ae2f3;
padding: 14px 10px;
width: 250px;
font-size:25px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
}
.box input[type="submit"]{
border:0;
width: 130px;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 10px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
cursor: pointer;
}

131 | P a g e
.box input[type="email"]:focus, .box input[type="password"]:focus{
width: 280px;
border-color: #2ecc71;
}
.box input[type="submit"]:hover{
background: #2ecc71;
}
</style>
</head>
<body>
<form class="box" action="chngpass.php" method='POST'>
<h1>Change Password</h1>
<input type="email" name="email" id="email" placeholder="enter your
email" required><br>
<input type="password" name="password" id="password"
placeholder="enter new password" required><br>
<h4><input type="submit" name="submit" value="Change
Password"></h4><br>
</form>
</body>
</html>
<?php
if(isset($_POST['submit']))
{
$id=$_POST['email'];
$pwd=$_POST['password'];

132 | P a g e
$query="UPDATE `suppliers` SET `Password`= '$pwd' WHERE `Email_ID`='$id'
";
$data=mysqli_query($dbcon,$query);
if($data)
{
echo "Password Changed Successfully";
header('location:sprofile.php');
}
else{
echo "Failed to change password";
}
}
?>

133 | P a g e
Testing
Software testing is the process of executing a program or system with the
intent of finding errors. Or, it involves any activity aimed at evaluating an
attribute or capability of a program or system and determining that it meets its
required results. Software is not unlike other physical processes where inputs
are received and outputs are produced. Where software differs is in the
manner in which it fails. Most physical systems fail in a fixed (and reasonably
small) set of ways. By contrast, software can fail in many bizarre ways.
Detecting all of the different failure modes for software is generally infeasible
unlike most physical systems; most of the defects in software are design
errors, not manufacturing defects. Software does not suffer from corrosion,
wear-and-tear – generally it will not change until upgrades, or until
obsolescence. So once the software is Shipped, the design defects -- or bugs --
will be buried in and remain latent until activation. Software bugs will almost
always exist in any software module with moderate size: not because
programmers are careless or irresponsible, but because the complexity of
software is generally intractable – and humans have only limited ability to
manage complexity.
It is also true that for any complex systems, design defects can never be
completely ruled out. Discovering the design defects in software is equally
difficult, for the same reason of complexity. Because software and any digital
systems are not continuous, testing boundary values are not sufficient to
guarantee correctness. All the possible values need to be tested and verified,
but complete testing is infeasible. Exhaustively testing a simple program to add
only two integer inputs of 32-bits (yielding 2^64 distinct test cases) would take
hundreds of years, even if tests were performed at a rate of thousands per
second. Obviously, for a realistic software module, the complexity can be far
beyond the example mentioned here. If inputs from the real world are
involved, the problem will get worse, because timing and unpredictable
environmental effects and human interactions are all possible input
parameters under consideration.
The testing activities are done in all phases of the lifecycle in an iterative
software development approach. However, the emphasis on testing activities
varies in different phases. This procedure explains the focus of testing in
inception, elaboration, construction and transition phases. In the inception
phase most of requirements capturing is done and the test plan is developed.
In elaboration phase most of design is developed, and test cases are
developed. Construction phase mainly focuses on development of components
and units, and unit testing is the focus in this phase. Transition phase is about
134 | P a g e
Deploying software in the user community and most of the system testing and
acceptance testing is done in this phase.

The main purposes of this procedure are:

• To carry out comprehensive testing of the system/product and its individual


components in order to ensure that the developed system/product
conforms to the user requirements/design.
• To verify the proper integration of all components of the software.
• To verify that all requirements have been correctly implemented.
• To identify and ensure defects are addressed prior to the deployment of the
software.

Test Planning

Initial test plan addresses system test planning, and over the elaboration,
construction and transition phases this plan is updated to cater other testing
requirements of these phases, like, unit & integration testing.

Test Plan must contain the following:

• Scope of testing
• Methodology to be used for testing
• Types of tests to be carried out
• Resource & system requirements
• A tentative Test Schedule
• Identification of various forms to be used to record test cases and test
results

Testing is usually performed for the following purposes:

• To improve quality: Quality means the conformance to the specified


design requirement. Being correct, the minimum requirement of quality,
means performing as required under specified circumstances.
Debugging, a narrow view of software testing, is performed heavily to
find out design defects by the programmer. The imperfection of human
nature makes it almost impossible to make a moderately complex
program correct the first time. Finding the problems and getting them
fixed, is the purpose of debugging in programming phase.

135 | P a g e
• For Verification and Validation (V&V): Another important purpose of
testing is verification and validation (V&V). Testing can serve as metrics.
It is heavily used as a tool in the V&V process. Testers can make claims
based on interpretations of the testing results, which either the product
works under certain situations or it does not work. We can also compare
the quality among different products under the same specification,
based on results from the same test.

Testing Methods Used for Project


There is a plethora of testing methods and testing techniques, serving multiple
purposes in different life cycle phases. Classified by purpose, software testing
can be divided into: Correctness testing, performance tests, reliability testing
and security testing. Classified by life-cycle phase, software testing can be
classified into the following categories: requirements phase testing, design
phase testing, program phase testing, evaluating test results, installation phase
testing, acceptance testing and maintenance testing. By scope, software
testing can be categorized as follows: unit testing, component testing,
integration testing, and system are testing.
Correctness testing
Correctness is the minimum requirement of software, the essential purpose of
testing. Correctness testing will need some type of oracle, to tell the right
behaviour from the wrong one. The tester may or may not know the inside
details of the software module under test, e.g., control flow, data flow, etc.
Therefore, either a white-box point of view or black-box point of view can be
taken in testing software. We must note that the black box and white-box
ideas are not limited in correctness testing only.
Black-box testing
The black-box approach is a testing method in which test data are derived from
the specified functional requirements without regard to the final program
structure It is also termed data-driven, input/output driven or requirements-
based testing. Because only the functionality of the software module is of
concern, black box testing also mainly refers to functional testing -- a testing
method emphasized on executing the functions and examination of their input
and output data. The tester treats the software under test as a black box --
only the inputs, outputs and specification are visible and the functionality are
determined by observing the outputs to corresponding Inputs. In testing,
various inputs are exercised and the outputs are compared against
specification to validate the correctness. All test cases are derived from the

136 | P a g e
specification. No implementation details of the code are considered. It is
obvious that the more we have covered in the input space, the more problems
we will find and therefore we will be more confident about the quality of the
software. Ideally would be tempted to exhaustively test the input space. But as
stated above, exhaustively testing the combinations of valid inputs will be
impossible for most of the programs, let alone considering invalid inputs,
timing, sequence, and resource variables. Combinatorial Explosion is the major
roadblock in functional testing. To make things worse, we can never be sure
whether the specification is either correct or complete. Due to limitations of
the language used in the specifications (usually natural language), ambiguity is
often inevitable. Even if we use some type of formal or restricted language, we
may still fail to write down all the possible cases in the specification.
Sometimes, the specification itself becomes an intractable problem: it is not
possible to specify precisely every situation that can be encountered using
limited words. And people can seldom specify clearly what they want -- they
usually can tell whether a prototype is, or is not, what they want after they
have been finished. A specification problem contributes approximately 30
percent of all bugs in software. The research in black box testing mainly
focuses on how to maximize the effectiveness of testing with minimum cost,
usually the number of test cases. It is not possible to exhaust the input space,
but it is possible to exhaustively test a subset of the input space. Partitioning is
one of the common techniques. If we have partitioned the input space and
assume all the input values in a partition is equivalent, then we only need to
test one representative value in each partition to sufficiently cover the Whole
input space. Domain testing partitions the input domain into regions, and
considers the input values in each domain an equivalent class. Domains can be
exhaustively tested and covered by selecting a representative value(s) in each
domain. Boundary values are of special interest. Experience shows that test
cases that explore boundary conditions have a higher payoff than test cases
that do not. Boundary value analysis requires one or more boundary values
selected as representative test cases. The difficulties with domain testing are
that incorrect domain definitions in the specification cannot be efficiently
discovered. Good partitioning requires knowledge of the software structure. A
good testing plan will not only contain black-box testing, but also white-box
approaches, and combinations of the two.
White-box testing
Contrary to black box testing, software is viewed as a white-box, or glass-box in
white-box testing, as the structure and flow of the software under test are
visible to the tester. Testing plans are made according to the details of the

137 | P a g e
software implementation, such as programming language, logic, and styles.
Test cases are derived from the program structure. White-box testing is also
called glass-box testing, logic-driven testing or design-based testing. There are
many techniques available in white-box testing, because the problem of
intractability is eased by specific knowledge and attention on the structure of
the software under test. The intention of exhausting some aspect of the
software is still strong in white-box testing, and some Degree of exhaustion can
be achieved, such as executing each line of code at least once (statement
coverage), traverse every branch statement (branch coverage), or cover all the
possible combinations of true and false condition predicates (Multiple
condition coverage). Control-flow testing, loop testing, and data-flow testing,
all maps the corresponding flow structure of the software into a directed
graph. Test cases are carefully selected based on the criterion that all the
nodes or paths are covered or traversed at least once. By doing so we may
discover unnecessary "dead" code - code that is of no use, or never get
executed at all, which cannot be discovered by functional testing. In mutation
testing, the original program code is perturbed and many mutated programs
are created, each contains one fault. Each faulty version of the program is
called a mutant. Test data are selected based on the effectiveness of failing the
mutants. The more mutants a test case can kill, the better the test case is
considered. The problem with mutation testing is that it is too computationally
expensive to use. The boundary between black-box approach and white-box
approach is not clear-cut. Many testing strategies mentioned above, may not
be safely classified into black box testing or white-box testing. It is also true for
transaction-flow testing, syntax testing, finite-state testing, and many other
testing strategies not discussed in this text. One reason is that all the above
techniques will need some knowledge of the specification of the software
under test. Another reason is that the idea of specification itself is broad -- it
may contain any requirement including the structure, Programming language,
and programming style as part of the specification content. We may be
reluctant to consider random testing as a testing technique. The test case
selection is simple and straightforward: they are randomly chosen. Study in
indicates that random testing is more cost effective for many programs. Some
very subtle errors can be discovered with low cost. And it is also not inferior in
coverage than other carefully designed testing techniques. One can also obtain
reliability estimate using random testing results based on operational profiles.
Effectively combining random testing with other testing techniques may yield
more powerful and cost-effective testing strategies.
Performance testing

138 | P a g e
Not all software systems have specifications on performance explicitly. But
every system will have implicit performance requirements. The software
should not take infinite time or infinite resource to execute. "Performance
bugs" sometimes are used to refer to those design problems in software that
cause the system performance to degrade. Performance has always been a
great concern and a driving force of computer evolution. Performance
evaluation of a software system usually includes: resource usage, throughput,
and stimulus-response time and queue lengths detailing the average or
maximum number of tasks waiting to be serviced by selected resources.
Typical resources that need to be considered include network bandwidth
requirements, CPU cycles, disk space, disk access operations, and memory
usage. The goal of performance testing can be Performance bottleneck
identification, performance comparison and evaluation, etc. The typical
method of doing performance testing is using a benchmark – a program,
workload or trace designed to be representative of the typical system usage.
Reliability testing
Software reliability refers to the probability of failure-free operation of a
system. It is related to many aspects of software, including the testing process.
Directly estimating software reliability by quantifying its related factors can be
difficult. Testing is an effective sampling method to measure software
reliability. Guided by the operational profile, software testing (usually black-
box testing) can be used to obtain failure data, and an estimation model can be
further used to analyse the data to estimate the present reliability and predict
future reliability. Therefore, based on the estimation, the developers can
decide whether to release the software, and the users can decide whether to
adopt and use the software. Risk of using software can also be assessed based
on reliability information. Advocates that the primary goal of testing should be
to measure the dependability of tested software. There is agreement on the
intuitive meaning of dependable software: it does not fail in unexpected or
catastrophic ways. Robustness testing and stress testing are variances of
reliability testing based on this simple criterion. The robustness of a software
component is the degree to which it can function correctly in the presence of
exceptional inputs or stressful environmental conditions. Robustness testing
differs with correctness testing in the sense that the functional correctness of
the software is not of concern. It only watches for robustness problems such as
machine crashes, process hangs or abnormal termination. The oracle is
relatively simple; therefore, robustness testing can be made more portable
and scalable than correctness testing. This research has drawn more and more
interests recently, most of which uses commercial operating systems as their

139 | P a g e
target, such as the work in Stress testing, or load testing, is often used to test
the whole system rather than the software alone. In such tests the software or
system are exercised with or beyond the Specified limits. Typical stress
includes resource exhaustion, bursts of activities, and sustained high loads.
Security testing
Software quality, reliability and security are tightly coupled. Intruders to open
security holes can exploit flaws in software. With the development of the
Internet, software security problems are becoming even more severe. Many
critical software applications and services have integrated security measures
against malicious attacks.

Maintenance
Maintenance is a very important task & is poorly managed. Times spent and
effort required in maintaining software and keeping it operational takes about
40% to 70% of the total cost of the life cycle.
“Software maintenance is the activity that includes error corrections,
enhancements of capabilities, deletion of obsolete capabilities and
optimization.” Basically, any work done to change the software after it is in
operation is considered to be maintenance. Its purpose is to preserve the value
of the software.
Corrective Maintenance
It means modifications made to the software to correct the defects. Defects
can result from design errors, logic errors, coding errors, data processing errors
and system performance errors.
Adaptive Maintenance
It includes modifying the software to match changes in the ever-changing
environment. Environment refers to the totality of all conditions and
influences which act from outside upon the software. E.g. business rules,
government policies, work patterns and software/hardware operating
platforms.
Perfective Maintenance
It means improving processing efficiency or performances, or restructuring the
Software to improve changeability.

140 | P a g e
Process
The process of maintenance for given software can be divided into four stages
as follows:
• Program understanding: It consists of analysing the program in
order to understand it. The ease of understanding the program is
primarily affected by complexity and documentation of the
program.
• Generate particular maintenance proposal: The ease of
generating the maintenance proposal is primarily affected by
extensibility of the program.
• Account for ripple effect: If any change is made to any part of the
system, it may affect the other parts also. Thus, there is a kind of
ripple effect from the location of modification to the other parts
of the software. The primary feature affecting the ripple effect is
stability.
• Modified program testing: The modified program is to be tested
again and again to check that the software has enhanced and
reliability is validated.

Models
The models that present for the maintenance of the software are –
• Quick-Fix Model
• Iterative Enhancement Model
• Reuse Oriented Model
• Boehm’s Model

141 | P a g e
RESULTS AND DISCUSSION

After the project implementation has been completed, the website is ready to
be accessed by customers. With this, we have come across the benefits and
limitations of our online grocery shopping system.

Benefits of the system:


• Customers can access the website anywhere, be it their home, their
workplace, or any other location.
• Our website provides service 24/7, so time does not act as a barrier.
• Our website saves shoppers time because customers do not have to
stand in queues in cash counters to pay for the products they have
purchased.
• The website is easy to use, thus allowing customers to search for items
and purchase them without any difficulty.
• Price comparisons are made possible.
• The wide range of available products provides the choice for customers
to seek and buy the best product available.
• Online shopping saves money. Due to elimination of maintenance, real-
estate cost, products can be sold with discount offers.

Limitations of the system:


• We are implementing the option to pay by online payment methods,
because right now, we have only made available the cash-on-delivery
payment option.
• There is the lack of touch and feel of the products in online shopping,
which could take away the feeling of assurance about a product from a
customer. However, our products are properly pictured and all details
regarding each product are mentioned so that customers can have a
view of the product even if it is not in person.
• An amazing aspect of hands-on shopping at stores and malls is a chance
to interact with different people, meet friends for shopping. The
traditional shopping exercise also involves fun experiences in the form of
show-room atmosphere, smart sales attendants, scent and sounds,
142 | P a g e
which disappear with a full onset of online shopping. But our website
has interesting visuals and detailed information, so customers can buy
products they need, and also learn about items that they may be
purchasing for the first time.

143 | P a g e
CONCLUSION

The basic build-up of our project has been completed. However, we will
continue working on the website to include additional services for customers
to avail in the future.

Future Scope
We hope to add more features to the system in the future, which will provide
more benefits to the customers, leading to better customer service, more
exposure for the website and growth in business.
• We are going to provide the online payment methods for customers
very soon, alongside the existing cash-on-delivery payment method.
• The website shall include house help services, and the contact details of
technicians for repairing home appliances.
• The website shall include a blog where dieticians shall suggest suitable
grocery products on the website, so shoppers can also get advice for
following a healthy diet.
• Discount offers shall be given to the customers depending on the total
amount of purchase made at one time. This can be extended in order to
make available more offers, which will be profitable to customers
according to the products they will have purchased.

We will continuously strive to come up with new and better upgrades for the
existing features of the system to provide better customer experience. Our
goal is to expand our customer base by providing a wider range of products.
We hope this endeavour of ours will be helpful for our customers and make
their life a little bit easier during this difficult time. We aim to continue
providing our support and services to our valuable customers and have a long
journey, together.

144 | P a g e
REFERENCES
Books

1. “Database System Concepts” by Abraham Silberschatz, Henry F. Korth, S.


Sudarshan
2. “Fundamentals of Software Engineering” by Rajib Mall

Websites

1. www.google.com
2. www.wikipedia.org
3. www.w3schools.com
4. www.tutorialspoint.com

145 | P a g e
Thank you

146 | P a g e

You might also like