Sie sind auf Seite 1von 12

Report

Cafeteria Attendance Management System as a foil to deter wastage of food


ABSTRACT
Food wastage is indeed a very alarming and terrifying issue that a majority of the population is
facing. World Food Organisation (WFO) says that every seventh person is hungry in the world
while on the other hand, tons of food is being wasted every day. According to the United States
Development Programme, up to 40% of the food produced in India is wasted. India ranks 100 in
the Global Hunger Index among 119 countries. Along with this, food waste also has negative
effects on environment and public health. Even as millions of people do not have access to
drinking water, 25% of the fresh water used to produce food is ultimately wasted. Deforestation,
unsustainable agricultural practices, and excessive groundwater extraction to meet the food
demand has led to approximately 45% degradation of India’s land. The issue requires serious
action and the youth of the nation can work towards it to make an impact. Schools can play a vital
role in the fight against food waste as it only takes a bit of imagination and a better understanding
of the problem, its causes and solutions. By ensuring the reduction of food waste, we could
potentially feed people suffering from malnutrition globally.
As managing the leftover food also becomes quite troublesome, through this project, we intend
to solve the root cause of this problem by emphasising on avoiding the extra food prepared, at
least on a smaller scale.

INTRODUCTION
Food management is an extensive course of action that involves the appropriate supervision of
food assortment, preparation, arrangement, and conservation. The need for such a system cannot
be explained better than the example of a poor individual who does not even have a onetime meal
in their daily fate. The history of such a system is long and the trend is needed more with the
passage of time. Keeping food from being squandered has benefits in boosting the accessibility
of food locally, decreasing expenses and land used to dispose of food waste. It also helps in
maintaining a strategic distance from ozone depleting substance emanations, especially methane.
Most of the wasted food winds up in landfills and after that separates to create methane and carbon
dioxide discharges, which leads to environmental change.
Food is wasted in many ways particularly in functions where, just for the sake of showcase, people
keep variety of food items, even though people have limited eating capacity. Then adding on to
that, people also take everything to taste but unfortunately do not finish it. Normally in a school
mess, food is prepared according to the total number of students, because they have no idea about
the kids who are not interested in having their meals in mess on that day. Additionally, children
consider their likes and dislikes while eating food. Keeping in mind the menu, whenever they do
not intend to eat in the mess, they bring their lunch box or buy something from the school canteen.
If food is prepared but not consumed, then the prepared food is directly wasted. By reducing the
amount of food wasted and increasing the amount consumed, of course the beneficial outcome
would be improved nutritional intake. That is why there is a need for pre-planning.
Therefore, there is a dire need for a system that allows for management for food waste. In this
report, we will discuss an Attendance Management System (AMS) that has been programmed for
day-boarding and boarding students to ensure that sufficient amount of food is prepared in the
school mess. The purpose of developing this system is to automate a system by giving the school
mess relevant information about the total strength of the turnout in time so that the food can be
prepared according to the mentioned strength. Another purpose of this system is to digitize the
traditional way of taking attendance.
PROPOSED SYSTEM
The project includes a daily attendance entry of the students interested in having the food in the
school mess. It has a search facility for the mess department to know the total expected students
in mess. The Attendance Management System can be entered by a username and password. It is
accessible either by the class teachers or the mess manager. Only class teachers can add data and
the mess manager can only retrieve the data from the database. The software has been developed
using Java as frontend and MySQL as the backend. The existing application gathers information
from all the class teachers.

METHODOLOGY
To connect Java application with the MySQL database, we need to follow 4 following steps.

Driver class:
• The driver class for mysql database is "java.sql.DriverManager".

Connection URL:
• The connection URL for the mysql database
is jdbc:mysql://localhost:3306/cbse where jdbc is the API, mysql is the
database, localhost is the server name on which mysql is running, 3306 is the
port number and cbse is the database name.

Username:
• The default username for the mysql database is root.

Password:
• It is the password given by the user at the time of installing the mysql
database. In this application, I have used 1234 as the password.

DATABASE DESIGN
This software contains the following table, where the number of absentees for half day and full
day are mentioned separately by the class teacher.
The application has seven forms and the code required to create it is given below:

WORKING OF THE SYSTEM


1. WELCOME PAGE

this.setVisible(false);
new Function ().setVisible(true);

2. ADD OR RETRIEVE (To provide a choice to the user)

private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {


if(jRadioButton1.isSelected()==true)
{ dispose();
Add s= new Add();
s.setVisible(true);
}
} private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {
if(jRadioButton2.isSelected()==true)
{ dispose();
search s= new search();
s.setVisible(true);
}
} private void jRadioButton3ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}

3. LOGIN FOR TEACHERS

import javax.swing.JLabel;
import javax.swing.JOptionPane;
String uname = jTextField1.getText ();
String pass = jPasswordField1.getText ();
if(uname.equals("admin") && pass.equals("admin"))
{ Function s= new Function();
s.setVisible(true);
} else
{ JOptionPane.showMessageDialog(this,"Incorrect login or password",
"Error",JOptionPane.ERROR_MESSAGE);
}
} private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
4. LOGIN FOR MANAGER
String uname = jTextField1.getText();
String pass = jPasswordField1.getText();
if(uname.equals("mess") && pass.equals("mess"))
{

search s= new search();


s.setVisible(true);
}
else
{
JOptionPane.showMessageDialog(this,"Incorrect login or password",
"Error",JOptionPane.ERROR_MESSAGE); }

4. ADD INFORMATION(for class teachers to enter the number of absentees)

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Statement;
import java.awt.HeadlessException;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.swing.JOptionPane;
{ String ClassTeacher =jTextField1.getText();
String Classs =jTextField2.getText();
String Section =jTextField3.getText();
String Absenthalfday =jTextField4.getText();
String Absentfullday =jTextField5.getText();
String Date=jTextField6.getText();
if(ClassTeacher.isEmpty()) {
JOptionPane.showMessageDialog(this, "Class Teacher Not Entered");
}
else if(Classs.isEmpty()) {
{
JOptionPane.showMessageDialog(this, "Class Not Entered");
}
} else if(Section.isEmpty()) {
JOptionPane.showMessageDialog(this, "Section Not Entered");
} else if(Absenthalfday.isEmpty()) {
JOptionPane.showMessageDialog(this, "Absenthalf Not Entered");
} else if(Absentfullday.isEmpty()) {
JOptionPane.showMessageDialog(this, "Absentfull Not Entered");
} else if(Date.isEmpty()) {
JOptionPane.showMessageDialog(this, "date Not Entered");
} else
{ try {
Class.forName("java.sql.DriverManager");
Connection con = (Connection)
DriverManager.getConnection
("jdbc:mysql://localhost:3306/cbse","root","1234");
Statement stmt=(Statement) con.createStatement();
String query="INSERT INTO STUDENT VALUES('"+ClassTeacher+"',
'"+Classs+"','"+Section+"','"+Absenthalfday+"','"+Absentfullday+"','"+Date+"');";
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(this, "Added a New Data");
}
catch(HeadlessException e)
{
JOptionPane.showMessageDialog(this, e.getMessage());
} catch (ClassNotFoundException e) {
JOptionPane.showMessageDialog(this, e.getMessage());
} catch (SQLException e) {
JOptionPane.showMessageDialog(this, e.getMessage());
}
}
} private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");
}

6. SEARCH (for the mess manager to retrieve information from database)


import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Statement;
import java.awt.HeadlessException;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;
{ String Date =jTextField6.getText();
if(Date.isEmpty())
{ jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");
JOptionPane.showMessageDialog(this, "Enter Date");
} else
{ try
{ Class.forName("java.sql.DriverManager");
Connection con = (Connection)
DriverManager.getConnection
("jdbc:mysql://localhost:3306/cbse","root","1234");
Statement stmt=(Statement) con.createStatement();
String query = "select SUM(Absenthalfday),SUM(Absentfullday),Date from student
where Date='"+Date+"';"; //CAN USE ORDERBY CLAUSE HERE
ResultSet rs =stmt.executeQuery(query);
if(rs.next())
{ String Absenthalfday=rs.getString("sum(Absenthalfday)");
String Absentfullday =rs.getString("sum(Absentfullday)");
jTextField4.setText(Absenthalfday);
jTextField5.setText(Absentfullday);
} else {
JOptionPane.showMessageDialog(this, "Sorry There is No Such Entry");
}
} catch(HeadlessException e)
{ JOptionPane.showMessageDialog(this,e.getMessage());
} catch (ClassNotFoundException e) {
JOptionPane.showMessageDialog(this,e.getMessage());
} catch (SQLException e) {
JOptionPane.showMessageDialog(this,e.getMessage());
}
}
} private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");

7. RECORD OF THE DAY IN TABULAR FORM

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Statement;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
DefaultTableModel model=(DefaultTableModel)
jTable1.getModel();
try
{
Class.forName("java.sql.DriverManager");
Connection con = (Connection)
DriverManager.getConnection("jdbc:mysql://localhost:3306/cbse","root","1234");
Statement stmt=(Statement)
con.createStatement();
String query="SELECT * FROM STUDENT";
ResultSet rs =stmt.executeQuery(query);
while(rs.next())
{ String ClassTeacher =rs.getString("ClassTeacher");
String Classs =rs.getString("Classs");
String Section =rs.getString("Section");
String Absenthalfday =rs.getString("Absenthalfday");
String Absentfullday =rs.getString("Absentfullday");
String Date=rs.getString("Date");
Model.addRow(new Object[] {ClassTeacher,Classs,Section,Absenthalfday,
Absentfullday,Date,});
}
}catch(ClassNotFoundException e)
{ JOptionPane.showMessageDialog(this,e.getMessage());
} catch (SQLException e) {
JOptionPane.showMessageDialog(this,e.getMessage()); }
} private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
DefaultTableModel model=(DefaultTableModel)
jTable1.getModel(); int rows=model.getRowCount();
if(rows>0)
{
for(int i=0;i<rows; i++) {
model.removeRow(0); }
}
} private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0); }

8. IMPACT MADE

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Statement;
import java.sql.DriverManager;
import java.sql.ResultSet;
import javax.swing.JOptionPane;

String Section =jTextField5.getText();


{
try {

Class.forName("java.sql.DriverManager");
Connection con = (Connection)
DriverManager.getConnection
("jdbc:mysql://localhost:3306/cbse","root","1234");
Statement stmt=(Statement) con.createStatement();
String query = "select Absenthalfday*0.5+Absentfullday*0.5 as
totalfood,Absenthalfday*50+Absentfullday*50 as totalmoney
(Absenthalfday*50+Absentfullday*50)/25 from student where classs='"+Classs+"' and
section='"+Section+"';";
stmt.executeUpdate(query);
ResultSet rs =stmt.executeQuery(query);
if(rs.next())
{

String totalfood=rs.getString("totalfood");
String totalmoney =rs.getString("totalmoney)");
String people=rs.getString("people");

jTextField1.setText(totalfood);
jTextField2.setText(totalmoney);
jTextField3.setText(people);}

}
catch(Exception e){

JOptionPane.showMessageDialog(this, e.getMessage());}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
{
System.exit(0);
}

 Welcome Page: Welcomes the user to the application.

 Add or Retrieve: This module provides two choices to the user. Class teachers choose
‘Add’ as they have to provide the information to the database and the mess manager
chooses ‘Search’ in order to retrieve the information

 Login to add information: The Username and Password is provided to the class teachers
to get access to the application.
 Add Information: It opens for class teachers wherein they need to fill in all the required
details. This information gets stored in the backend i.e. MySQL database.
 Impact Made: After giving the required data, the class teachers can look at the difference
made by them in saving the food.

 Login to retrieve information: The Username and Password is provided to the Mess
manager to get access to the application.

 Retrieve Information: Just by clicking on the Search button, it retrieves data from the
database and the manager gets the number of students who will be absent in Breakfast
(Absent half day) and in Lunch (Absent Full Day).

 Detailed record of the day: If the Manager tends to look at the absentees of each class
separately, then this module will solve the purpose and provide the entire information for
a day in tabular form.

CONCLUSION:
With this small effort, we can save a little food every day, which in long run will make a huge
difference.
ADVANTAGES OF THE PROPOSED SYSTEM
Computers can always work more effectively than human beings. The accuracy of data is
maintained. The work becomes convenient for the people handling huge data. Any specific
information can be achieved from the stored information within a short period of time without
any confusion, which saves a lot of time. Login system protects the data, so that the unauthorised
people cannot access the data. Complexity of the data can be reduced which was not possible in
manual system.

REFERENCES
1. https://thecsrjournal.in/food-wastage-in-india-a-serious-concern/
2. https://www.seminarsonly.com/Engineering-
Projects/Computer/Student_Attendance_Management_System.php
3. https://thecsrjournal.in/food-wastage-india/
4. https://ensia.com/features/school-food-waste-solutions/
5. https://www.foodforsoul.it/about-us/news-stories/news/reducing-food-waste-school-can-
teachers-students-help/

Das könnte Ihnen auch gefallen