Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 82

ABSTRACT

Online Organic Fertilizer Portal is the web application that will help the farmers to

perform the best farming and leading to achieve success and increase in their standard of living.

An Authorized-agent would serve as a way for the farmers to sell their fertilizer product in the

market. To facilitate remote area farmers to buy Organic fertilizer, there is a need to build an

online agriculture fertilizer store. Through the Internet, customers and business owners can

communicate with each other, share a different type of information and resources. In this project,

we will build a user-friendly website in order to buy and sell organic agriculture fertilizer online.

The main purpose to build this store is to facilitate farmers to buy pesticides, and fertilizers from

anywhere through internet connectivity.


CHAPTER-1

1.INTRODUCTION

1.1 Introduction
Online Organic Fertilizer Portal is fast gaining ground as an accepted and used business
paradigm. More and more business houses are implementing web sites providing functionality
for performing commercial transactions over the web. It is reasonable to say that the process of
shopping on the web is becoming commonplace. The objective of this project is to develop a
general purpose e-commerce store where any product (such as books, CDs, computers, mobile
phones, electronic items, and home appliances) can be bought from the comfort of home through
the Internet. However, for implementation purposes, this paper will deal with an online book
store. An online store is a virtual store on the Internet where customers can browse the catalog
and select products of interest. The selected items may be collected in a shopping cart. At
checkout time, the items in the shopping cart will be presented as an order. At that time, more
information will be needed to complete the transaction. Usually, the customer will be asked to
fill or select a billing address, a shipping address, a shipping option, and payment information
such as credit card number. An e- mail notification is sent to the customer as soon as the order is
placed. Natural composting is recommended for the production of organic fertilizer due to low
expenses and higher economic return though production was higher in the IMO applied
composting. Further research on other composting methods in long-run production to lower the

expenses is also advised. Garbage and other waste materials have been seen to any places.

Garbage and other waste materials have been seen to any places. Waste materials are
classified as biodegradable and non-biodegrade. To address the problem in wastes disposal,
waste segregation is implemented including the 3R’s government program which are reduce,
reuse and recycle. Non-biodegrade wastes have been reused and recycled to reduce its volume.
On the other hand, composting is one of the measures conducted to reduce the volume of
biodegrade wastes and recycled it into fertilizers as soil conditioner and improved soil fertility
to produce healthy and productive plants. Composting is a process where there is an
accelerated bio-oxidation of different organic matters that pass through a thermophilic stage
and microorganisms liberate heat, carbon dioxide and water . Heterogeneous mixtures of
these organic matters are transformed into a homogeneous and stabilized product of humus,
called organic fertilizer. Natural composting is a process of composting whereby wastes are
piled up and let natural decomposition takes place. This is usually done in the compost pit,
thus other called this method pit composting. During this process, both thermophilic and
mesophilic microorganisms transform the organic materials into a stabilized and sanitized
humus, where thermophilic microorganisms sanitized the organic materials and mesophilic
microorganisms degrade the materials in slower pace, . The process in natural composting is
too long since most of the biodegradable materials are not cut into smaller pieces for easy
decomposition. There are different methods employed to hasten decomposition of composting
materials. Indigenous Microorganisms (IMO) from rice fermentation technique is widely used
and easily adopted by farmers since rice as culture media for microbes are placed under the
bushes or bamboo trees and no need to do laboratory inoculation for microorganisms .
Carbohydrate from rice is the main carbon source for the multiplication of these
microorganisms. The microorganisms found in IMO believed to hasten decomposition and
improved the nutrient content of the decomposed materials once it is applied. IMO is a beneficial
soil microorganisms of filamentous fungi, yeasts and bacteria that could

1.2 About the Project

Online Organic Fertilizer Portal is fast gaining ground as an accepted and used business
paradigm. More and more business houses are implementing web sites providing functionality
for performing commercial transactions over the web. It is reasonable to say that the process of
Fertilizer shopping on the web is becoming common place.‘Customer is our god’ mainly this
website is based on this formula. After chosen items he bought into Pay pal process like VISA
or MASTER credit cards or any Debit cards are accepted in this website. Customer is happily
shopping at his rest place.Once customer entered with his own username and password, at that
time automatically one shopping cart will be created, once user select an item it will add to cart.
In case user thinks the selected item is not useful for me, then deleted that item from shopping
cart.Customer selected some items, but in his credit or debit cart haven’t that much balance, then
he was logout from the website, the selected items are stored at cart with specific users with his
allotted carts, after some days he bought those items then automatically deleted from the cart.
1.3 Organization Profile

Inderchaap Technologies is an independent company of multi-disciplinary experts with


a vision to empower clients with enriching and inspiring solutions. We have helped clients
conquer the digital frontier in an ever-changing online landscape and offer exceptional service
tailored to your brand and needs. With rich capabilities in design, development, SEO, content
writing, printing and advertising, we are proud to be a leading web design agency in Chennai
offering holistic and enduring solutions.

Our vision is to help all businesses irrespective of scale and size establish an online
presence and use the power of the Internet and achieve growth. Empowered businesses lead to
employment and growth opportunities thereby creating a world where all individuals have a
chance to succeed and showcase their relent and abilities. Further, even if a company wants to
enhance their offerings and achieve the fullest potential of their existing setup, we are here to
help them zoom to the next level!

We have built a multidisciplinary portfolio of working with diverse Industry of different


tiers. Our highly talented and passionate team are experts in the areas of software and
application development that includes the portal development in the e-commerce market, Web-
based Application development, Web development, and Mobile App development. Combining
our vast experience and skills, we strive to relinquish cost-effective and tangible solutions in
the simplest form taking care of our client’s every requirement. The following are some of the
Industries we have served, Health & Fitness, Shopping & E-commerce, Media &
Entertainment, Hospitality & Tourism, Banking & Finance, Automobile Industries,
Government, Shipping & Logistics with our unmatchable software development solutions.We
handle all our client's project in a meticulous manner right from gathering requirements,
researching, designing, developing, to the final handover that blends with Industry flair
practices.
CHAPTER-2

2. SYSTEM ANALYSIS

2.1 Existing System

Existing system is a manual one in which users are maintaining books to store the information
like product details, purchases, sales details and accounts for every month. It is very difficult to
maintain historical data.

Disadvantages:

The following are the disadvantages of the existing system

 It is difficult to maintain important information in books.


 More manual hours need to generate required reports.
 It is tedious to manage historical data which needs much space to keep all the previous
years’ ledgers, books etc.
 Daily sales and purchases details must be entered into books are very difficult to
maintain.

2.2 Proposed System


The Online organic fertilizer Shopping System will manage the items on the web and
provide products to the customer online without a physically appearance of that customer. The
system will contain all the items in one place, so users need not to go to the different shop. As
the online organic fertilizer Shopping System is web based so the distant user from the shop can
also get the item and the vendor can cover the wide place to sell. A user can choose from the
different fertilizer products, can make online payments and will get the products at the doorstep.
This will reduce the time consumption in the purchase of different items, make the system
efficient and user-friendly.

2.3 Feasibility Studies


Preliminary investigation examine project feasibility, the likelihood the system will be
useful to the organization. The main objective of the feasibility study is to test the Technical,
Operational and Economical feasibility for adding new modules and debugging old running
system. All system is feasible if they are unlimited resources and infinite time. There are aspects
in the feasibility study portion of the preliminary investigation:

 Technical Feasibility
 Operation Feasibility
 Economical Feasibility

2.3.1. Technical Feasibility

Earlier no system existed to cater to the needs of ‘Secure Infrastructure Implementation


System’. The current system developed is technically feasible. It is a web based user interface for
audit workflow at NIC-CSD. Thus it provides an easy access to the users. The database’s
purpose is to create, establish and maintain a workflow among various entities in order to
facilitate all concerned users in their various capacities or roles. Permission to the users would be
granted based on the roles specified. Therefore, it provides the technical guarantee of accuracy,
reliability and security.

2.3.2. Operational Feasibility


Proposed projects are beneficial only if they can be turned out into information system.
That will meet the organization’s operating requirements. Operational feasibility aspects of the
project are to be taken as an important part of the project implementation.
This system is targeted to be in accordance with the above-mentioned issues. Beforehand,
the management issues and user requirements have been taken into consideration. So there is no
question of resistance from the users that can undermine the possible application benefits.

2.3.3. Economic Feasibility


A system can be developed technically and that will be used if installed must still be a good
investment for the organization. In the economical feasibility, the development cost in creating
the system is evaluated against the ultimate benefit derived from the new systems. Financial
benefits must equal or exceed the costs.
The system is economically feasible. It does not require any addition hardware or
software. Since the interface for this system is developed using the existing resources and
technologies available at NIC, There is nominal expenditure and economical feasibility for
certain.
CHAPTER-3

3. SYSTEM SPECIFICATION
3.1 Hardware Requirment

System : Pentium IV 2.4 GHz.


Hard Disk : 40 GB.
Floppy Drive : 1.44 Mb.
Monitor : 15 VGA Colour.
Mouse : Logitech.
Ram : 512 Mb.

3.2 Software Requirment

Operating System :  Windows XP or later


Database Server :  MySQL 5.0
Client :  Microsoft Internet Explorer
User Interface :  HTML with Ajax
Code Behind :  PHP
CHAPTER-4

4.SOFTWARE DESCRIPTION

4.1 Windows 10
Windows 10 is a major release of Microsoft's Windows NT operating system. It is the
direct successor to Windows 8.1, which was released nearly two years earlier. It was released to
manufacturing on July 15, 2015, and later to retail on July 29, 2015. Windows 10 was made
available for download via MSDN and TechNet, as a free upgrade for retail copies of Windows 8
and Windows 8.1 users via the Windows Store, and to Windows 7 users via Windows Update.
Windows 10 receives new builds on an on going basis, which are available at no additional cost
to users, in addition to additional test builds of Windows 10, which are available to Windows
Insiders. Devices in enterprise environments can receive these updates at a slower pace, or use
long-term support milestones that only receive critical updates, such as security patches, over
their ten-year lifespan of extended support. Windows 10 received generally positive reviews
upon its original release. Critics praised Microsoft's decision to provide the desktop-oriented
interface in line with previous versions of Windows, contrasting the tablet-oriented approach of
Windows 8, although Windows 10's touch-oriented user interface mode was criticized for
containing regressions upon the touch-oriented interface of its predecessor. Critics also praised
the improvements to Windows 10's bundled software over Windows 8.1, Xbox Live integration,
as well as the functionality and capabilities of the Cortana personal assistant and the replacement
of Internet Explorer with Microsoft Edge. However, media outlets have been critical of the
changes to operating system behaviors, including mandatory update installation, privacy
concerns over data collection performed by the OS for Microsoft and its partners, and adware-
like tactics used to promote the operating system on its release. Microsoft initially aimed to have
Windows 10 installed on over one billion devices within three years of its release that goal was
ultimately reached almost five years after release on March 16, 2020. By January 2018,
Windows 10 surpassed Windows 7 as the most popular version of Windows worldwide As of
April 2022, Windows 10 is estimated to have a 75% share of Windows PCs (has been declining
since its Jan. 2022 peak of 82%, because of introduction of its successor Windows 11, which is
now 2nd most popular Windows edition in many countries), or 57% of all PCs (the rest being
other Windows editions and other operating systems such as macOS and Linux), and 23% of all
devices (including mobile, tablet and console) are running Windows 10. On June 24, 2021,
Microsoft announced Windows 10's successor, Windows 11, which was released on October 5,
2021
Windows 10 is the final version of Windows which supports 32-bit processors (IA-32 and
ARMv7-based) and devices with BIOS firmware. Its successor, Windows 11, requires a device
that uses UEFI firmware and a 64-bit processor in any supported architecture (x86-64 and
ARMv8), though certain workarounds exist that can be used to install it on devices with legacy
BIOS firmware.

4.2 Apache
Apache server is one of the most popular Web service applications. Apache is a powerful,
flexible, HTTP/1.1 compliant web server. It is highly configurable and extensible with third-
party modules. Users can further customize Apache by writing modules using the Apache
module. Apache implements the following features:

Database Management (DBM) databases for authentication that allows the user to set up
password-protected pages with large numbers of authorized users, without bogging down the
server.

Customized responses to errors and problems which allows you to set up files, or even CGI
scripts, which are returned by the server in response to errors and problems

Unlimited flexible URL rewriting and aliasing meaning Apache has no fixed limit on the
numbers of Aliases and Redirects which may be declared in the config files. In addition, a
powerful rewriting engine can be used to solve most URL manipulation problems.

Virtual Hosts which are often referred to as multi-homed servers. This allows the server to
distinguish between requests made to different IP addresses or names (mapped to the same
machine). Apache also offers dynamically configurable mass-virtual hosting.

Apache can be configured to generate reliable piped logs, such as an error log. In addition, on
most UNIX architectures, Apache can send log files to a pipe, allowing for log rotation, hit
filtering, real-time splitting of multiple vhosts into separate logs, and asynchronous DNS
(Domain Naming Service) resolving on the fly.

4.3 PHP

PHP is a server-side and general-purpose scripting language that is especially suited for web
development.PHP originally stood for Personal Home Page. However, now, it stands for
Hypertext Preprocessor. It’s a recursive acronym because the first word itself is also an acronym.
PHP was created by Rasmus Lerdorf in 1994. It’s currently maintained by the PHP Development
Team. PHP is a server-side language When you open a website on your web browser, for The
web browser sends an HTTP request to a web server where phptutorial.net locates. The web
server receives the request and responds with an HTML document.In this example, the web
browser is a client while the web server is the server. The client requests for a page, and the
server serves the request.PHP runs on the web server, processes the request, and returns the
HTML document.PHP is a general-purpose language When it comes to the purpose of the
programming languages, there are two main types: domain-specific and general-purpose
languages.The domain-specific languages are used within specific application domains. For
example, SQL is a domain-specific language. It’s used mainly for querying data from relational
databases. And SQL cannot be used for other purposes.On the other hand, PHP is a general-
purpose language because PHP can develop various applications.PHP is a cross-platform
language PHP can run on all major operating systems, including Linux, Windows, and macOS.
You can use PHP with all leading web servers such as Nginx, OpenBSD, and Apache. Some
cloud environments also support PHP like Microsoft Azure and Amazon AWS.PHP is quite
flexible. It’s not just limited to processing HTML. PHP has built-in support for generating PDF,
GIF, JPEG, and PNG images.One notable feature of PHP is that it supports many databases,
including MySQL, PostgreSQL, MS SQL, db2, Oracle Database, and MongoDB.

What can PHP do

PHP has two main applications:

 Server-side scripting – PHP is well-suited for developing dynamic websites and web
applications.
 Command-line scripting – like Python and Perl, you can run PHP script from the
command line to perform administrative tasks like sending emails and generating PDF
files.

Since PHP is designed for the web in the first place, it brings many advantages to web
development:

 Simple – PHP is quite easy to learn and get started.


 Fast – PHP websites typically run very fast.
 Stable – PHP is stable since it has been in existence for a long time.
 Open-source and free – PHP is open source and free. It means that you don’t have to pay
a license fee to use PHP to develop software products.
 Community support – PHP has an active online community that helps you whenever you
face an issue.

Common uses of PHP

 PHP performs system functions, i.e. from files on a system it can create, open, read,
write, and close them.
 PHP can handle forms, i.e. gather data from files, save data to a file, through email you
can send data, return data to the user.
 You add, delete, modify elements within your database through PHP.
 Access cookies variables and set cookies.
 Using PHP, you can restrict users to access some pages of your website.
 It can encrypt data.

Characteristics of PHP

Five important characteristics make PHP's practical nature possible −

 Simplicity

 Efficiency

 Security

 Flexibility

 Familiarity

PHP | Unique Features

As PHP can do anything related to server-side programming which contains the backend of any
web page, it holds a lot of unique features within it. The main purpose of PHP design is web
development.

Let us look into some of the unique features of PHP:

Simple, Familiar and ease of use: Its popularly known for its simplicity, familiarity and easy to
learn the language as the syntax is similar to that of ‘C’ or Pascal language. So the language is
very logical and well organized general-purpose programming language. Even people with a
normal programming background can easily understand and capture the use of language. PHP is
very advantageous for new users as its a very reliable, fluent, organized, clean, demandable and
efficient.The main strength of PHP is the availability of rich pre-defined functions. The core
distribution helps the developers implement dynamic websites very easily with secured data.
PHP applications are very easy to optimize.Loosely typed language: PHP encourages the use of
variables without declaring its data types. So this is taken care at the execution time depending
on the value assigned to the variable. Even the variable name can be changed dynamically.
Flexibility:

PHP is known for its flexibility and embedded nature as it can be well integrated with HTML,
XML, Javascript and many more. PHP can run on multiple operating systems like Windows,
Unix, Mac OS, Linux, etc. The PHP scripts can easily run on any device like laptops, mobiles,
tablets, and computer. It is very comfortably integrated with various Databases. Desktop
applications are created using advanced PHP features. The executable PHP can also be run on
command-line as well as directly on the machine. Heavyweight applications can be created
without a server or browser.It also acts as an excellent interface with relational databases.

Open Source

All PHP frameworks are open sources, No payment is required for the users and its completely
free. User can just download PHP and start using for their applications or projects. Even in
companies, the total cost is reduced for software development providing more Reliability and
flexibility. It supports a popular range of databases like MySQL, SQLite, Oracle, Sybase,
Informix, and PostgreSQL. PHP provides libraries to access these databases to interact with web
servers. Developers are free to post errors, inspect codes and can contribute to code as well as
bug fixing. Many frameworks like Codeignitor, Zend Framework, CakePHP make use of PHP.
Even many popular content management systems like WordPress, Joomla and Drupal use PHP
as prime language. Because of the above reasons many web hosting companies and Internet
Service providers prefers PHP. Cross-platform compatibility: PHP is multi-platform and known
for its portability as it can run on any operating System and windows environments. The most
common are XAMPP (Windows, Apache Server, MySQL, Perl, and PHP) and LAMP (Linux,
Apache, MySQL, PHP). As PHP is platform-independent, it’s very easy to integrate with various
databases and other technologies without re-implementation. It effectively saves a lot of energy,
time and money. Error reporting and exceptions: PHP supports much errors reporting constants
to generate errors and relevant warnings at run time. For example E_ERROR, E_WARNING,
E_PARSE, E_STRICT. PHP5 supports exception handling which is used to throw errors which
can be caught at any time.

Active community support: PHP is very rich with many diverse online community developers to
help beginners for web-based applications. These worldwide volunteers contribute many features
as well as new versions for PHP libraries. Even they contribute a translation in different
languages to help out programmers. There is a bundle of third-party open-source libraries which
provide basic functionalities. Even the documentation given by the official site helps in
implementing new features providing access to a variety of creative imagination. Fast and
efficient performance: Users generally prefer fast loading websites. For any web development,
speed becomes an important aspect which is taken care of by PHP.

PHP scripts are faster than other scripting languages like ASP.NET, PERL, and JSP. The
memory manager of PHP 7 is very optimized and fast as compared to older versions of PHP.
Even connecting to the database and loading of required data from tables, are faster than other
programming languages. It provides a built-in module for easy and efficient database
management system. The high speed of PHP is advantageous for users for its server
administration and mail functionality. Also, it supports session management and removing of
unwanted memory allocation.

Maintenance

When dealing with big projects, maintenance of code is also an important aspect of the web
development process. There are many PHP frameworks for example MVC (Model View
Controller) which makes development and maintenance of code easier. Files belonging to the
different module are maintained separately. Third-party application support and security: Many
PHP’s predefined functions support data encryption options keeping it more secure. Even the
users can use third-party applications to secure data.Real time access monitoring: PHP also
provides a summary of user’s recent logging accesses. Memory and CPU usage information:
PHP can provide memory usage information from functions like memory_get_usage() or
memory_get_peak_usage(), which can help the developers optimize their code. In the similar
way, the CPU power consumed by any script can be retrieved for further optimization.

Object oriented features: PHP supports object-oriented programming features, resulting in


increased speed and introducing added features like data encapsulation and inheritance at many
levels. Magic Constants: PHP provides many built-in magic methods starting with __(double
underscore) which are called during specific events.

For example directory path

(__DIR__), class name (__CLASS__), namespace (__NAMESPACE__), function name


(__FUNCTION__), method name (__METHOD__), line number (__LINE__), file path
(__FILE__).

Regular expression:

PHP provides regular expression functions with parsing and pattern matching methods.

PDO Class: PHP Data Objects are created by PDO class which gives a good abstraction layer for
database drivers. The PDO Classes are enriched with functions which are database independent.
It means the same functions are used for similar actions for different databases without re-
development as long as it supports PDO. In this way, the application becomes more portable
saving lot of time and effort. Use of PDO helps the application from SQL injection attacks.

Additional Features:

The feature list is endless. The other features of PHP are manipulation of images using GD
library, make remote connections using cURL, handling file system, managing user sessions,
track sessions, Use of SimpleXML Class which reads and write XML files through objects,
support of cookies and sessions, shell command-line execution, compression of ZIP archives, use
of Ajax.
4.4 MYSQL

The Structured Query Language (SQL) is the language of databases. SQL was, is, and will
stay for the foreseeable future the database language for relational database servers such as IBM
DB2, Microsoft SQL Server, MySQL, Oracle, Progress, Sybase Adaptive Server, and dozens of
others. SQL supports a small but very powerful set of statements for manipulating, managing,
and protecting data stored in a database. This power has resulted in its tremendous popularity.
Almost every database server supports SQL or a dialect of the language. Currently, SQL
products are available for every kind of computer, from a small handheld computer to a large
server, and for every operating system, including Microsoft Windows, Mac and many UNIX
variations. Structured Query Language (SQL) is a relational database language which allows you
to create, delete, access and manipulate databases. The following is a list of the main operations
that can be formulated with SQL:

 creating new databases


 deleting a database
 creating new tables in a database
 deleting tables from a database
 creating and removing users (database access control)
 executing queries against a database
 retrieving data from a database
 inserting records in a database
 updating records in a database
 deleting records from a database
 creating stored procedures in a database
 setting permissions on tables and procedures
 creating relationships between tables
MySQL is a Relational Database Management System (“RDBMS”). It is used by most
modern websites and web-based services as a convenient and fast-access storage and retrieval
solution for large volumes of data. A simple example of items which might be stored in a
MySQL database would be a site-registered user’s name with associated password (encrypted for
security), the user registration date, and number of times visited, etc.
MySQL can also be accessed using many tools. It can be easily communicated with via PHP
(PHP Hypertext Preprocessor), a scripting language whose primary focus is to manipulate
HTML for a webpage on the server before it is delivered to a client’s machine. A user can submit
queries to a database via PHP, allowing insertion, retrieval and manipulation of information
into/from the database.

Structured Query Language (SQL) is the de-facto standard programming language for
creating, updating and retrieving information that is stored in relational database management
system. A relational database is a database divided into logical units called tables, where tables
are related to one another within the database. A relational database allows large complex data to
be broken down into logical, smaller, more manageable units. Tables are related to each other
through a common key (data value) in a relational database. SQL is a formal programming
language. Speed was he developer’s main focus when SQL was being developed.

MySQL is a fast easy to use RDMS. MySQL is easier to install and use than its commercial
competitors and the fact that MySQL is open source is strongly in its favor. MySQL is available
via the General Public License (GPU). MySQL consists of a MySQL server, several utility
programs that assist the administration of the MySQL databases. MySQL’s main advantages
include the following:

 It is pre-packaged with most Linux distributions


.
 It’s quite easy to use: you can interact with a MySQL database using a few simple
statements from the SQL language.
 It’s very fast: MySQL’s developers’ main goal was speed; consequently the software was
designed from the beginning with speed in mind.

 It’s free via the GNU General Public License.

4.5 HTML
Hypertext Markup Language (HTML) is the standard markup language for creating web
pages and web applications. With Cascading Style Sheets (CSS) and JavaScript, it forms a triad
of cornerstone technologies for the World Wide Web.

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.

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 denoting structural semantics for text such as
headings, paragraphs, lists, links, quotes and other items.

4.6 Bootstrap

Bootstrap is a free and open-source front-end framework for designing websites and web


applications. It contains HTML- and CSS-based design templates for typography, forms, buttons,
navigation and other interface components, as well as optional JavaScript extensions. Unlike
many web frameworks, it concerns itself with front-end development only.

4.7 Java Script


JavaScript  often abbreviated as JS, is a high-level, interpreted programming language. It is a
language which is also characterized as dynamic, weakly typed, prototype-based and multi-
paradigm.

Alongside HTML and CSS, JavaScript is one of the three core technologies of the World Wide


Web. JavaScript enables interactive web pages and thus is an essential part of web applications.
The vast majority of websites use it, and all major web browsers have a dedicated JavaScript
engine to execute it.

4.8 Sublime Text

Sublime Text is a proprietary cross-platform source code editor with a Python application


programming interface (API). It natively supports many programming languages and markup
languages, and functions can be added by users with plugins, typically community-built and
maintained under free-software licenses.

4.9 Css

Cascading Style Sheets (CSS) is a style sheet language used for describing


the presentation of a document written in a markup language like HTML. CSS is a cornerstone
technology of the World Wide Web, alongside HTML and JavaScript.

CSS is designed to enable the separation of presentation and content,


including layout, colors, and fonts. This separation can improve content accessibility, provide
more flexibility and control in the specification of presentation characteristics, enable
multiple web pages to share formatting by specifying the relevant CSS in a separate css file, and
reduce complexity and repetition in the structural content.
CHAPTER-5
5. MODULE DESCRIPTION

5.1 MODULES:-

MODULES : This project contains two modules, those are

 Admin
 User

MODULES DESCRIPTION:

Admin Modules

This module provides administrator-related functionalities. The administrator manages the entire
application.

Dashboard: In this section, admin can briefly view the total orders, total new orders , total
packed orders , total dispatched orders , total in transit orders, total out for delivery orders, total
delivered, total cancelled and total registered users.

Category: In this section, admin can manage category of products(add/update/delete).

Subcategory: In this section, admin can manage subcategory of products (add/update/delete).

Products: In this section, admin can manage products (add/update/delete).


Orders: In this section, admin can view the mobile order details and they have also the right to
change order status according to current status.

Search Order: In this section, admin can search particular order with the help of the order
number.

Reports: In this section admin can view order details and sales reports according to dates.

Registered Users: In this section, the admin can view registered users.
Admin can also update his profile, change the password and recover the password.

User Module

1.Shop: In this section, users can view which products is available on the website

2.My Accounts: In this section, users can his/her password, view and update his/her profile and
log out from accounts.

3.My orders: In this section, users can view order history after login.

4.Cart: In this section, the user can add the products which he/she want to order.

5.Wishlist: In this section, the user can add products to the Wishlist.

6.The user has also a facility to download his/her invoice and cancel orders if he/she wants to
cancel.
5.2 DFD

5.2.1 DFD Level 1


5.2.2 Second Level DFD
5.2.3 USER DFD
5.3 SYSTEM FLOW DIAGRAM
5.4 ER DIAGRAM
5.5 DATABASE DESIGN
5.5.1 Table Name: Register

Fields Data types


(Constraints)
id Int(Primary,autoincrement)

name Varchar(50)

Email Varchar(50)

ContactNo Varchar(50)

Password Bigint(11)

regDate Timestamp

updationDate timestamp

5.5.2 Table Name: tblCategory

Fields Data types


(Constraints)
id Int(Primary,autoincrement)

CategoryName Varchar(50)

Description Vachar(120)

CreationDate TIMESTAMP

UpdationDate Timestamp

createdBy Int(11)

5.5.3 Table Name: tbladmin

Fields Data types


(Constraints)
id Int(Primary,autoincrement)

AdminName Varchar(50)

Username Varchar(150)

Mobilenumber Varchar(50)

Email Varchar(50)

Password Varchar(50)

AdminRegDate Varchar(50)

5.5.4 Table Name: tblsubcategory

Fields Data types


(Constraints)
id Int(Primary,autoincrement)

Categoryid Int(11)

subcategoryName Varchar(50)

CreationDate Timestamp

updationDate Varchar(250)

5.5.5 Table Name: tblproduct

Fields Data types


(Constraints)
Id Int(Primary,autoincrem
ent)
Category Int(11)

subcategory Int(11)
Productname Varchar(50)

Productprice Decimal(10,2)

Productpricebeforedisco Decimal(10,2)
unt
Description Varchar(50)

Image1 Varchar(50)

Image2 Varchar(50)

Image3 Varchar(50)

Shippingcharge Decimal(10,2)

productAvailability Varchar(50)

postingDate Date

updationDate Timestamp

addedBy Int(11)

5.5.6 Table Name: ordersdetails

Fields Data types


(Constraints)
id Int(Primary,autoincrement)

orderNumber Bigint(11)

Userid Int(11)

Productid Int(11)

Quantity Int(11)

orderDate Date

Orderstatus Varchar(56)
5.5.7 Table Name: ordertrackhistory

Fields Data types


(Constraints)
Id Int(Primary,autoincrement)

orderNumber Bigint(11)

userid Int(11)
Productid Int(11)
Quantity Int(11)

Orderdate Date

orderstatus Varchar(50)

5.5.8 Table Name: Addresses

Fields Data types


(Constraints)
Id Int(Primary,autoincrement)

Uderid Int(11)

billingAddress Varchar(50)

Billing City Varchar(50)

billingState Varchar(50)

billingCountry Varchar(50)

shippingAddress Varchar(50)

Shippingcity Varchar(50)

Shippingstate Varchar(50)

Shippingpincode Varcahr(50)

Shippingcountry Varchar(50)

Postingdate Varchar(50)
CHAPTER-6
6.CODING DESIGN
6.1 Index
<?php
session_start();
//error_reporting(0);
include("includes/config.php");
if(isset($_POST['submit']))
{
$username=$_POST['username'];
$password=md5($_POST['inputPassword']);
$ret=mysqli_query($con,"SELECT id FROM tbladmin WHERE username='$username' and
password='$password'");
$num=mysqli_fetch_array($ret);
if($num>0)
{
$_SESSION['alogin']=$_POST['username'];
$_SESSION['aid']=$num['id'];
header("location:dashboard.php");
}else{
echo "<script>alert('Invalid username or password');</script>";
//header("location:index.php");
}
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>Shopping Portal | Admin Login</title>
<link href="css/styles.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js"
crossorigin="anonymous"></script>
</head>
<body class="bg-primary">
<div id="layoutAuthentication">
<div id="layoutAuthentication_content">
<main>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-5">
<div class="card shadow-lg border-0 rounded-lg mt-5">
<div class="card-header"><h3 class="text-center font-weight-light my-
4">Shopping Portal | Admin Login</h3></div>
<div class="card-body">
<form method="post">
<div class="form-floating mb-3">
<input class="form-control" id="username" name="username"
type="text" placeholder="Username" required />
<label for="username">Username</label>
</div>
<div class="form-floating mb-3">
<input class="form-control" id="inputPassword"
name="inputPassword" type="password" placeholder="Password" required />
<label for="inputPassword">Password</label>
</div>

<div class="d-flex align-items-center justify-content-between mt-4


mb-0">
<a class="small" href="password-recovery.php">Forgot
Password?</a>
<button type="submit" name="submit" class="btn btn-
primary">Login</button>
</div>
</form>
</div>
<div class="card-footer text-center py-3">
<div class="small"><a href="../index.php">Back to Home
Page</a></div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<div id="layoutAuthentication_footer">
<?php include_once('includes/footer.php');?>
</div>
</div>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/scripts.js"></script>
</body>
</html>
Admin Dashboard

<?php session_start();
include_once('includes/config.php');
if(strlen( $_SESSION["aid"])==0)
{
header('location:logout.php');
} else {
//Dashboard COunt
$ret=mysqli_query($con,"select count(id) as totalorders,
count(if((orderStatus='' || orderStatus is null),0,null)) as neworders,
count(if(orderStatus='Packed', 0,null)) as packedorders,
count(if(orderStatus='Dispatched', 0,null)) as dispatchedorders,
count(if(orderStatus='In Transit', 0,null)) as intransitorders,
count(if(orderStatus='Out For Delivery', 0,null)) as outfdorders,
count(if(orderStatus='Delivered', 0,null)) as deliveredorders,
count(if(orderStatus='Cancelled', 0,null)) as cancelledorders
from orders;");
$results=mysqli_fetch_array($ret);
$torders=$results['totalorders'];
$norders=$results['neworders'];
$porders=$results['packedorders'];
$dtorders=$results['dispatchedorders'];
$intorders=$results['intransitorders'];
$otforders=$results['outfdorders'];
$deliveredorders=$results['deliveredorders'];
$cancelledorders=$results['cancelledorders'];
//COde for Registered users
$ret1=mysqli_query($con,"select count(id) as totalusers from users;");
$results1=mysqli_fetch_array($ret1);
$tregusers=$results1['totalusers'];
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>Shooping Portal | Admin Dashboard</title>
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css"
rel="stylesheet" />
<link href="css/styles.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js"
crossorigin="anonymous"></script>
</head>
<body class="sb-nav-fixed">
<?php include_once('includes/header.php');?>

<div id="layoutSidenav">
<?php include_once('includes/sidebar.php');?>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">Dashboard</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item active">Dashboard</li>
</ol>
<div class="row">
<div class="col-lg-6 col-xl-3 mb-4">
<div class="card bg-primary text-white h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div class="me-3">
<div class="text-white-75 small">Total Order</div>
<div class="text-lg fw-bold"><?php echo $torders; ?></div>
</div>
</div>
</div>
<div class="card-footer d-flex align-items-center justify-content-between
small">
<a class="text-white stretched-link" href="all-orders.php">View
Details</a>

</div>
</div>
</div>
<div class="col-lg-6 col-xl-3 mb-4">
<div class="card bg-danger text-white h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div class="me-3">
<div class="text-white-75 small">New Orders</div>
<div class="text-lg fw-bold"><?php echo $norders; ?></div>
</div>

</div>
</div>
<div class="card-footer d-flex align-items-center justify-content-between
small">
<a class="text-white stretched-link" href="new-order.php">View
Details</a>
</div>
</div>
</div>
<div class="col-lg-6 col-xl-3 mb-4">
<div class="card bg-warning text-white h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div class="me-3">
<div class="text-white-75 small">Packed Orders</div>
<div class="text-lg fw-bold"><?php echo $porders; ?></div>
</div>

</div>
</div>
<div class="card-footer d-flex align-items-center justify-content-between
small">
<a class="text-white stretched-link" href="packed-orders.php">View
Tasks</a>
</div>
</div>
</div>
<div class="col-lg-6 col-xl-3 mb-4">
<div class="card bg-secondary text-white h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div class="me-3">
<div class="text-white-75 small">Dispatched Orders</div>
<div class="text-lg fw-bold"><?php echo $dtorders; ?></div>
</div>

</div>
</div>
<div class="card-footer d-flex align-items-center justify-content-between
small">
<a class="text-white stretched-link" href="dispatched-
orders.php">View Requests</a>
</div>
</div>
</div>
</div>
<!-------------------------------------->
<div class="row">
<div class="col-lg-6 col-xl-3 mb-4">
<div class="card bg-warning text-white h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div class="me-3">
<div class="text-white-75 small">In Transit Orders</div>
<div class="text-lg fw-bold"><?php echo $intorders; ?></div>
</div>
</div>
</div>
<div class="card-footer d-flex align-items-center justify-content-between
small">
<a class="text-white stretched-link" href="intransit-orders.php">View
Details</a>

</div>
</div>
</div>
<div class="col-lg-6 col-xl-3 mb-4">
<div class="card bg-primary text-white h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div class="me-3">
<div class="text-white-75 small">Out for Delivery Orders</div>
<div class="text-lg fw-bold"><?php echo $otforders; ?></div>
</div>

</div>
</div>
<div class="card-footer d-flex align-items-center justify-content-between
small">
<a class="text-white stretched-link" href="outfordelivery-
orders.php">View Details</a>
</div>
</div>
</div>
<div class="col-lg-6 col-xl-3 mb-4">
<div class="card bg-success text-white h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div class="me-3">
<div class="text-white-75 small">Delivered Orders</div>
<div class="text-lg fw-bold"><?php echo $deliveredorders;
?></div>
</div>

</div>
</div>
<div class="card-footer d-flex align-items-center justify-content-between
small">
<a class="text-white stretched-link" href="delivered-orders.php">View
Details</a>
</div>
</div>
</div>
<div class="col-lg-6 col-xl-3 mb-4">
<div class="card bg-black text-white h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div class="me-3">
<div class="text-white-75 small">Registered Users</div>
<div class="text-lg fw-bold"><?php echo $tregusers; ?></div>
</div>

</div>
</div>
<div class="card-footer d-flex align-items-center justify-content-between
small">
<a class="text-white stretched-link" href="registered-users.php">View
Requests</a>
</div>
</div>
</div>
</div>
<!-------------->
<div class="row">
<div class="col-lg-6 col-xl-3 mb-4">
<div class="card bg-danger text-white h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div class="me-3">
<div class="text-white-75 small">Cancelled Orders</div>
<div class="text-lg fw-bold"><?php echo $cancelledorders;
?></div>
</div>
</div>
</div>
<div class="card-footer d-flex align-items-center justify-content-between
small">
<a class="text-white stretched-link" href="cancelled-orders.php">View
Details</a>
Add Product
<?php session_start();
include_once('includes/config.php');
if(strlen( $_SESSION["aid"])==0)
{
header('location:logout.php');
} else {

//For Adding Products


if(isset($_POST['submit']))
{
$category=$_POST['category'];
$subcat=$_POST['subcategory'];
$productname=$_POST['productName'];
$productcompany=$_POST['productCompany'];
$productprice=$_POST['productprice'];
$productpricebd=$_POST['productpricebd'];
$productdescription=$_POST['productDescription'];
$productscharge=$_POST['productShippingcharge'];
$productavailability=$_POST['productAvailability'];
$productimage1=$_FILES["productimage1"]["name"];
$productimage2=$_FILES["productimage2"]["name"];
$productimage3=$_FILES["productimage3"]["name"];
$extension1 = substr($productimage1,strlen($productimage1)-4,strlen($productimage1));
$extension2 = substr($productimage2,strlen($productimage2)-4,strlen($productimage2));
$extension3 = substr($productimage3,strlen($productimage3)-4,strlen($productimage3));
//Renaming the image file
$imgnewfile1=md5($productimage1.time()).$extension1;
$imgnewfile2=md5($productimage2.time()).$extension2;
$imgnewfile3=md5($productimage3.time()).$extension3;
$addedby=$_SESSION['aid'];

move_uploaded_file($_FILES["productimage1"]["tmp_name"],"productimages/".
$imgnewfile1);
move_uploaded_file($_FILES["productimage2"]["tmp_name"],"productimages/".
$imgnewfile2);
move_uploaded_file($_FILES["productimage3"]["tmp_name"],"productimages/".
$imgnewfile3);
$sql=mysqli_query($con,"insert into
products(category,subCategory,productName,productCompany,productPrice,productDescription,
shippingCharge,productAvailability,productImage1,productImage2,productImage3,productPrice
BeforeDiscount,addedBy)
values('$category','$subcat','$productname','$productcompany','$productprice','$productdescripti
on','$productscharge','$productavailability','$imgnewfile1','$imgnewfile2','$imgnewfile3','$produ
ctpricebd','$addedby')");
echo "<script>alert('Product Added added successfully');</script>";
echo "<script>window.location.href='manage-subcategories.php'</script>";
}

?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>Shopping Portal | Add Products</title>
<link href="css/styles.css" rel="stylesheet" />
<script src="js/all.min.js" crossorigin="anonymous"></script>
<script src="js/jquery-3.5.1.min.js"></script>
<script>
function getSubcat(val) {
$.ajax({
type: "POST",
url: "get_subcat.php",
data:'cat_id='+val,
success: function(data){
$("#subcategory").html(data);
}
});
}
</script>

</head>
<body>
<?php include_once('includes/header.php');?>
<div id="layoutSidenav">
<?php include_once('includes/sidebar.php');?>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">Add Product</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>
<li class="breadcrumb-item active">Add Product</li>
</ol>
<div class="card mb-4">
<div class="card-body">
<form method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-2">Category Name</div>
<div class="col-4">
<select name="category" id="category" class="form-control"
onChange="getSubcat(this.value);" required>
<option value="">Select Category</option>
<?php $query=mysqli_query($con,"select * from category");
while($row=mysqli_fetch_array($query))
{?>

<option value="<?php echo $row['id'];?>"><?php echo $row['categoryName'];?></option>


<?php } ?>
</select>
</div>
</div>

<div class="row" style="margin-top:1%;">


<div class="col-2">Sub Category name</div>
<div class="col-4"><select name="subcategory" id="subcategory" class="form-control"
required>
</select>
</div>
</div>

<div class="row" style="margin-top:1%;">


<div class="col-2">Product Name</div>
<div class="col-4"><input type="text" name="productName" placeholder="Enter Product
Name" class="form-control" required>
</select>
</div>
</div>

<div class="row" style="margin-top:1%;">


<div class="col-2">Product Company</div>
<div class="col-4"><input type="text" name="productCompany" placeholder="Enter Product
Comapny Name" class="form-control" required>
</select>
</div>
</div>

<div class="row" style="margin-top:1%;">


<div class="col-2">Product Price Before Discount</div>
<div class="col-4"><input type="text" name="productpricebd" placeholder="Enter Product
Price" class="form-control" required>
</select>
</div>
</div>

<div class="row" style="margin-top:1%;">


<div class="col-2">Product Price After Discount(Selling Price)</div>
<div class="col-4"><input type="text" name="productprice" placeholder="Enter Product
Price" class="form-control" required>
</select>
</div>
</div>

<div class="row" style="margin-top:1%;">


<div class="col-2">Product Description</div>
<div class="col-4"><textarea name="productDescription" placeholder="Enter Product
Description" rows="6" class="form-control"></textarea>
</div>
</div>

<div class="row" style="margin-top:1%;">


<div class="col-2">Product Shipping Charge</div>
<div class="col-4"><input type="text" name="productShippingcharge" placeholder="Enter
Product Shipping Charge" class="form-control" required>
</select>
</div>
</div>

<div class="row" style="margin-top:1%;">


<div class="col-2">Product Availability</div>
<div class="col-4"><select name="productAvailability" id="productAvailability" class="form-
control" required>
<option value="">Select</option>
<option value="In Stock">In Stock</option>
<option value="Out of Stock">Out of Stock</option>
</select>
</select>
</div>
</div>

<div class="row" style="margin-top:1%;">


<div class="col-2">Product Featured Image</div>
<div class="col-4"><input type="file" name="productimage1" id="productimage1"
class="form-control" accept="image/*" title="Accept images only" required>
</div>
</div>

<div class="row" style="margin-top:1%;">


<div class="col-2">Product Image 2</div>
<div class="col-4"><input type="file" name="productimage2" class="form-control"
accept="image/*" title="Accept images only" required>
</div>
</div>

<div class="row" style="margin-top:1%;">


<div class="col-2">Product Image 3</div>
<div class="col-4"><input type="file" name="productimage3" class="form-control"
accept="image/*" title="Accept images only" required>
</div>
</div>

<div class="row">
<div class="col-2"><button type="submit" name="submit" class="btn
btn-primary">Submit</button></div>
</div>

</form>
</div>
</div>
</div>
User Login
<?php session_start();
error_reporting(0);
include_once('includes/config.php');
// Code for User login
if(isset($_POST['login']))
{
$email=$_POST['emailid'];
$password=md5($_POST['inputuserpwd']);
$query=mysqli_query($con,"SELECT id,name FROM users WHERE email='$email' and
password='$password'");
$num=mysqli_fetch_array($query);
//If Login Suceesfull
if($num>0)
{
$_SESSION['login']=$_POST['email'];
$_SESSION['id']=$num['id'];
$_SESSION['username']=$num['name'];
echo "<script type='text/javascript'> document.location ='index.php'; </script>";
}
//If Login Failed
else{
echo "<script>alert('Invalid login details');</script>";
echo "<script type='text/javascript'> document.location ='login.php'; </script>";
exit();
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>Shopping | User Sign up</title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
<!-- Bootstrap icons-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css"
rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="css/styles.css" rel="stylesheet" />
<script src="js/jquery.min.js"></script>
<!-- <link href="css/bootstrap.min.css" rel="stylesheet" /> -->
</head>
<style type="text/css">
input { border:solid 1px #000;

</style>
<body>
<?php include_once('includes/header.php');?>
<!-- Header-->
<header class="bg-dark py-5">
<div class="container px-4 px-lg-5 my-5">

<div class="text-center text-white">


<h1 class="display-4 fw-bolder">User Login /Signin </h1>
</html>
User Index
<?php session_start();
error_reporting(0);
include_once('includes/config.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>Shop Homepage </title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
<!-- Bootstrap icons-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css"
rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="css/styles.css" rel="stylesheet" />
<script src="js/jquery.min.js"></script>
<!-- <link href="css/bootstrap.min.css" rel="stylesheet" /> -->
</head>
<body>
<?php include_once('includes/header.php');?>
<!-- Header-->

<!-- Section-->
<section class="py-5">
<div class="container px-4 px-lg-5 mt-5">
<div class="row gx-4 gx-lg-5 row-cols-2 row-cols-md-3 row-cols-xl-4 justify-content-
center">
<?php

if (isset($_GET['page_no']) && $_GET['page_no']!="") {


$page_no = $_GET['page_no'];
} else {
$page_no = 1;
}

$total_records_per_page = 12;
$offset = ($page_no-1) * $total_records_per_page;
$previous_page = $page_no - 1;
$next_page = $page_no + 1;
$adjacents = "2";

$result_count = mysqli_query($con,"SELECT COUNT(*) As total_records FROM products


");
$total_records = mysqli_fetch_array($result_count);
$total_records = $total_records['total_records'];
$total_no_of_pages = ceil($total_records / $total_records_per_page);
$second_last = $total_no_of_pages - 1; // total page minus 1

$query=mysqli_query($con,"select products.id as
pid,products.productImage1,products.productName,products.productPriceBeforeDiscount,produ
cts.productPrice from products order by pid desc LIMIT $offset, $total_records_per_page ");
$cnt=1;
while($row=mysqli_fetch_array($query))
{
?>

<div class="col mb-5">


<div class="card h-100">
<!-- Product image-->
<img class="card-img-top" src="admin/productimages/<?php echo
htmlentities($row['productImage1']);?>" width="350" height="300" alt="<?php echo
htmlentities($row['productName']);?>" />
<!-- Product details-->
<div class="card-body p-4">
<div class="text-center">
<!-- Product name-->
<h5 class="fw-bolder"><?php echo htmlentities($row['productName']);?
></h5>
<!-- Product price-->
<span class="text-decoration-line-through">$<?php echo
htmlentities($row['productPriceBeforeDiscount']);?></span> - $<?php echo
htmlentities($row['productPrice']);?>
</div>
</div>
<!-- Product actions-->
<div class="card-footer p-4 pt-0 border-top-0 bg-transparent">
<div class="text-center"><a class="btn btn-outline-dark mt-auto"
href="product-details.php?pid=<?php echo htmlentities($row['pid']);?>">View
options</a></div>
</div>
</div>
</div>
<?php } ?>
</div>
</div>

<div style='padding: 10px 20px 0px; border-top: dotted 1px #CCC;'>


<strong>Page <?php echo $page_no." of ".$total_no_of_pages; ?></strong>
</div>

<nav aria-label="Pagination">
<hr class="my-0">
<ul class="pagination justify-content-center my-4">

<li <?php if($page_no <= 1){ echo "class='page-item disabled'"; } ?>>


<a <?php if($page_no > 1){ echo "href='?page_no=$previous_page'"; } ?> class="page-
link">Previous</a>
</li>

<?php
if ($total_no_of_pages <= 10){
for ($counter = 1; $counter <= $total_no_of_pages; $counter++){
if ($counter == $page_no) {
echo "<li class='page-link active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter' class='page-link'>$counter</a></li>";
}
}
}
elseif($total_no_of_pages > 10){
if($page_no <= 4) {
for ($counter = 1; $counter < 8; $counter++){
if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'> $counter</a></li>";
}
}
echo "<li><a>...</a></li>";
echo "<li><a href='?page_no=$second_last'>$second_last</a></li>";
echo "<li><a href='?page_no=$total_no_of_pages'>$total_no_of_pages</a></li>";
}

elseif($page_no > 4 && $page_no < $total_no_of_pages - 4) {


echo "<li><a href='?page_no=1'>1</a></li>";
echo "<li><a href='?page_no=2'>2</a></li>";
echo "<li><a>...</a></li>";
for ($counter = $page_no - $adjacents; $counter <= $page_no + $adjacents; $counter++) {
if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter' class='page-link'>$counter</a></li>";
}
}
echo "<li><a>...</a></li>";
echo "<li><a href='?page_no=$second_last' class='page-link'>$second_last</a></li>";
echo "<li><a href='?page_no=$total_no_of_pages'
class='page-link'>$total_no_of_pages</a></li>";
}

else {
echo "<li><a href='?page_no=1' class='page-link'>1</a></li>";
echo "<li><a href='?page_no=2' class='page-link'>2</a></li>";
echo "<li><a>...</a></li>";

for ($counter = $total_no_of_pages - 6; $counter <= $total_no_of_pages; $counter++) {


if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
}
}
?>

<li <?php if($page_no >= $total_no_of_pages){ echo "class='page-item disabled'"; } ?>>


<a <?php if($page_no < $total_no_of_pages) { echo "href='?page_no=$next_page'"; } ?>
class="page-link">Next</a>
</li>
<?php if($page_no < $total_no_of_pages){
echo "<li><a href='?page_no=$total_no_of_pages' class='page-link'>Last
&rsaquo;&rsaquo;</a></li>";
} ?>
</ul>
</div>
</section>
<!-- Footer-->
<?php include_once('includes/footer.php'); ?>
<!-- Bootstrap core JS-->
Checkout
<?php session_start();
include_once('includes/config.php');
error_reporting(0);
if(strlen($_SESSION['id'])==0)
{ header('location:logout.php');
}else{
// Code for Product deletion from cart
if(isset($_GET['del']))
{
$wid=intval($_GET['del']);
$query=mysqli_query($con,"delete from cart where id='$wid'");
echo "<script>alert('Product deleted from cart.');</script>";
echo "<script type='text/javascript'> document.location ='checkout.php'; </script>";
}
// For Address Insertion
if(isset($_POST['submit'])){
$uid=$_SESSION['id'];
//Getting Post Values
$baddress=$_POST['baddress'];
$bcity=$_POST['bcity'];
$bstate=$_POST['bstate'];
$bpincode=$_POST['bpincode'];
$bcountry=$_POST['bcountry'];
$saddress=$_POST['saddress'];
$scity=$_POST['scity'];
$sstate=$_POST['sstate'];
$spincode=$_POST['spincode'];
$scountry=$_POST['scountry'];
$sql=mysqli_query($con,"insert into
addresses(userId,billingAddress,biilingCity,billingState,billingPincode,billingCountry,shippingA
ddress,shippingCity,shippingState,shippingPincode,shippingCountry)
values('$uid','$baddress','$bcity','$bstate','$bpincode','$bcountry','$saddress','$scity','$sstate','$spi
ncode','$scountry')");
if($sql)
{
echo "<script>alert('You Address added successfully');</script>";
echo "<script type='text/javascript'> document.location ='checkout.php'; </script>";
}
else{
echo "<script>alert('Something went wrong. Please try again.');</script>";
echo "<script type='text/javascript'> document.location ='checkout.php'; </script>";
}
}
//For Proceeding Payment
if(isset($_POST['proceedpayment'])){
$address=$_POST['selectedaddress'];
$gtotal=$_POST['grandtotal'];
$_SESSION['address']=$address;
$_SESSION['gtotal']=$gtotal;
echo "<script type='text/javascript'> document.location ='payment.php'; </script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>E-Agri Shopping Portal | Checkout</title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
<!-- Bootstrap icons-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css"
rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="css/styles.css" rel="stylesheet" />
<script src="js/jquery.min.js"></script>
<!-- <link href="css/bootstrap.min.css" rel="stylesheet" /> -->
</head>
<style type="text/css"></style>
<body>
<?php include_once('includes/header.php');?>
<!-- Header-->
<header class="bg-dark py-5">
<div class="container px-4 px-lg-5 my-5">

<div class="text-center text-white">


<h1 class="display-4 fw-bolder">Checkout</h1>
</div>

</div>
</header>
<!-- Section-->
<section class="py-5">
<div class="container px-4 mt-5">
<table class="table">
<thead>
<tr>
<th colspan="4"><h4>My Cart</h4></th>
</tr>
</thead>
<tr>
<thead>
<th>Product</th>
<th>Product Name</th>
<th>Product Price</th>
<th>Quantity</th>
<th>Total Amount</th>
<th>Action</th>
</thead>
</tr>
<tbody>
<?php
$uid=$_SESSION['id'];
$ret=mysqli_query($con,"select products.productName as pname,products.productName as
proid,products.productImage1 as pimage,products.productPrice as pprice,cart.productId as
pid,cart.id as cartid,products.productPriceBeforeDiscount,cart.productQty from cart join
products on products.id=cart.productId where cart.userId='$uid'");
$num=mysqli_num_rows($ret);
if($num>0)
{
while ($row=mysqli_fetch_array($ret)) {

?>

<tr>
<td class="col-md-2"><img src="admin/productimages/<?php echo
htmlentities($row['pimage']);?>" alt="<?php echo htmlentities($row['pname']);?>" width="100"
height="100"></td>
<td>
<a href="product-details.php?pid=<?php echo htmlentities($pd=$row['pid']);?
>"><?php echo htmlentities($row['pname']);?></a>
</td>
<td>
<span class="text-decoration-line-through">Rs. <?php echo
htmlentities($row['productPriceBeforeDiscount']);?></span>
<span>Rs. <?php echo htmlentities($row['pprice']);?></span>
</td>
<td><?php echo htmlentities($row['productQty']);?></td>
<td><?php echo htmlentities($totalamount=$row['productQty']*$row['pprice']);?
></td>
<td>
<a href="my-cart.php?del=<?php echo htmlentities($row['cartid']);?>"
onClick="return confirm('Are you sure you want to delete?')" class="btn-upper btn btn-
danger">Delete</a>
</td>
</tr>
<?php $grantotal+=$totalamount;
} ?>
<tr>
<th colspan="4">Grand Total</th>
<th colspan="2"><?php echo $grantotal;?></th>
</tr>
<?php } else{
echo "<script type='text/javascript'> document.location ='my-cart.php'; </script>"; } ?>
</tbody>
</table>
<h5>Already Listed Addresses</h5>
<?php
$uid=$_SESSION['id'];
$query=mysqli_query($con,"select * from addresses where userId='$uid'");
$count=mysqli_num_rows($query);
if($count==0):
echo "<font color='red'>No addresses Found.</font>";
else:
?>
<form method="post">
<input type="hidden" name="grandtotal" value="<?php echo $grantotal; ?>">
<div class="row">
<div class="col-6">
<table class="table">
<thead>
<tr>
<th colspan="4"><h5>Billing Address</h5></th>
</tr>
</thead>
<tr>
<thead>
<th>#</th>
<th width="250">Adresss</th>
<th>City</th>
<th>State</th>
<th>Pincode</th>
<th>Country</th>

</thead>
</tr>
</table>
</div>
<div class="col-6">
<table class="table">
<thead>
<tr>
<th colspan="4"><h5>Shipping Address</h5></th>
</tr>
</thead>
<tr>
<thead>
<th width="250">Adresss</th>
<th>City</th>
<th>State</th>
<th>Pincode</th>
<th>Country</th>

</thead>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Fecthing Values-->
<?php while ($result=mysqli_fetch_array($query)) { ?>
<div class="row">
<div class="col-6">
<table class="table">

<tbody>
<tr>
<td><input type="radio" name="selectedaddress" value="<?php echo $result['id'];?
>" required></td>
<td width="250"><?php echo $result['billingAddress'];?></td>
<td><?php echo $result['biilingCity'];?></td>
<td><?php echo $result['billingState'];?></td>
<td><?php echo $result['billingPincode'];?></td>
<td><?php echo $result['billingCountry'];?></td>
</tr>
</tbody>
</table>

</div>
<div class="col-6">
<table class="table">
<tbody>
<tr>
<td width="250"><?php echo $result['shippingAddress'];?></td>
<td><?php echo $result['shippingCity'];?></td>
<td><?php echo $result['shippingState'];?></td>
<td><?php echo $result['shippingPincode'];?></td>
<td><?php echo $result['shippingCountry'];?></td>
</tr>
</tbody>
</table>
</div>
</div>

<?php } endif;?>
<div align="right">
<button class="btn-upper btn btn-primary" type="submit" name="proceedpayment">Procced
for Payment</button>
</div>
</form>

<hr />
<form method="post" name="address">

<div class="row">
<!--Billing Addresss --->
<div class="col-6">
<div class="row">
<div class="col-9" align="center"><h5>New Billing Address</h5><br /></div>
<hr />
</div>
<div class="row">
<div class="col-3">Address</div>
<div class="col-6"><input type="text" name="baddress" id="baddress" class="form-
control" required ></div>
</div>
<div class="row mt-3">
<div class="col-3">City</div>
<div class="col-6"><input type="text" name="bcity" id="bcity" class="form-control"
required>
</div>

</div>

<div class="row mt-3">


<div class="col-3">State</div>
<div class="col-6"><input type="text" name="bstate" id="bstate" class="form-control"
required></div>
</div>

<div class="row mt-3">


<div class="col-3">Pincode</div>
<div class="col-6"><input type="text" name="bpincode" id="bpincode" pattern="[0-9]+"
title="only numbers" maxlength="6" class="form-control" required></div>
</div>

<div class="row mt-3">


<div class="col-3">Country</div>
<div class="col-6"><input type="text" name="bcountry" id="bcountry" class="form-
control" required></div>
</div>
</div>
<!--Shipping Addresss --->
<div class="col-6">
<div class="row">
<div class="col-9" align="center"><h5>New Shipping Address</h5>
<input type="checkbox" name="adcheck" value="1"/>
<small>Shipping Adress same as billing Address</small></div>
<hr />
</div>
<div class="row">
<div class="col-3">Address</div>
<div class="col-6"><input type="text" name="saddress" id="saddress" class="form-
control" required ></div>
</div>
<div class="row mt-3">
<div class="col-3">City</div>
<div class="col-6"><input type="text" name="scity" id="scity" class="form-control"
required>
</div>

</div>

<div class="row mt-3">


<div class="col-3">State</div>
<div class="col-6"><input type="text" name="sstate" id="sstate" class="form-control"
required></div>
</div>

<div class="row mt-3">


<div class="col-3">Pincode</div>
<div class="col-6"><input type="text" name="spincode" id="spincode" pattern="[0-9]+"
title="only numbers" maxlength="6" class="form-control" required></div>
</div>

<div class="row mt-3">


<div class="col-3">Country</div>
<div class="col-6"><input type="text" name="scountry" id="scountry" class="form-
control" required></div>
</div>

</div>
<div class="row mt-3">
<div class="col-5">&nbsp;</div>
<div class="col-6"><input type="submit" name="submit" id="submit" class="btn btn-
primary" value="Add" required></div>
</div>
</div>
</form>

</div>

</div>
</section>
<!-- Footer-->
<?php include_once('includes/footer.php'); ?>
<!-- Bootstrap core JS-->
<script src="js/bootstrap.bundle.min.js"></script>
<!-- Core theme JS-->
<script src="js/scripts.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('input[type="checkbox"]').click(function(){
if($(this).prop("checked") == true){
$('#saddress').val($('#baddress').val() );
$('#scity').val($('#bcity').val());
$('#sstate').val($('#bstate').val());
$('#spincode').val( $('#bpincode').val());
$('#scountry').val($('#bcountry').val() );
}

});
});
</script>
</body>
CHAPTER-7
7. SOFTWARE DESCRIPTION
7.1 SYSTEM TESTING
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub-assemblies

, assemblies and/or a finished product It is the process of exercising software with the intent of
ensuring that the software system meets its requirements and user expectations and does not fail
in an unacceptable manner. There are various types of test. Each test type addresses a specific
testing requirement.

TYPES OF TESTS

UNIT TESTING

Unit testing involves the design of test cases that validate that the internal program logic is
functioning properly, and that program inputs produce valid outputs. All decision branches and
internal code flow should be validated. It is the testing of individual software units of the
application .it is done after the completion of an individual unit before integration. This is a
structural testing, that relies on knowledge of its construction and is invasive. Unit tests perform
basic tests at component level and test a specific business process, application, and/or system
configuration. Unit tests ensure that each unique path of a business process performs accurately
to the documented specifications and contains clearly defined inputs and expected results.

INTEGRATION TESTING
Integration tests are designed to test integrated software components to determine if they
actually run as one program. Testing is event driven and is more concerned with the basic
outcome of screens or fields. Integration tests demonstrate that although the components were
individually satisfaction, as shown by successfully unit testing, the combination of components is
correct and consistent. Integration testing is specifically aimed at exposing the problems that
arise from the combination of components.

Functional test
Functional tests provide systematic demonstrations that functions tested are available as
specified by the business and technical requirements, system documentation, and user manuals.

Functional testing is centered on the following items:

Valid Input : identified classes of valid input must be accepted.

Invalid Input : identified classes of invalid input must be rejected.

Functions : identified functions must be exercised.

Output : identified classes of application outputs must be exercised.

Systems/Procedures: interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key functions, or


special test cases. In addition, systematic coverage pertaining to identify Business process flows;
data fields, predefined processes, and successive processes must be considered for testing.
Before functional testing is complete, additional tests are identified and the effective value of
current tests is determined.

SYSTEM TESTING
System testing ensures that the entire integrated software system meets requirements. It tests a
configuration to ensure known and predictable results. An example of system testing is the
configuration oriented system integration test. System testing is based on process descriptions
and flows, emphasizing pre-driven process links and integration points.

WHITE BOX TESTING


White Box Testing is a testing in which in which the software tester has knowledge of the
inner workings, structure and language of the software, or at least its purpose. It is purpose. It is
used to test areas that cannot be reached from a black box level.
BLACK BOX TESTING
Black Box Testing is testing the software without any knowledge of the inner workings,
structure or language of the module being tested. Black box tests, as most other kinds of tests,
must be written from a definitive source document, such as specification or requirements
document, such as specification or requirements document. It is a testing in which the software
under test is treated, as a black box .you cannot “see” into it. The test provides inputs and
responds to outputs without considering how the software works.

ACCEPTANCE TESTING

User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional requirements.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.
CHAPTER -8

8. SYSTEM IMPLEMENTATION

IMPLEMENTATION PLAN:
Implementation is the state in the system where the theoretical design is turned
into a working system. The most crucial stage in achieving a new successful system and in
giving confidence on the new system for the users that will work efficiently and effectively. The
system can be implemented only after thorough testing is done and if found to work according to
the specification.

It involves careful planning, investigation of the current system and its constraints
on implementation, design of methods to achieve the changeover, an evaluation of changeover
methods apart from planning. Two major tasks of preparing the implementation are education,
training of the users and testing the systems. System analysis and design efforts will be more for
complex systems beings implemented. Based on policies of individuals’ organization an
implementation coordinating committee has been appointed.

IMPLEMENTATION PROCESS:
The implementation process begins with preparing a plain for the implementation
system. According to this plan, the other activities are to be carried out. In this plan, discussion
has been made regarding the equipment, resources and how to test the activities. Thus a clear
plan is preparing for the activities.

EQUIPMENT ACQUISITION:
One of the most important development activities is the code of programming.
The system According to the above plan, the necessary equipment has to be acquired to
implement the new system.

USER MANUALS:
Once planning has been completed the major effort of the computer department is
to ensure that the user department consists of education and trained staff, as the system becomes
more complex. The success of a system depends upon how they are operated and used. Thus the
quality of training, the personnel is connected to the success of the system.

For this purpose system and user manuals are prepared. In system manuals,
details about the forms and blocks triggers which were used to develop them were specified. In
user manuals data flow diagrams, charts and screen formats are given. Also error messages
associated were explained in details. The users were shown the success and they were taught
how to operate the system. Live demonstration and visuals aids were used to teach them.
CHAPTER-9

9. SCREEN LAYOUT AND CONCLUSION

9.1 Screen Layout

Home Page

Admin Login
Dashboard

Add Category


Manage Category

Add Product
Manage Product

All Orders
Order Details

Update Order Status


User Register

User Login
User Index

Product View
Cart View

Checkout
Payment

Order Track

9.2 Conclusion
It is concluded that how internet based e-commerce will transform agribusiness is
still indeterminate. Supply chains may become more efficient. Stronger connection
between producers and consumers may result in more differentiated products that meet consumer
needs. E-commerce offers an alternative venue of promoting and marketing agricultural products
that has a benefit of reaching extensive geographical populations and providing detailed
product information at a relatively low cost. Markets may become more transparent. As the
Internet transcends geography the globalization of the sector may become a reality.
Transformation is about change and change creates winners and losers. The winners will be the
fast innovators best serving consumer’s needs.The losers are likely to be those unwilling to
catch this powerful technological tool and adopt the trend. As Charles Darwin says, “It’s not
the strongest of the species that survives, nor the most intelligent; it is the one most adaptable
to change”.

CHAPTER-10
10.FUTURE ENHANCEMENT

This application avoids the manual work and the problems concern with it. It is an easy
way to obtain the information regarding the various products information that are present in the
Agri Super markets.

Well I and my team members have worked hard in order to present an improved website better
than the existing one’s regarding the information about the various activities. Still ,we found out
that the project can be done in a better way. Primarily, when we request information about a
particular product it just shows the company, product id, product name and no. of quantities
available. So, after getting the information we can get access to the product company website
just by a click on the product name .

CHAPTER-11
11. BIBLIOGRAPHY

For PHP

 https://www.w3schools.com/php/default.asp
 https://www.sitepoint.com/php/
 https://www.php.net/

For MySQL

 https://www.mysql.com/
 http://www.mysqltutorial.org

For XAMPP

 https://www.apachefriends.org/download.html

For Software Engineering

 https://www.tutorialspoint.com/software_engineering

You might also like