Dairy Final
Dairy Final
Dairy Final
PROJECT REPORT
ON
Submitted to
NAGPUR
In partial fulfillment of
Submitted by
Dr.Ajay Ramteke
Assistant Professor
Nagpur -441111
2022-2023
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.
Assistant Professor
DECLARATION
To,
The Principal
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,
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.
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.
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
2.4.1 Economic
2.4.2 Technical
2.4.3 Operational
5. IMPLEMENTATION 26-28
6. CONCLUSIONS 67
7. BIBLIOGRAPHY 68
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
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.
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
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.
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
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
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.
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.
Characteristics of PHP
Five important characteristics make PHP's practical nature possible −
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.
ADVANTAGES OF PHP
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.
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.
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
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)
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.
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.
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.
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.
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.
LEVEL – 0
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
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.
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.
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
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.
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.
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 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.
APPENDIX
SCREEN SHOTS
Sign up Form
Login Form
Product management
Product update
Product view
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
rel="stylesheet">
</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>
<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>
</div>
</div>
</div><div class="col-3 my-2">
<div class="card m-auto product" style="width: 20rem;">
<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>
</div>
</div>
</div><div class="col-3 my-2">
<div class="card m-auto product" style="width: 20rem;">
<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>
</div>
</div>
</div><div class="col-3 my-2">
<div class="card m-auto product" style="width: 20rem;">
<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>
</div>
</div>
</div><div class="col-3 my-2">
<div class="card m-auto product" style="width: 20rem;">
<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>
</div>
</div>
</div><div class="col-3 my-2">
<div class="card m-auto product" style="width: 20rem;">
<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>
</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){
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');
function addProduct() {
const pid = this.dataset.pid;
const parent = this.parentNode;
const title = parent.querySelector('.card-title').innerHTML;
const price = parent.querySelector('.price').innerHTML;
const item = {
p_id : pid,
title,
price
};
prod.push(item);
localStorage.setItem('myCart', JSON.stringify(prod));
cart.textContent = ' ' + prod.length;
}
let total = 0;
prod.forEach( function(el) {
let t = el.price.split('').filter(a=> !isNaN(a)).join(''); //convert to number
total += Number(t);
});
const el = document.createElement('tr');
el.innerHTML = (`
<th>${p.p_id}</th>
<td>${p.title}</td>
<td>${p.price}</td>
`);
cartProducts.appendChild(el);
});
};
populate();
products.forEach( function(element) {
btnAdd = element.querySelector('.buy-button');
btnAdd.addEventListener('click', addProduct)
});
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 {
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;
}
Products components
Add.php
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/dairy/";
require_once($path . 'connect.php');
// 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);
}
}
?>
<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>
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";
}
?>
Update.php
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/dairy/";
require_once($path . 'connect.php');
$id = $_GET['id'];
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'";
<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"
View.php
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/dairy/";
require_once($path . 'connect.php');
?>
?>
<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>
</div>
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
// 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;
}
// Validate credentials
if(empty($email_err) && empty($password_err)){
if($stmt = $connection->prepare($sql)){
// Bind variables to the prepared statement as parameters
$stmt->bind_param("s", $param_email);
// Set parameters
$param_email = $email;
} 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>
<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>
Logout.php
<?php
// Initialize the session
session_start();
User register.php
<?php
// Set parameters
$param_email = trim($_POST["email"]);
if(mysqli_stmt_num_rows($stmt) == 1){
$email_err = "This email is already registered.";
} else{
$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"]);
}
$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
// Close statement
mysqli_stmt_close($stmt);
}
}
// Close connection
mysqli_close($connection);
}
?>
</div>
Password reset.php
<?php
// Initialize the session
session_start();
$confirm_password = trim($_POST["confirm_password"]);
if(empty($new_password_err) && ($new_password != $confirm_password)){
$confirm_password_err = "Password did not match.";
}
}
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"];
// Close statement
$stmt->close();
}
}
// 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>
</form>
</div>
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.
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.