Dairy Final

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

DAIRY PRODUCT MANAGEMENT SYSTEM

PROJECT REPORT

ON

“DAIRY PRODUCT MANAGEMENT SYSTEM”

Submitted to

Rashtrasant Tukadoji Maharaj Nagpur University

NAGPUR

In partial fulfillment of

Bachelor of Commerce in Computer Application


Final Year (SEMESTER-VI) Examination

Submitted by

Kunal Dilipji Pahune

Under the guidance of

Dr.Ajay Ramteke

Assistant Professor

Department Of Computer Science

DEPARTMENT OF COMPUTER SCIENCE

Taywade College Mahadula-Koradi

Tah. Kamptee, Dist. Nagpur

Nagpur -441111

2022-2023

BCCA IV SEMSTER Page 1


DAIRY PRODUCT MANAGEMENT SYSTEM

CERTIFICATE

This is to certify that Kunal Dilipji Pahune have successfully completed the project
work entitled “Dairy Product Management System” under my guidance towards the
fulfillment of the degree of Bachelor of Commerce in Computer Application Final Year
submitted to Rashtrasant Tukadoji Maharaj Nagpur University, Nagpur during academic year
2022-2023.

To the best of my knowledge the matter presented here in this project has not been
presented earlier for similar degree/course.

Place: Nagpur Project Guide

Date: Dr.Ajay Ramteke

Assistant Professor

Department Of Computer Science

BCCA IV SEMSTER Page 2


DAIRY PRODUCT MANAGEMENT SYSTEM

DECLARATION

To,

The Principal

Taywade College Mahadula-Koradi

Tah. Kamptee, Dist. Nagpur

Nagpur -441111

Respected Mam,

I undersigned, hereby declare that the project work entitled “Dairy Product
Management System” submitted to Rashtrasant Tukadoji Maharaj Nagpur University,
Nagpur is my own independent work. This is our original work and has not been submitted
anywhere for any degree/diploma. The system presented herein has not been duplicated from
any other source.

I understand that any such copying is liable to be punished in any way the university
authority may deems fit.

Thanking you,

Place: Nagpur Yours Sincerely,

Date: Kunal Dilipji Pahune

BCCA IV SEMSTER Page 3


DAIRY PRODUCT MANAGEMENT SYSTEM

ACKNOWLEDGEMENT

We wish to express our sincere thanks to many persons who helped us to develop the
project. We extend our thanks to respected Principal Dr. Sharayou Taywade, Taywade
College Mahadula-Koradi, for providing the infrastructure and facilities without which it
would have been impossible to complete this hard task.

Our foremost thanks are to Dr. G.S.Katkar, Head of Department of Computer


Science, A.S.Ramteke & other faculty members who has guided us in completing this project
report. We take the opportunity to express our deep sense of gratitude and whole hearted
thanks for his inspiration and guidance throughout the course of this project.

We are thankful to our Guide (Dr.Ajay Ramteke) for their constant inspiration and
guidance throughout the course of this project work.

We express our gratitude to all members of teaching and non-teaching staff of the
Department of Computer Science for their co-operation during the verification of the project.

Place: Nagpur Kunal Dilipji Pahune

Date: B.C.C.A Final Year (Semester-VI)

BCCA IV SEMSTER Page 4


DAIRY PRODUCT MANAGEMENT SYSTEM

1. INTRODUCTION 7 - 10
1.1 Background
1.2 Objectives
1.3 Proposed System
1.3.1 Purpose
1.3.2 Scope
2. SURVEY OF TECHNOLOGY 10

3. REQUIREMENTS AND ANALYSIS 11 -18

2.1 Problem Definition

2.2 Planning and Scheduling

2.3 Software and Hardware Requirements

2.4 Feasibility Study

2.4.1 Economic

2.4.2 Technical

2.4.3 Operational

4. SYSTEM DESIGN 19-58

4.1 Program Flowchart

4.2 Basic Modules

4.3 Data Design

4.3.1 Database Design

4.3.2 Data Dictionary and Data Views

4.3.3 E-R diagram and DFDs

4.4.3 Activity Diagram

4.4.4 Sequence Diagram

5. IMPLEMENTATION 26-28

6. CONCLUSIONS 67

7. BIBLIOGRAPHY 68

BCCA IV SEMSTER Page 5


DAIRY PRODUCT MANAGEMENT SYSTEM

INDEX
SR NO NAME OF TOPIC PAGE NO.

1. INTRODUCTION 7
1.1 Project Overview 8
1.2 Objective 9
1.3 Scope 10
2. SURVEY OF TECHNOLOGY 11
3. REQUIREMENT AND ANALYSIS 12
3.1 Software & Hardware Requirement 13 - 15
3.2 Feasibility Study
3.3 Economic
3.4 Technical
4. SYSTEM DESIGN 19
4.1 Dataflow Diagram 22
4.2 E-R Diagram 24
4.3 Activity Diagram 25
5. IMPLEMENTATION 17-18
5.1 Sources Code 27 - 66
5.1 Screenshot 66
6. CONCLUSION 67
7. BIBLIOGRAPH 68

BCCA IV SEMSTER Page 6


DAIRY PRODUCT MANAGEMENT SYSTEM

1. INTRODUCTION

PROJECT OVERVIEW

Dairy Product Management System this project is using one of the famous Milk distribution
units. It has various branches in and around Madurai. This Limited has been using in the
FoxPro system. In FoxPro, the tables are not inter related, the process was very slow, and it is
a single user. In order to overcome these problems and to remove all manual burdens and to
provide an efficient on-line entry system, the organization felt the need for computerization.
This project is done to fulfill above requirements.

The software is developed for these depots and the software takes care of stock transferred
from the Head Office to the depots, updating the stock, maintaining the stock, orders placed
by the customer, and the generation of invoice by the depots to the customer. Customer
places his order in any of these depots and thereafter the software takes care of the invoice
generation.

Dairy Product Management System is developed using PHP (PHP: Hypertext Preprocessor)
and MySQL. This web based application works as a simple Dairy Software to maintain daily
milk record by registered account members and maintain reports. The Project is based on the
concept of managing dairy products and their records. The main objective of this website is to
automate the complete operations of the Dairy Distributors office and bring ease between
each dairy managers and the system admin. They need to maintain hundreds of thousands of
records. Also searching should be very faster so they can find required details instantly.

BCCA IV SEMSTER Page 7


DAIRY PRODUCT MANAGEMENT SYSTEM

1.1 BACKGROUND

The Dairy Product Management System application which deals with maintaining the
inventory details of dairy product like milk, ghee, curd, panneer etc and the billing process
with great ease. The owners of the dairy shop can solely depend on this application.
Many of us want the work to be done at a faster rate. So this application will help in
reducing the pen paper transaction to computerized transaction. Even this application can
help the small enterprises also. The user interface must be simple and easy to
understand. This application will help in storing the products records like the dairy
product, employee records, and customer records, purchased information in an easy and
well organized manner. This will be one of the projects that will help the owners of the
dairy shop to maintain the inventory and the billing process with great ease.

The aim of the project is to computerize the operations of collecting the sales details from the
dealer and to book order for their next dispatching. The system is an automated system which
handles all the process of the dairy product shop. This system facilitates the manufacturing
company to organize its production schedules depending on the orders that are received from
its recognized dealers

BCCA IV SEMSTER Page 8


DAIRY PRODUCT MANAGEMENT SYSTEM

Objectives
 To modernize the milk processing plants and machinery and to create additional
infrastructure for processing more milk.
 To create additional milk processing capacity for increased value addition by
producing more dairy products.
 To bring efficiency in dairy processing plants/producer owned and controlled dairy
institutions, thereby enabling optimum value of milk to milk producer farmers and
supply of quality milk to consumers.
 To help the producer owned and controlled institutions to increase their share of milk,
thereby providing greater opportunities of ownership, management and market access
to rural milk producers in the organised milk market.
 To help the producer owned and controlled institutions to consolidate their position as
dominant player in the organised liquid milk market and to make increased price
realisation to milk producers.

PURPOSE
To reduce manual work, A dairy management System can help to make day-to-day dairy
related activities easier. It helps to maximize the profit by improving herd fertility. You can
also track the movement of raw material to the plant storehouse or milk procurement to the
distribution of the product.

BCCA IV SEMSTER Page 9


DAIRY PRODUCT MANAGEMENT SYSTEM

Scope of Dairy Farming in India

One of the country’s major agri-businesses and also a leading contributor to the nation’s GDP

is dairy farming in India. With a 4% economic share, it is the biggest agricultural commodity.

With over 180 million MT output in 2020, India is the world’s leading milk producer. The

growth of private dairy businesses, which now make up more than 60% of the nation’s dairy

processing capacity, has been a significant contributing factor. Value-added products have

driven market expansion in the Indian dairy farming industry, which has risen at a rate of

12% over the past five years. Around 70 million farmers are actively engaged in dairy

farming, which contributes significantly to economic revenue.

As the world’s greatest population of livestock is found in India, it supports 14.7% of the

world’s cattle population and around 57.3% of its buffalo population. According to estimates,

the nation produced 84.6 million MT of milk altogether in 2001–2002. In contrast to the

ICMR’s recommended minimum of 250 grammes per day, its per capita availability at this
production was to be 226 grammes per day. Therefore, there is a great scope and possibility

in dairy farming to increase milk production.

BCCA IV SEMSTER Page 10


DAIRY PRODUCT MANAGEMENT SYSTEM

REQUIRMENT AND ANALYSIS

SOFTWARE OVERVIEW
PHP started out as a small open source project that evolved as more and more people found
out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in 1994.
PHP is a recursive acronym for "PHP: Hypertext Preprocessor".
PHP is a server side scripting language that is embedded in HTML. It is used to manage
dynamic content, databases, session tracking, even build entire e-commerce sites.
It is integrated with a number of popular databases, including MySQL, PostgreSQL, Oracle,
Sybase, Informix, and Microsoft SQL Server.
PHP is pleasingly zippy in its execution, especially when compiled as an Apache module on
the Unix side. The MySQL server, once started, executes even very complex queries with
huge result sets in record-setting time.
PHP supports a large number of major protocols such as POP3, IMAP, and LDAP. PHP4
added support for Java and distributed object architectures (COM and CORBA), making n-
tier development a possibility for the first time.
PHP is forgiving: PHP language tries to be as forgiving as possible.
PHP Syntax is C-Like.

Scripting Language
A script is a set of programming instructions that is interpreted at runtime.
A scripting language is a language that interprets scripts at runtime. Scripts are usually
embedded into other software environments.
The purpose of the scripts is usually to enhance the performance or perform routine tasks for
an application.
Server side scripts are interpreted on the server while client side scripts are interpreted by the
client application.
PHP is a server side script that is interpreted on the server while JavaScript is an example of a
client side script that is interpreted by the client browser. Both PHP and JavaScript can be
embedded into HTML pages.

BCCA IV SEMSTER Page 11


DAIRY PRODUCT MANAGEMENT SYSTEM

Programming Language Vs Scripting Language


Programming language Scripting language
Has all the needed to develop Mostly used for routine tasks
features
complete applications.
The code has to be compiled before it can be The code is usually executed without
executed compiling
Does not need to be embedded into other Is usually embedded into other software
languages environments.

A PHP file can also contain tags such as HTML and client side scripts such as JavaScript.
HTML is an added advantage when learning PHP Language. You can even learn PHP
without knowing HTML but it’s recommended you at least know the basics of HTML.
Database management systems DBMS for database powered applications.
For more advanced topics such as interactive applications and web services, you will need
JavaScript and XML.

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, and 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 −

BCCA IV SEMSTER Page 12


DAIRY PRODUCT MANAGEMENT SYSTEM

Simplicity, Efficiency, Security, Flexibility, Familiarity


PHP - Environment Setup

In order to develop and run PHP Web pages three vital components need to be installed on
your computer system.
Web Server − PHP will work with virtually all Web Server software, including Microsoft's
Internet Information Server (IIS) but then most often used is freely available Apache Server.
Database − PHP will work with virtually all database software, including Oracle and Sybase
but most commonly used is freely available MySQL database.
PHP Parser − In order to process PHP script instructions a parser must be installed to
generate HTML output that can be sent to the Web Browser. This tutorial will guide you how
to install PHP parser on your computer.

Database: MySQL
A database is a separate application that stores a collection of data. Each database has one or
more distinct APIs for creating, accessing, managing, searching and replicating the data it
holds.
Other kinds of data stores can also be used, such as files on the file system or large hash
tables in memory but data fetching and writing would not be so fast and easy with those type
of systems.
Nowadays, we use relational database management systems (RDBMS) to store and manage
huge volume of data. This is called relational database because all the data is stored into
different tables and relations are established using primary keys or other keys known as
Foreign Keys.
A Relational DataBase Management System (RDBMS) is a software that −
Enables you to implement a database with tables, columns and indexes.
Guarantees the Referential Integrity between rows of various tables.
Updates the indexes automatically.
Interprets an SQL query and combines information from various tables.

RDBMS Terminology

Before we proceed to explain the MySQL database system, let us revise a few
definitions related to the database.

BCCA IV SEMSTER Page 13


DAIRY PRODUCT MANAGEMENT SYSTEM

Database − A database is a collection of tables, with related data.


Table − A table is a matrix with data. A table in a database looks like a simple
spreadsheet.
Column − One column (data element) contains data of one and the same kind, for
example the column postcode.
Row − A row (= tuple, entry or record) is a group of related data, for example the data of
one subscription.
Redundancy − Storing data twice, redundantly to make the system faster.
Primary Key − A primary key is unique. A key value cannot occur twice in one table.
With a key, you can only find one row.
Foreign Key − A foreign key is the linking pin between two tables.
Compound Key − A compound key (composite key) is a key that consists of
multiple columns, because one column is not sufficiently unique.
Index − An index in a database resembles an index at the back of a book.
Referential Integrity − Referential Integrity makes sure that a foreign key value always
points to an existing row.

ADVANTAGES OF PHP

Following are the top 10 advantages of php which are as follows:


Open Source:
PHP is open-source and free of cost, which helps developers to install it quickly and readily
available for use. There are a lot of PHP frameworks and developer can choose any of the
frameworks to work. All the features and tools will be provided to the developer for that
framework easily. As it is open-source, it makes the system ready with PHP in quick time
and makes the web development faster with help of providing the tools and other features
easily.

Platform Independent:
PHP is mainly supported by all the operating systems like Windows, Unix, Linux etc. The
PHP based developed web applications can be easily run on any platform. It can be integrated
with other programming language and database easily and there is no requirement of re-
development. It helps in saving a lot of effort and cost.

BCCA IV SEMSTER Page 14


DAIRY PRODUCT MANAGEMENT SYSTEM

Simple and Easy:


This advantage of PHP is simple and easy to learn and code. It is mainly organized code and
clean, which helps the new developers also. The command functions of PHP can easily learn
and understood. The one who knows any programming language can easily work on PHP. It
is simple to learn, as its learning curve is not large. The syntax is simple and flexible to use.

Database:
PHP is easily connected with the database and make the connection securely with databases.
It has a built-in module that is used to connect to the database easily. There are many web
applications, which require strong programming language with a good database management
system. PHP and its database connection solve the purpose for development of web
applications. It reduces the time to connect to a database management system as well.
Multiple databases can be integrated with PHP.

Fast:
PHP is known as the fastest Programming language as compared to another. PHP
applications can be easily loaded over the slow Internet and data speed. Other applications
take a lot of time to connect the database and fetch the data after executing certain queries to
the database. PHP does not face this problem and it loads the website very easily and fast.
The fast speed of PHP provides the developer with an edge to develop the web applications in
PHP programming language.
Maintenance:
PHP framework is mainly used to make the web application development easier and maintain
the code automatically. The model view controller architecture in PHP framework helps the
code to be easily maintained and used. The MVC architecture helps the separation of a file
for different module separately.
Support:
This advantage of PHP has great online support and community, which helps the new
developers to help in writing the code and developing the web applications. The
documentation provided at the official site helps in using the different features of PHP and its
framework. The latest updates are released timely by the PHP to make it better for the
developer to develop the web-based applications.

BCCA IV SEMSTER Page 15


DAIRY PRODUCT MANAGEMENT SYSTEM

Testing:
PHP based web applications can be easily tested. PHP unit uses to perform the unit testing
quickly and easily. It also helps the programmers to write test cases and perform the testing
smoothly. For PHP based web applications, the developers do not need to write the additional
code. PHP frameworks help in automating the different tasks
Security:
PHP frameworks built-in feature and tools make it easier to protect the web applications from
the outer attacks and security threats. The security threats can be like SQL injection, data
tampering, and forgery etc. To protect from these security threats, developers used PHP
frameworks for developing web applications.

Stable:
PHP is also stable as compared to other programming languages. It has been in existence for
a long time. The developers have worked on PHP to make it easy for the programmers to
work on developing the PHP web-based applications. They have fixed the issues and bugs
over the period of time for the different version of PHP and make it very stable.

HTML stands for Hyper Text Markup Language, which is the most widely used language on
Web to develop web pages. HTML was created by Berners-Lee in late 1991 but "HTML 2.0"
was the first standard HTML specification which was published in 1995. HTML
4.01 was a major version of HTML and it was published in late 1999. Though HTML 4.01
version is widely used but currently we are having HTML-5 version which is an extension to
HTML 4.01, and this version was published in 2012.

Originally, HTML was developed with the intent of defining the structure of documents like
headings, paragraphs, lists, and so forth to facilitate the sharing of scientific information
between researchers. Now, HTML is being widely used to format web pages with the help of
different tags available in HTML language.
HTML is a MUST for students and working professionals to become a great Software
Engineer especially when they are working in Web Development Domain. I will list down
some of the key advantages of learning HTML:
Create Web site - You can create a website or customize an existing web template if you
Know HTML well.
Become a web designer - If you want to start a carrer as a professional web designer, HTML

BCCA IV SEMSTER Page 16


DAIRY PRODUCT MANAGEMENT SYSTEM

and CSS designing is a must skill.


Understand web - If you want to optimize your website, to boost its speed and
performance, it is good to know HTML to yield best results.
Learn other languages - Once you understand the basic of HTML then other related
technologies like javascript, php, or angular are become easier to understand.
Applications of HTML
As mentioned before, HTML is one of the most widely used languages over the web.
I'm going to list few of them here:
Web pages development - HTML is used to create pages which are rendered over the web.
Almost every page of web is having html tags in it to render its details in browser.
Internet Navigation - HTML provides tags which are used to navigate from one page to
another and is heavily used in internet navigation.
Responsive UI - HTML pages now-a-days works well on all platform, mobile, tabs, desktop
or laptops owing to responsive design strategy.
Offline support HTML pages once loaded can be made available offline on the machine
without any need of internet.
Game development- HTML5 has native support for rich experience and is now useful in
gaming development arena as well.

MySQL Database

MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses.
MySQL is developed, marketed and supported by MySQL AB, which is a Swedish company.
MySQL is becoming so popular because of many good reasons −
MySQL is released under an open-source license. So you have nothing to pay to use it.
MySQL is a very powerful program in its own right. It handles a large subset of the
functionality of the most expensive and powerful database packages.
MySQL uses a standard form of the well-known SQL data language.
MySQL works on many operating systems and with many languages including PHP, PERL,
C, C++, JAVA, etc.
MySQL works very quickly and works well even with large data sets.
MySQL is very friendly to PHP, the most appreciated language for web development.
MySQL supports large databases, up to 50 million rows or more in a table. The default file
size limit for a table is 4GB, but you can increase this (if your operating system can handle it)

BCCA IV SEMSTER Page 17


DAIRY PRODUCT MANAGEMENT SYSTEM

to a theoretical limit of 8 million terabytes (TB).


MySQL is customizable. The open-source GPL license allows programmers to modify the
MySQL software to fit their own specific environments.

OPERATING SYSTEM : WINDOWS 10


Windows 10 is a Microsoft operating system for personal computers, tablets, embedded
devices and internet of things devices.

Microsoft released Windows 10 in July 2015 as a follow-up to Windows 8. Windows 10 has


an official end of support date of October, 2025, with Windows 11 as it's successor.

Anyone adopting Windows 10 can upgrade legacy machines directly from Windows 7 or
Windows 8 to Windows 10 without re-imaging or performing intrusive and time-consuming
system wipes and upgrade procedures. To upgrade from a previous version of Windows 10, IT or
users run the Windows 10 OS installer, which transfers any applications and software on the
previous OS, as well as settings and preferences over to Windows 10.

Organizations and users can pick and choose how they will patch and update Windows 10. IT
or users can access a Windows 10 upgrade through the Windows Update Assistant to
manually begin an upgrade or wait for Windows Update to offer an upgrade when it is set to
run.

Windows 10 features built-in capabilities that allow corporate IT departments to use mobile
device management (MDM) software to secure and control devices running the operating
system. In addition, organizations can use traditional desktop management software such as
Microsoft System Center Configuration Manager.

Windows 10 features

The familiar Start Menu, which Microsoft replaced with Live Tiles in Windows 8, returned in
Windows 10. Users can still access Live Tiles and the touch-centric Metro interface from a
panel on the right side of the Start Menu, however.

Microsoft Windows 10 Continuum allows users to toggle between touchscreen and keyboard
interfaces on devices that offer both. Continuum automatically detects the presence of a
keyboard and orients the interface to match.

Windows 10's integrated search feature allows users to search all local locations, as well as
the web simultaneously.

Microsoft Edge debuted with Windows 10 and replaces Internet Explorer as the default web
browser. Edge includes tools such as Web Notes, which allows users to mark up websites,
and Reading View, which allows users to view certain websites without the clutter of ads.
The browser integrates directly with Cortana, Microsoft's digital assistant, which is also
embedded within Windows 10.

BCCA IV SEMSTER Page 18


DAIRY PRODUCT MANAGEMENT SYSTEM

SYSTEM DESIGN SYSTEM


ANALYSIS

A single-user application which is typically found on a desktop computer there is no need for
any access control - the user has access to every function within the application. However, in
a multi-user application which is deployed over numerous devices which are linked together
in a network it is more than likely that not all functionality will be available to all users.

In this situation a method is required to allocate a suitable person for the correct job at correct
time and maintain the authorized process at a place whereby functions within the application
can only be accessed by persons to whom permission has been granted.

EXISTING SYSTEM
All the process of the enterprise was managed in manually. In manual system, the data
storage, data security is very tedious. And it is very difficult to secure and maintain for long
years without any damages or corruptions. Redundancy, misusing of data are the main
problems by using manual process.
It also takes much of time to retrieve particular information and some more man powers are
needed. Manage and maintain large amount of data by a single person is not possible. So
many problems raised, like storage space, maintenance etc. Much of time will be spent for to
consolidate for a group of data, which was needed by the user. Correction or modification of
data makes a way for malfunction.

The following are the reasons why the current system should be computerized:
To increase efficiency with reduced cost.
To reduce the burden of paper work.
To save time management for recording details of each and every member and
employee.

BCCA IV SEMSTER Page 19


DAIRY PRODUCT MANAGEMENT SYSTEM

To generate required reports easily.


Limitations of existing system:
Time consumption:
As the records are to be manually maintained it consumes a lot of time.

Paper work:
Lot of paper work is involved as the records are maintained in the files & registers
Storage requirements:
As files and registers are used the storage space requirement is increased.
Less reliable:
Use of papers for storing valuable data information is not at all reliable.
Accuracy:
As the system is in manual there are lot many chances of human errors. These can cause
errors in calculating mechanism or maintaining customer details.
Difficulty in keeping new records:
It is difficult for keeping all the new entries of members, their account and transaction
details.

PROPOSED SYSTEM
The proposed system is managed by the PHP, which are user friendly windows for every user
and for maintaining the database Microsoft access is used. The system proposed has many
advantages.
The proposed system is highly secured, because for login the system it requires the username
and password which is different for each department therefore providing each department a
different view of the customer information.
It provides wide range of certain criteria in each window the client is working for better and
quicker solution.
It maintains report for all criteria and transactions.
Manages member information separately for all exercise and employee information
separately for considering the requirements of gym.
Stores information about regular products.
This system can run on any windows operating system.

BCCA IV SEMSTER Page 20


DAIRY PRODUCT MANAGEMENT SYSTEM

All the problems which were denoted in the existing systems were overcome. The data will
be secured with authentication by providing passwords. The retrieval of data is much faster
than the manual process. The user can create their reports within a time. There is no data
redundancy, malfunction, data mismatching. Timely execution and concurrent updating are
the advantages of using this project.
FEASIBILITY STUDY
It is a test of a proposed system according to its workability, impact on the organization. It is
a test whether the system meet user needs and using the resources properly. Depending on the
results of initial investigation, we came to know that the Library administration wants to
manage large amount of records accurately, precisely and quickly with security and integrity.
The administration wants a system that can provide for the management of the currently
active records anywhere and anytime. To accomplish this task, we need a Relational
Database Management System (RDBMS) and a Web based GUI application development
environment.

SYSTEM DESIGN
The design of the system is essentially a blue print or a plan for a solution for the system. At
the first level the focus is made which modules are needed for the system and how modules
should be interconnected. This is called system design.

In the second level, the internal design of the modules and how the specification of the
module can be satisfied is decide upon. Thus design level is called detailed design. Since the
detailed design delineates the major characteristics of the system and also its efficiency. A
Design methodology is a systematic approach to create a design by application of a set of
techniques and guidelines.

BCCA IV SEMSTER Page 21


DAIRY PRODUCT MANAGEMENT SYSTEM

ARCHITECTURAL DESIGN

DATAFLOW DIAGRAM
Data Flow Diagram (DFD) is a directed graph in which the nodes specify processing
activities and the arcs specify data items transmitted between processing nodes. Data Flow
Diagrams are excellent mechanisms for communicating with customers during analysis. Data
Flow Diagram are quit valuable for establishing naming conventions and names of system
components such as subsystems, files and data link.

DFD is used to represent the functional relationship of input, process and output values
presented by system. DFD shows how information moves through the system and how it is
modified by series of transformation that are applied as data moves from input to output.
DFD may be used to represent a system at any level of abstraction. A DFD also called
context diagram represents entire system as a single module with input to output data
indicated by incoming and outgoing allows respectively.

BCCA IV SEMSTER Page 22


DAIRY PRODUCT MANAGEMENT SYSTEM

TOP LEVEL DFD

LEVEL – 0

BCCA IV SEMSTER Page 23


DAIRY PRODUCT MANAGEMENT SYSTEM

Level – 1

Level-2

The modules that can be included in mobile shop management system are as follows:
Employee Module
The details of the employees like name, address, salary and other details can be maintained
through this application.
Customer Module
The details of the customers like name, address, purchased items and many more details can
be maintained with great ease.
Stocks Module
The details of the stocks (airy products like Milk, Butter, Ghee, Panneer, Milk Beda etc) that
are available in the shop can be updated through this application.
Supplier Module
The details related to the supplier (Dealers and Distributors) who has supplied the

BCCA IV SEMSTER Page 24


DAIRY PRODUCT MANAGEMENT SYSTEM

particular items and products can be stored.


Purchase Module
The details of the items that is purchased by the customers and the discounts offered can be
updated through this application
Sales Module
The details of the sales that have taken place on the particular day or the month can be
obtained with great ease.
Report Module
The reports can also be generated based on the sales records.
Billing Module
The billing of the purchased items can be done through this application.

INPUT DESIGN
Identification of the correct input and output for a system from the major parts of a system
analysis. During the System analysis the provider’s and seeker’s needs, the data stores, the
key system elements are identified. Based on this identification the input to be provided to
the system and the outputs that are to be generated and their formats are decided. The Input
Design is the kind that ties the information system into the World of its users. Output refers to
the results that are generated by the system. The design decision for handling input specified
how data are accepted for computer processing.

OBJECTIVES OF INPUT DESIGN


The quality of system input determines the quality of system output. Input specification
describes the manner in which data enter the system for processing. Input design features
can ensure the reliability of the system and produce results from accurate data, or they can
result in the production of erroneous information. The input design also determines whether
the user can interact efficiently with the system.
Four Objectives guiding the design of the input focus on
 Effectiveness
 Accuracy
 Easy to use
 Consistency
Effectiveness
This means that input forms and screens serve specific purposes.

BCCA IV SEMSTER Page 25


DAIRY PRODUCT MANAGEMENT SYSTEM

Accuracy
Refers to design that assures proper completion.
Easy to Use
Means that forms and screens should are straight forward and require no extra time to
understand.
Consistency
Means that forms and screens should group data of similar nature together.

OUTPUT DESIGN
One of the most important features of an information system for users is the output it
produces. Output is the information delivered to the users through the information system.
Without quality output, the entire system may appear to the unnecessary that users will avoid
using it. Users generally merit the system solely by its output. Therefore an effective output
design is an important feature of design specifications.

OBJECTIVE OF THE OUTPUT DESIGN


Since useful output is essential to gaining use and acceptance of the system, the system
analyst should try and follow the following objectives, which are useful for designing
acceptable outputs.
Design the output to serve the intended purpose.
Design the output to fit the users.
Deliver the appropriate quantity of output.

DATABASE DESIGN
Database Name: MYDB Table Name: Bill
Field Name Data type Size Description
PdcId Numeric 15 Product Id
Pdcname Varchar 15 Product name
PId Numeric 15 Part Id
Pname Varchar 15 Part name
Qty Numeric 15 Quantity
Amt Numeric 15 Amount
Total Numeric 15 Total

BCCA IV SEMSTER Page 26


DAIRY PRODUCT MANAGEMENT SYSTEM

Blnc Numeric 15 Balance


Bno Numeric 15 Bill number
Bdate date 15 Billdate
Drid Numeric 15 Drid

Table Name: Product


Field Name Data Type Size Description
PdctId Numeric 15 Product Id
Pdctname Varchar 15 Product name
Dscn Varchar 15 Description

Table Name: Distributor


Field Name Data Type Size Description
DbtrId Numeric 15 Distributor Id
Dbtrname Varchar 15 Distributor name
Addr Varchar 15 Address
City Varchar 15 City
Phno Numeric 15 Phone number
District Varchar 15 District
Climit Numeric 15 Credit limit
Status Varchar 15 Status
Email –Id Varchar 15 Email –Id

Table Name: Parts


Field Name Data Type Size Description
PId Numeric 15 Parts Id
Pname Varchar 15 Parts name
PdctId Numeric 15 Product Id
Pdctname Varchar 15 Product name
Ptype Varchar 15 Parts type
Qty Numeric 15 Quantity
Status Varchar 15 Status

BCCA IV SEMSTER Page 27


DAIRY PRODUCT MANAGEMENT SYSTEM

Table Name: Return


Field Name Data Type Size Description
Bno Numeric 15 Bill number
Bdate Date 15 Bill date
Bill date Varchar 15 Bill date
Return date Date 15 Return date

SYSTEM IMPLEMENTATION

Implementation includes all the activity that takes place to convert the old system to the new.
The new system “Dairy Product Management System” is a totally new, replacing existing
manual system, proper implementation is essential to provide a reliable system to meet the
organization requirements.

Implementation Procedure:
An essential view of software requirements presents the functions to be accomplished and
information to be processed without regard to implement detail. The system is implemented
and the conversion is complete, user and analysis alike usually conduct review of the system.
The review is also important to gather information for the maintenance of the system. The
review has been proved to meet the expectations and has also improved their working
condition.

User Training:
The quality of training received by the personnel involved with the system affects the
successful implementations of the system. Thus for a successful implementation efficient
training must be given to the system operators and the user of the system. Proper training has
been given to the system operators with regard to the operation system – data entry for
providing the necessary support service and that they are able to handle all possible
operations, both routine as well as extraordinary.

Operational Documentation:
Documentation outline can be used as a model for a design specification. Each section is
comprised of numbered paragraphs that address different aspects of the design representation.

BCCA IV SEMSTER Page 28


DAIRY PRODUCT MANAGEMENT SYSTEM

Documentation outline presents a complete design description of software the sections of the
designs specification are completed as a designer refines his representation of the software.
The modules can be increase if they will any requirements in the future in the project.
SYSTEM TESTING

The system “Dairy Product Management System” as a whole was deployed in the PHP and
was tested. The system was found to be working perfect and an end user has been asked to
enter the data, and further the connected systems has been tested with the sample.

UNIT TESTING
Unit testing different modules are tested against the specifications produced during the
design of the modules. Unit testing is essential for Verification of the code produced during
the coding phase and hence the goal is to test the internal logic of the modules. Using the
details design description as a guide, important paths are tested to uncover errors within the
boundary of the Modules.

In the project, the login details of the user are being verified by various conditions. All the
conditions are satisfied, then after the user go to visit the system project.
SYSTEM TESTING
System Testing involves two kinds of activities: Integration Testing and Acceptance Testing.
Strategies for integrating software components into a functioning product include the bottom-
up strategy, the top-down strategy and the sandwich strategy. Acceptance Testing involves
planning and execution of the functional tests, performance tests and the stress tests to verify
that the implemented system satisfies its requirements.

The System testing does not test the module wise, but the integration of each module in the
systems. System testing helps to find in discrepancies between the original objectives of the
system.

ACCEPTANCE TESTING
Acceptance testing is done with live data provided by the administrator to ensure that the
software works satisfactorily. Acceptance testing focuses on the external behavior of the
system. Giving inputs from actual data tested the system and the results were found to be
satisfactory.

BCCA IV SEMSTER Page 29


DAIRY PRODUCT MANAGEMENT SYSTEM

The inputs are well verified by different conditions at different stages. Suppose the user may
give wrong username or password, then the system will inform the wrong entry. The ID will
be automatically generated for to avoid the redundancy and duplication.
CONCLUSION

The “Dairy Product Management System” is successfully designed and developed to


fulfilling the necessary requirements, as identified in the requirements analysis phase, such
as the system is very much user friendly, form level validation and field level validation are
performing very efficiently.

The new computerized system was found to be much faster and reliable and user friendly
then the existing system, the system has been designed and developed step by step and tested
successfully. It eliminates the human error that are likely to creep in the kind of working in
which a bulk quantity of data and calculations as to be processed.

The system results in quick retrieval of information that is very vital for the progress any
organization. Cost is minimized in case of stationary. Burden of manual work is reduced as
whenever transaction takes place, there is a no need to record it in many places manually.

BCCA IV SEMSTER Page 30


DAIRY PRODUCT MANAGEMENT SYSTEM

APPENDIX

SCREEN SHOTS

Sign up Form

Login Form

BCCA IV SEMSTER Page 31


DAIRY PRODUCT MANAGEMENT SYSTEM

User sign login

Cart & payment

BCCA IV SEMSTER Page 32


DAIRY PRODUCT MANAGEMENT SYSTEM

Product management

Product update

Product view

BCCA IV SEMSTER Page 33


DAIRY PRODUCT MANAGEMENT SYSTEM

All Source Code


Index.php
<!DOCTYPE html>
<html>
<head>
<title>Kunal dairy Shop</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
integrity="sha384-
9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk"
crossorigin="anonymous">

<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
rel="stylesheet">

<link rel="stylesheet" href="http://localhost/dairy/css/style.css" >

<!-- Latest compiled and minified JavaScript -->


<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-
DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
integrity="sha384-
Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"
integrity="sha384-
OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI"
crossorigin="anonymous"></script>
<style type="text/css">

BCCA IV SEMSTER Page 34


DAIRY PRODUCT MANAGEMENT SYSTEM

body{ font: 14px sans-serif; }


.wrapper{ width: 350px; padding: 20px; }
</style>
</head>
<body>
<header class="d-flex w-100">
<nav class="navbar navbar-expand-lg w-100 bg-light">
<div class="navbar-collapse collapse justify-content-between">
<ul class="navbar-nav" id="navbar">
<li class="nav-item active">
<a class="nav-link text-dark"
href="http://localhost/dairy/index.php"><i class="fa fa-shopping-basket text-dark"></i>
dairy</a>
</li>

</ul>
<ul class="navbar-nav">
<div class="d-flex my-2 my-lg-0">
<input id="searchInput" class="form-control mr-sm-2"
type="search" placeholder="Search" aria-label="Search">
<button id="searchBtn"class="btn btn-outline-light m-2 my-
sm-0" type="button">Search</button>
</div>
</ul>
<ul class="navbar-nav">
<li class="nav-item cart mr-4">
<a class="nav-link btn bg-success"
href="http://localhost/dairy/templates/cart.php">
<span class="text-white">0 </span>
<i class="fa fa-shopping-cart text-white"
style="font-size: 18px;"></i>
</a>
</li>

BCCA IV SEMSTER Page 35


DAIRY PRODUCT MANAGEMENT SYSTEM

<li class="nav-item mr-


sm-2">
<a class="nav-link btn btn-dark text-white"
href="http://localhost/dairy/components/user/logout.php"><span><i class="fa fa-sign-out
text-white"></i></span>Sign Out</a>
</li>
</ul>
</div>
</nav>
</header>

<div class="container-fluid page-container">


<div class="d-flex mt-4 mx-4">
<h3>Welcome to dairy Store,
<b> Hassle-free shopping only here </b>
</h3>
</div>

<div class="d-flex my-2">


</div>

<div class="row main-section">


<div class="col-3 my-2">
<div class="card m-auto product" style="width: 20rem;">

<img class="card-img-top" src="http://localhost/dairy/images/products/5.jpg ?


>" alt="Card Image Caption">

<div class="card-body">
<h4 class="card-title">Britannia Winkin’ Cow Milkshakes</h4>
<p class="card-text">britannia milkshake</p>
<p class="price">₹90</p>

BCCA IV SEMSTER Page 36


DAIRY PRODUCT MANAGEMENT SYSTEM

<!-- Button add to cart -->


<button data-pid="1" type="button" class="btn buy-button">
<span class="text-white">
<i class="fa fa-shopping-cart text-white"></i>
Add to cart
</span>
</button>

</div>
</div>
</div><div class="col-3 my-2">
<div class="card m-auto product" style="width: 20rem;">

<img class="card-img-top" src="http://localhost/dairy/images/products/1.jpg ?


>" alt="Card Image Caption">

<div class="card-body">
<h4 class="card-title">Amul Premium Dahi – Creamiest Packaged
Dahi</h4>
<p class="card-text">Amul Premium </p>
<p class="price">₹180</p>

<!-- Button add to cart -->


<button data-pid="2" type="button" class="btn buy-button">
<span class="text-white">
<i class="fa fa-shopping-cart text-white"></i>
Add to cart
</span>
</button>

</div>
</div>
</div><div class="col-3 my-2">
<div class="card m-auto product" style="width: 20rem;">

BCCA IV SEMSTER Page 37


DAIRY PRODUCT MANAGEMENT SYSTEM

<img class="card-img-top" src="http://localhost/dairy/images/products/6.jpg ?


>" alt="Card Image Caption">

<div class="card-body">
<h4 class="card-title">Sleepy Owl Cold Coffee</h4>
<p class="card-text">sleepy owl cold coffee</p>
<p class="price">₹45</p>

<!-- Button add to cart -->


<button data-pid="3" type="button" class="btn buy-button">
<span class="text-white">
<i class="fa fa-shopping-cart text-white"></i>
Add to cart
</span>
</button>

</div>
</div>
</div><div class="col-3 my-2">
<div class="card m-auto product" style="width: 20rem;">

<img class="card-img-top" src="http://localhost/dairy/images/products/2.jpg ?


>" alt="Card Image Caption">

<div class="card-body">
<h4 class="card-title">Mother dairy Fresh Paneer – Creamiest And
Tastiest Paneer</h4>
<p class="card-text">mother dairy paneer</p>
<p class="price">₹120</p>

<!-- Button add to cart -->


<button data-pid="4" type="button" class="btn buy-button">
<span class="text-white">

BCCA IV SEMSTER Page 38


DAIRY PRODUCT MANAGEMENT SYSTEM

<i class="fa fa-shopping-cart text-white"></i>


Add to cart
</span>
</button>

</div>
</div>
</div><div class="col-3 my-2">
<div class="card m-auto product" style="width: 20rem;">

<img class="card-img-top" src="http://localhost/dairy/images/products/3.jpg ?


>" alt="Card Image Caption">

<div class="card-body">
<h4 class="card-title">Mother dairy Tadka Chach – Best
Buttermilk</h4>
<p class="card-text">mother dairy chach</p>
<p class="price">₹120</p>

<!-- Button add to cart -->


<button data-pid="5" type="button" class="btn buy-button">
<span class="text-white">
<i class="fa fa-shopping-cart text-white"></i>
Add to cart
</span>
</button>

</div>
</div>
</div><div class="col-3 my-2">
<div class="card m-auto product" style="width: 20rem;">

<img class="card-img-top" src="http://localhost/dairy/images/products/4.jpg ?


>" alt="Card Image Caption">

BCCA IV SEMSTER Page 39


DAIRY PRODUCT MANAGEMENT SYSTEM

<div class="card-body">
<h4 class="card-title">Amul Cheese Slices – Best Cheese Slices</h4>
<p class="card-text"> amul cheese slices </p>
<p class="price">₹250</p>

<!-- Button add to cart -->


<button data-pid="6" type="button" class="btn buy-button">
<span class="text-white">
<i class="fa fa-shopping-cart text-white"></i>
Add to cart
</span>
</button>

</div>
</div>

</div> </div>

</div>
<!-- footer -->
<footer class="footer-container row justify-content-center mt-4 py-3">
<div class="text-white">All Rights Reserved @2023 | Kunal pahune dairy
Shop</div>
</footer>
<script src="http://localhost/dairy/js/script.js"></script>
</body>
</html>

Connect.php
<?php
$connection = mysqli_connect('localhost', 'root', '');
if (!$connection){

BCCA IV SEMSTER Page 40


DAIRY PRODUCT MANAGEMENT SYSTEM

die("Database Connection Failed" . mysqli_error($connection));


}
$select_db = mysqli_select_db($connection, 'dairy');
if (!$select_db){
die("Database Selection Failed" . mysqli_error($connection));
}

Java script .js


// SEARCH
const searchItem = document.querySelector('#searchInput');
const searchBtn = document.querySelector('button#searchBtn');
const products = document.querySelectorAll('.product');
const mainSection = document.querySelector('.main-section');
function search() {
// console.log('hello', products);
if (!searchItem.value) return;
mainSection.innerHTML = '';
let match = false;
products.forEach(product=>{
let title = product.querySelector('.card-title').innerText.toLowerCase();
if(title.includes(searchItem.value.toLowerCase())){
mainSection.appendChild(product)
match = true;
}
});
if (!match) {
mainSection.innerHTML = `
<div class="d-flex mx-auto">
<h3 class="text-danger text-center">No '${searchItem.value}'
Found</h3>
</div>`;
}
}

BCCA IV SEMSTER Page 41


DAIRY PRODUCT MANAGEMENT SYSTEM

searchBtn.addEventListener('click', search)

document.addEventListener('keyup', (e)=>{
if(e.keyCode !== 13) return;
let isFocused = (document.activeElement === searchItem)
if(isFocused){
this.search()
}
});

// CART
const cart = document.querySelector('.cart span');

const cartProducts = document.querySelector('.cart-products .table tbody'); // get el to fill

function addProduct() {
const pid = this.dataset.pid;
const parent = this.parentNode;
const title = parent.querySelector('.card-title').innerHTML;
const price = parent.querySelector('.price').innerHTML;

let prod = JSON.parse(localStorage.getItem('myCart')) || [];

const item = {
p_id : pid,
title,
price
};

prod.push(item);
localStorage.setItem('myCart', JSON.stringify(prod));
cart.textContent = ' ' + prod.length;
}

BCCA IV SEMSTER Page 42


DAIRY PRODUCT MANAGEMENT SYSTEM

function populate() { // get items on page load


let prod = JSON.parse(localStorage.getItem('myCart')) || 0;
if(prod) cart.textContent = prod.length + ' ';

if (!cartProducts || prod == 0) return;

let total = 0;
prod.forEach( function(el) {
let t = el.price.split('').filter(a=> !isNaN(a)).join(''); //convert to number
total += Number(t);
});

prod = prod.filter((p, index, self) => // filter duplicate


index === self.findIndex((t) => (
t.p_id === p.p_id
))
);

prod.forEach( function(p) { // fill the cart products

const el = document.createElement('tr');
el.innerHTML = (`
<th>${p.p_id}</th>
<td>${p.title}</td>
<td>${p.price}</td>
`);
cartProducts.appendChild(el);
});

cartProducts.append('Total : rs' + total);

BCCA IV SEMSTER Page 43


DAIRY PRODUCT MANAGEMENT SYSTEM

};

populate();

products.forEach( function(element) {
btnAdd = element.querySelector('.buy-button');
btnAdd.addEventListener('click', addProduct)
});

const btnCheckout = document.querySelector('.btn-checkout'); // cart checkou


function checkout(argument) {
localStorage.removeItem('myCart');

cartProducts.innerHTML = '';
cart.textContent = '0 ';
}
if (btnCheckout) {
btnCheckout.addEventListener('click', checkout);
}

Cascading Style Sheets (CSS) is used to format the layout of a webpag.css files
*{
color: black;
}

html, body {
height: 100%;
}

#navbar li a {
color: #eee;
}

#navbar li:hover a {

BCCA IV SEMSTER Page 44


DAIRY PRODUCT MANAGEMENT SYSTEM

color: #fff;
text-decoration: underline;
}

.page-container {
padding-top: 45px;
}

.wrapper {
margin: auto;
}

.footer-container {
position: relative;
left: 0;
bottom: 0;
font-size: 12px;
width: 100%;
margin: auto;
background-color: #28a745;
}

header {
box-shadow: 0px 5px 5px #6c757d6b;
position: fixed;
z-index: 99;
top: 0;
}

.buy-button {
background-color: #28a745;
color: #333;
}

BCCA IV SEMSTER Page 45


DAIRY PRODUCT MANAGEMENT SYSTEM

Products components
Add.php
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/dairy/";

require_once($path . 'connect.php');

// Initialize the session


session_start();

if (!(isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true &&


$_SESSION['role'] == 'admin')) {
echo "Unauthorized Access";
return;
}

if(isset($_POST) & !empty($_POST)){


$title = ($_POST['title']);
$category = ($_POST['category']);
$price = ($_POST['price']);
$brand = ($_POST['brand']);
// store n upload image
$image = $_FILES['image']['name'];
$dir="../img/products/";
$temp_name=$_FILES['image']['tmp_name'];
if($image!="")
{
if(file_exists($dir.$image))
{
$image= time().'_'.$image;
}
$fdir= $dir.$image;
move_uploaded_file($temp_name, $fdir);

BCCA IV SEMSTER Page 46


DAIRY PRODUCT MANAGEMENT SYSTEM

// Execute query
$query = "INSERT INTO `products` (title, category, price, brand, image) VALUES
('$title', '$category', '$price', '$brand', '$image')";
$res = mysqli_query($connection, $query);
if($res){
header('location: view.php');
}else{
$fmsg = "Failed to Insert data.";
print_r($res->error_list);
}
}
?>

<?php require_once($path . 'templates/header.php') ?>

<div class="container">
<?php if(isset($fmsg)){ ?><div class="alert alert-danger" role="alert"> <?php echo
$fmsg; ?> </div><?php } ?>
<h2 class="my-4">Add New Product</h2>
<form method="post" enctype="multipart/form-data">
<div class="form-group">
<label>Title</label>
<input type="text" id="id" class="form-control" name="title"
value="" required/>
</div>
<div class="form-group">
<label>Category</label>
<input type="text" id="id" class="form-control"
name="category" value="" required/>
</div>
<div class="form-group">
<label>Price</label>

BCCA IV SEMSTER Page 47


DAIRY PRODUCT MANAGEMENT SYSTEM

<input type="number" class="form-control" name="price"


value="" required/>
</div>
<div class="form-group">
<label>Brand</label>
<input type="text" class="form-control" name="brand"
value=""/>
</div>
<div class="form-group">
<label>Image</label>
<input type="file" class="form-control" name="image"
accept=".png,.gif,.jpg,.webp" required/>
</div>
<input type="submit" class="btn btn-primary" value="Add Product" />
</form>
</div>

<?php require_once($path . 'templates/footer.php') ?>

Delete.php
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/dairy/";

require_once($path . 'connect.php');

$id = $_GET['id'];
$DelSql = "DELETE FROM `rooms` WHERE id=$id";
$res = mysqli_query($connection, $DelSql);
if($res){
header('location: view.php');
}else{
echo "Failed to delete";
}

BCCA IV SEMSTER Page 48


DAIRY PRODUCT MANAGEMENT SYSTEM

?>
Update.php
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/dairy/";

require_once($path . 'connect.php');

// Initialize the session


session_start();

if (!(isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true &&


$_SESSION['role'] == 'admin')) {
echo "Unauthorized Access";
return;
}

$id = $_GET['id'];

$SelSql = "SELECT * FROM `products` WHERE id=$id";


$res = mysqli_query($connection, $SelSql);
$r = mysqli_fetch_assoc($res);

if(isset($_POST) & !empty($_POST)){


$title = ($_POST['title']);
$price = ($_POST['price']);
$brand = ($_POST['brand']);
// store n upload image
$image = $_FILES['image']['name'];
$dir="../img/products/";
$temp_name=$_FILES['image']['tmp_name'];
if($image!="")
{

BCCA IV SEMSTER Page 49


DAIRY PRODUCT MANAGEMENT SYSTEM

if(file_exists($dir.$image))
{
$image= time().'_'.$image;
}
$fdir= $dir.$image;
move_uploaded_file($temp_name, $fdir);
}else {
$image = $r['image'];
}

// Execute query
$query = "UPDATE `products` SET title='$title', price='$price', brand='$brand',
image='$image' WHERE id='$id'";

$res = mysqli_query($connection, $query);


if($res){
header('location: view.php');
}else{
$fmsg = "Failed to Insert data.";
print_r($res->error_list);
}
}
?>

<?php require_once($path . 'templates/header.php') ?>

<div class="container">
<?php if(isset($fmsg)){ ?><div class="alert alert-danger" role="alert"> <?php echo
$fmsg; ?> </div><?php } ?>
<h2 class="my-4">Add New Product</h2>
<form method="post" enctype="multipart/form-data">
<div class="form-group">
<label>Title</label>
<input type="text" class="form-control" name="title"

BCCA IV SEMSTER Page 50


DAIRY PRODUCT MANAGEMENT SYSTEM

value="<?php echo $r['title'];?>" required/>


</div>
<div class="form-group">
<label>New Price</label>
<input type="text" class="form-control" name="price"
value="<?php echo $r['price'];?>" required/>
</div>
<div class="form-group">
<label>Brand</label>
<input type="text" class="form-control" name="brand"
value="<?php echo $r['brand'];?>"/>
</div>
<div class="form-group">
<label>New Image</label>
<input type="file" class="form-control" name="image"
accept=".png,.gif,.jpg,.webp"/>
</div>
<input type="submit" class="btn btn-primary" value="Update" />
</form>
</div>

<?php require_once($path . 'templates/footer.php') ?>

View.php
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/dairy/";

require_once($path . 'connect.php');

BCCA IV SEMSTER Page 51


DAIRY PRODUCT MANAGEMENT SYSTEM

// Initialize the session


session_start();

if (!(isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true &&


$_SESSION['role'] == 'admin')) {
echo "Unauthorized Access";
return;
}

$ReadSql = "SELECT * FROM `products`";


$res = mysqli_query($connection, $ReadSql);

?>

<?php require($path . 'templates/header.php') ?>


<div class="container-fluid my-4">
<div class="row my-2">
<h2>Online dairy Shop - Products</h2>
<a href="add.php"><button type="button" class="btn btn-primary ml-
4 pl-2">Add New</button></a>
</div>
<table class="table ">
<thead>
<tr>
<th>Prod No.</th>
<th>Title</th>
<th>Price</th>
<th>Brand</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
while($r = mysqli_fetch_assoc($res)){

BCCA IV SEMSTER Page 52


DAIRY PRODUCT MANAGEMENT SYSTEM

?>
<tr>
<th scope="row"><?php echo $r['id']; ?></th>
<td><?php echo $r['title']; ?></td>
<td>$ <?php echo $r['price']; ?></td>
<td><?php echo $r['brand']; ?></td>
<td>
<a href="update.php?id=<?php echo $r['id']; ?
>"><button type="button" class="btn btn-info">Edit</button></a>

<button type="button" class="btn btn-danger btn-xs"


data-toggle="modal" data-target="#myModal<?php echo $r['id']; ?>">Delete</button>

<!-- Modal -->


<div class="modal fade" id="myModal<?php echo
$r['id']; ?>" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->


<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete Product</h5>
<button type="button" class="close" data-dismiss="modal" aria-
label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>Are you sure?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">Cancel</button>
<a href="delete.php?id=<?php echo $r['id']; ?

BCCA IV SEMSTER Page 53


DAIRY PRODUCT MANAGEMENT SYSTEM

>"><button type="button" class="btn btn-danger"> Yes, Delete</button></a>


</div>
</div>

</div>
</div>

</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>

<div id="confirm" class="modal hide fade">


<div class="modal-body">
Are you sure?
</div>
<div class="modal-footer">

<button type="button" data-dismiss="modal" class="btn">Cancel</button>


</div>
</div>

<?php require($path . 'templates/footer.php') ?>

LOGIN FORM SOURCE CODES


<?php
// Initialize the session
session_start();

BCCA IV SEMSTER Page 54


DAIRY PRODUCT MANAGEMENT SYSTEM

// Check if the user is already logged in, if yes then redirect him to welcome page
if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
header("location: index.php");
exit;
}

// Include config file


$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/dairy/";
require_once($path . 'connect.php');

// Define variables and initialize with empty values


$email = $password = "";
$email_err = $password_err = "";

// Processing form data when form is submitted


if($_SERVER["REQUEST_METHOD"] == "POST"){

// Check if email is empty


if(empty(trim($_POST["email"]))){
$email_err = "Please enter email.";
} else{
$email = trim($_POST["email"]);
}

// Check if password is empty


if(empty(trim($_POST["password"]))){
$password_err = "Please enter your password.";
} else{
$password = trim($_POST["password"]);
}

// Validate credentials
if(empty($email_err) && empty($password_err)){

BCCA IV SEMSTER Page 55


DAIRY PRODUCT MANAGEMENT SYSTEM

// Prepare a select statement


$sql = "SELECT id, email, password, role FROM users WHERE email = ?";

if($stmt = $connection->prepare($sql)){
// Bind variables to the prepared statement as parameters
$stmt->bind_param("s", $param_email);

// Set parameters
$param_email = $email;

// Attempt to execute the prepared statement


if($stmt->execute()){
// Store result
$stmt->store_result();

// Check if email exists, if yes then verify password


if($stmt->num_rows == 1){
// Bind result variables
$stmt->bind_result($id, $email, $hashed_password, $role);
if($stmt->fetch()){
if(password_verify($password, $hashed_password)){
// Password is correct, so start a new session
session_start();

// Store data in session variables


$_SESSION["loggedin"] = true;
$_SESSION["id"] = $id;
$_SESSION["email"] = $email;
$_SESSION["role"] = $role;

// Redirect user to welcome page


$url = 'http://' . $_SERVER['HTTP_HOST']; // Get server
$url .= "/dairy/";
header('Location: ' . $url, TRUE, 302);

BCCA IV SEMSTER Page 56


DAIRY PRODUCT MANAGEMENT SYSTEM

} else{
// Display an error message if password is not valid
$password_err = "The password you entered was not valid.";
}
}
} else{
// Display an error message if email doesn't exist
$email_err = "No account found with that email.";
}
} else{
echo "Oops! Something went wrong. Please try again later.";
}

// Close statement
$stmt->close();
}
}

// Close connection
$connection->close();
}
?>
<?php require($path . 'templates/header.php') ?>

<div class="wrapper mx-auto">


<h2>Login</h2>
<p>Please fill in your credentials to login.</p>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"
method="post">
<div class="form-group <?php echo (!empty($email_err)) ? 'has-error' : ''; ?>">
<label>Email</label>
<input type="email" name="email" class="form-control" value="<?php echo
$email; ?>">
<span class="help-block"><?php echo $email_err; ?></span>

BCCA IV SEMSTER Page 57


DAIRY PRODUCT MANAGEMENT SYSTEM

</div>
<div class="form-group <?php echo (!empty($password_err)) ? 'has-error' : ''; ?>">
<label>Password</label>
<input type="password" name="password" class="form-control">
<span class="help-block"><?php echo $password_err; ?></span>
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary" value="Login">
</div>
<p>Don't have an account? <a href="register.php">Sign up now</a>.</p>
<p>Forgot Password? <a href="reset-password.php">Reset Password</a>.</p>
</form>
</div>

<?php require($path . 'templates/footer.php') ?>

Logout.php
<?php
// Initialize the session
session_start();

// Unset all of the session variables


$_SESSION = array();

// Destroy the session.


session_destroy();

// Redirect to login page


header("location: login.php");
exit;
?>

User register.php
<?php

BCCA IV SEMSTER Page 58


DAIRY PRODUCT MANAGEMENT SYSTEM

// Include config file


$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/dairy/";
require_once($path . 'connect.php');

// Define variables and initialize with empty values


$email = $password = $confirm_password = "";
$email_err = $password_err = $confirm_password_err = "";

// Processing form data when form is submitted


if($_SERVER["REQUEST_METHOD"] == "POST"){
$name = trim($_POST["name"]);
// Validate email
if(empty(trim($_POST["email"]))){
$email_err = "Please enter a email.";
} else{
// Prepare a select statement
$sql = "SELECT id FROM users WHERE email = ?";

if($stmt = mysqli_prepare($connection, $sql)){


// Bind variables to the prepared statement as parameters
mysqli_stmt_bind_param($stmt, "s", $param_email);

// Set parameters
$param_email = trim($_POST["email"]);

// Attempt to execute the prepared statement


if(mysqli_stmt_execute($stmt)){
/* store result */
mysqli_stmt_store_result($stmt);

if(mysqli_stmt_num_rows($stmt) == 1){
$email_err = "This email is already registered.";
} else{

BCCA IV SEMSTER Page 59


DAIRY PRODUCT MANAGEMENT SYSTEM

$email = trim($_POST["email"]);
}
} else{
echo "Oops! Something went wrong. Please try again later.";
}

// Close statement
mysqli_stmt_close($stmt);
}
}

// Validate password
if(empty(trim($_POST["password"]))){
$password_err = "Please enter a password.";
} elseif(strlen(trim($_POST["password"])) < 6){
$password_err = "Password must have atleast 6 characters.";
} else{
$password = trim($_POST["password"]);
}

// Validate confirm password


if(empty(trim($_POST["confirm_password"]))){
$confirm_password_err = "Please confirm password.";
} else{
$confirm_password = trim($_POST["confirm_password"]);
if(empty($password_err) && ($password != $confirm_password)){
$confirm_password_err = "Password did not match.";
}
}

// Check input errors before inserting in database


if(empty($email_err) && empty($password_err) && empty($confirm_password_err)){

// Prepare an insert statement

BCCA IV SEMSTER Page 60


DAIRY PRODUCT MANAGEMENT SYSTEM

$sql = "INSERT INTO users (name, email, password) VALUES (?, ?, ?)";
$stmt = mysqli_prepare($connection, $sql);
if($stmt){
// Bind variables to the prepared statement as parameters
mysqli_stmt_bind_param($stmt, "sss", $param_name, $param_email,
$param_password);

// Set parameters
$param_name = $name;
$param_email = $email;
$param_password = password_hash($password, PASSWORD_DEFAULT); //
Creates a password hash

// Attempt to execute the prepared statement


if(mysqli_stmt_execute($stmt)){
// Redirect to login page
header("location: login.php");
} else{
echo "Something went wrong. Please try again later.\n";
print_r($stmt->error_list);
}

// Close statement
mysqli_stmt_close($stmt);
}
}

// Close connection
mysqli_close($connection);
}
?>

<?php require($path . 'templates/header.php') ?>

BCCA IV SEMSTER Page 61


DAIRY PRODUCT MANAGEMENT SYSTEM

<div class="wrapper mx-auto">


<h2>Sign Up</h2>
<p>Please fill this form to create an account.</p>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"
method="post">
<div class="form-group">
<label>Name</label>
<input type="text" name="name" class="form-control" value="">
</div>
<div class="form-group <?php echo (!empty($email_err)) ? 'has-error' : ''; ?>">
<label>Email</label>
<input type="email" name="email" class="form-control" value="<?php echo
$email; ?>" required>
<span class="help-block"><?php echo $email_err; ?></span>
</div>
<div class="form-group <?php echo (!empty($password_err)) ? 'has-error' : ''; ?>">
<label>Password</label>
<input type="password" name="password" class="form-control" value="<?php
echo $password; ?>" required>
<span class="help-block"><?php echo $password_err; ?></span>
</div>
<div class="form-group <?php echo (!empty($confirm_password_err)) ? 'has-error' :
''; ?>">
<label>Confirm Password</label>
<input type="password" name="confirm_password" class="form-control"
value="<?php echo $confirm_password; ?>" required>
<span class="help-block"><?php echo $confirm_password_err; ?></span>
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary" value="Submit">
<input type="reset" class="btn btn-default" value="Reset">
</div>
<p>Already have an account? <a href="login.php">Login here</a>.</p>
</form>

BCCA IV SEMSTER Page 62


DAIRY PRODUCT MANAGEMENT SYSTEM

</div>

<?php require($path . 'templates/footer.php') ?>

Password reset.php
<?php
// Initialize the session
session_start();

// Include config file


$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/dairy/";
require_once($path . 'connect.php');

// Define variables and initialize with empty values


$new_password = $confirm_password = "";
$new_password_err = $confirm_password_err = "";

// Processing form data when form is submitted


if($_SERVER["REQUEST_METHOD"] == "POST"){

// Validate new password


if(empty(trim($_POST["new_password"]))){
$new_password_err = "Please enter the new password.";
} elseif(strlen(trim($_POST["new_password"])) < 6){
$new_password_err = "Password must have atleast 6 characters.";
} else{
$new_password = trim($_POST["new_password"]);
}

// Validate confirm password


if(empty(trim($_POST["confirm_password"]))){
$confirm_password_err = "Please confirm the password.";
} else{

BCCA IV SEMSTER Page 63


DAIRY PRODUCT MANAGEMENT SYSTEM

$confirm_password = trim($_POST["confirm_password"]);
if(empty($new_password_err) && ($new_password != $confirm_password)){
$confirm_password_err = "Password did not match.";
}
}

// Check input errors before updating the database


if(empty($new_password_err) && empty($confirm_password_err)){
// Prepare an update statement
$sql = "UPDATE users SET password = ? WHERE id = ?";

if($stmt = $connection->prepare($sql)){
// Bind variables to the prepared statement as parameters
$stmt->bind_param("si", $param_password, $param_id);

// Set parameters
$param_password = password_hash($new_password, PASSWORD_DEFAULT);
$param_id = $_SESSION["id"];

// Attempt to execute the prepared statement


if($stmt->execute()){
// Password updated successfully. Destroy the session, and redirect to login page
session_destroy();
header("location: login.php");
exit();
} else{
echo "Oops! Something went wrong. Please try again later.";
}

// Close statement
$stmt->close();
}
}

BCCA IV SEMSTER Page 64


DAIRY PRODUCT MANAGEMENT SYSTEM

// Close connection
$connection->close();
}
?>
<?php require($path . 'templates/header.php') ?>

<div class="wrapper">
<h2>Reset Password</h2>
<?php // check user login
if (!$user_logged) {
echo "You need to be logged in to reset.";
return;
}
?>
<p>Please fill out this form to reset your password.</p>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"
method="post">
<div class="form-group <?php echo (!empty($new_password_err)) ? 'has-error' : ''; ?
>">
<label>New Password</label>
<input type="password" name="new_password" class="form-control" value="<?
php echo $new_password; ?>">
<span class="help-block"><?php echo $new_password_err; ?></span>
</div>
<div class="form-group <?php echo (!empty($confirm_password_err)) ? 'has-error' :
''; ?>">
<label>Confirm Password</label>
<input type="password" name="confirm_password" class="form-control">
<span class="help-block"><?php echo $confirm_password_err; ?></span>
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary" value="Submit">
<a class="btn btn-link" href="welcome.php">Cancel</a>
</div>

BCCA IV SEMSTER Page 65


DAIRY PRODUCT MANAGEMENT SYSTEM

</form>
</div>

<?php require($path . 'templates/footer.php') ?>

BCCA IV SEMSTER Page 66


DAIRY PRODUCT MANAGEMENT SYSTEM

CONCLUSION
The totality of available scientific evidence supports that intake of
milk and dairy products contribute to meet nutrient
recommendations, and may protect against the most prevalent
chronic diseases, whereas very few adverse effects have been
reported.

BCCA IV SEMSTER Page 67


DAIRY PRODUCT MANAGEMENT SYSTEM

BIBLIOGRAPHY
BOOK REFERENCE
The Joy of PHP Programming: A Beginner’s Guide to Programming Interactive Web
Applications with PHP and MySQL, Alan Forbes, Plum Island Publication, Fifth Edition,
2015.
Atkinson, Leon. Core PHP Programming: Using PHP to Build Dynamic Web Sites, Second
Edition. Upper Saddle River, NJ: Prentice Hall PTR, 2001.
Programming in the PHP Environment, Damien Watking, Mark Hammond, Brand Abrams,
APress S Publications, 2002.
Software Engineering Concepts, Richard E.Fairly, Tata McGraw-Hill Education Private
Limited, 2011.

BCCA IV SEMSTER Page 68

You might also like