Online Food Ordering System Mbs (2) - Removed
Online Food Ordering System Mbs (2) - Removed
21CSC203P/ADVANCED PROGRAMMING
PRACTICE PROJECT REPORT
Submitted by
SRINITHESH R RA2311003050313
Under the guidance of
Dr. JAYA.
(Assistant Professor, School of Computing)
of
BACHELOR OF TECHNOLOGY
in
Of
BONAFIDECERTIFICATE
SIGNATURE SIGNATURE
Submitted for the project viva-voce held on ___________ at SRM Institute of Science and
Technology, Tiruchirappalli.
2
SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY
TIRUCHIRAPPALLI
DECLARATION
We hereby declare that the entire work contained in this project report titled
ONLINE FOOD ORDERING SYSTEM has been carried out by METHUN RAJ A
Place: Tiruchirappalli
Date: 12/11/2024
METHUN RAJ A RA2311003050180
BRIJESH SUDHARSAN V RA2311003050190
SRINITHESH R RA2311003050313
3
ABSTRACT
Electricity consumers are often faced with the problem of inaccuracy and
delay in monthly billing due to some drawbacks. Thus, it is essential to have
an efficient system for such purposes via electronic platform with
consideration to proximity. The proposed system automates the conventional
process of paying electricity bill by visiting the Electricity Board which is
tiresome and time consuming. It is also designed to automate the electricity
bill calculation and payment for user convenience. The system is developed
with Java swings as the base programming language which can be used to
develop websites, web applications and web services. The Microsoft
Structured Query Language (SQL) server is also used for creating back-end
database. The system would be having two logins: the administrative and
user login. The administrator can view the user's account details and can add
the customer's information of consuming units of energy of the current
month in their account. The Admin must feed the system with the electricity
usage data into respective user’s account. The system then calculates the
electricity bill for every user and updates the information into their account
every month. Users can then view their electricity bill and pay before the
month end.
4
TABLE OF CONTENTS
Page .no
ABSTRACT........................................................................................................4
LIST OF FIGURES.............................................................................................8
1. Introduction.....................................................................................................10
1.1Introduction................................................................................................10
1.2 Problem.Statement....................................................................................12
1.3 Objectives.................................................................................................13
2. Existing System.............................................................................................15
4. Implementation (Java)...................................................................................27
4.1 Electricity billing system……...............................................................27
4.2 LoadingDiaglog…………………...........................................................37
4.3 LoginPage………………........................................................................38
6. Conclusion......................................................................................................47
7. References.......................................................................................................49
5
LIST OF FIGURES
6
LIST OF ACRONYMS AND ABBREVIATIONS
• Eg - Example
• OS – Operating System
• GUI - Graphical User Interface
• UAC – User Account Control
• JAR – Java Archive
• IDE – Integrated Development Environment
• JDK - Java Development Kit
7
CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION
8
1.2 PROBLEM STATEMENT:
very time consuming and laborious process because, staff need to be visited
the customers place every month to give the bills and to receive the payments.
9
1.3 OBJECTIVES:
• This project system excludes the need of maintaining paper electricity bill
as all the electricity bill records are managed electronically.
• Administrator doesn't have to keep a manual track of the users. The system
automatically calculates fine.
• There is no need of delivery boy for delivery bills to user's place. Thus, it
CHAPTER 2
EXISTING SYSTEM
CHAPTER 2: EXISTING SYSTEM
Hardware Requirements:
Software Requirements:
11
➢ Operating System: -Windows 10
• .
GUI allows users to log in, view buses, select seats, and confirm
3. Security Features:
12
• The system employs password hashing with SHA-256 to ensure that
user credentials are never stored in plain text, safeguarding user data
• User sessions are managed to maintain data integrity and ensure that
hardware configurations.
13
CHAPTER 3
DESIGN (ER DESIGN) AND PROPOSED METHODOLOGY
3.1 BLOCK DIAGRAM
15
Key Components:
1. User Interface (Java Swing):
• Provides windows or dialogs for users to interact with.
• Buttons, labels, text fields, combo boxes for users to select their
order, enter details, and submit.
•
2. Controller:
• Acts as a mediator between the UI and database.
• Handles user actions (button clicks, form submissions) and
processes them accordingly.
.
3. Database Queries:
• CRUD (Create, Read, Update, Delete) operations to interact with
the database for fetching menu items, saving orders, and updating
stock levels.
PROPOSED METHODOLOGY
1. Start:
• The application begins by initializing the necessary resources and
configurations.
Initialize System:
Set up the graphical user interface (GUI) components such as login, menu
items, and buttons.
• Establish a connection to the MySQL database.
• Load the menu items and order history (if needed) from the
database.
17
3.3 ENTITY RELATIONSHIP DIAGRAM IN JAVA
PROPOSED METHODOLOGY
A primary key is a table column that can be used to uniquely identify every row of the table.
Any column that has this property, these columns are called candidate key. A composite
primary key is a primary key consisting of more than one column. A foreign is a column or
combination of columns that contains values that are found in the primary key of some table.
All the attributes of each table are interconnected by foreign key which is primary key in
another column and composite key. Primary key cannot be null. The fact that many foreign
key values repeat simply reflects the fact that its one-to-many relationship. In one-to-many
relationship, the primary key has the one value and foreign key has many values.
Figure 3.1.2 is a Schema diagram of Electricity Billing System which has six tables i.e.,
login, customer, tax, rent, bill, and meter_info where each table contain attributes some with
primary key, foreign key. In the login table there are 6 attributes "meter_no”, "username”,
“password”, "user”, "question”, "answer”. The customer table has 7 attributes "name”,
"meter_no"(primary key), "address”, "city”, "state”, “email”, "phone”. The rent table has 3
attributes "cost_per_unit"(primary key), " meter_rent”, "service_charge". The tax table has 3
attributes " service_tax”, "swacch_bharat_cess”, "gst”. The bill table has 5 attributes
"meter_no"(foreign key that references the primary key of the customer table meter_no),
"month”, "units”,"total_bill”, "status”. The meter_info table has 6 attributes
"meter_no"(foreign key that references the primary key of the customer table meter_no),
"meter_location”, "meter_type”, "phase_code”, " bill_type”, "days "
21
CHAPTER 4
IMPLEMENTATION (JAVA)
4. IMPLEMENTATION IN JAVA
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.ResultSet;
Choice loginASCho;
TextField meterText,EmployerText,userNameText,nameText,passwordText;
JButton create,back;
Signup(){
super("Signup Page");
getContentPane().setBackground(new Color(168,203,255));
23
JLabel createAs = new JLabel("Create Account As");
createAs.setBounds(30,50,125,20);
add(createAs);
loginASCho.add("Admin");
loginASCho.add("Customer");
loginASCho.setBounds(170,50,120,20);
add(loginASCho);
meterNo.setBounds(30,100,125,20);
meterNo.setVisible(false);
add(meterNo);
24
meterText.setBounds(170,100,125,20);
meterText.setVisible(false);
add(meterText);
Employer.setBounds(30,100,125,20);
Employer.setVisible(true);
add(Employer);
EmployerText.setBounds(170,100,125,20);
EmployerText.setVisible(true);
add(EmployerText);
userName.setBounds(30,140,125,20);
add(userName);
25
userNameText = new TextField();
userNameText.setBounds(170,140,125,20);
add(userNameText);
name.setBounds(30,180,125,20);
add(name);
nameText.setBounds(170,180,125,20);
add(nameText);
meterText.addFocusListener(new FocusListener() {
@Override
26
}
@Override
try{
if (resultSet.next()){
nameText.setText(resultSet.getString("name"));
E.printStackTrace();
});
27
JLabel password = new JLabel("Password");
password.setBounds(30,220,125,20);
add(password);
passwordText.setBounds(170,220,125,20);
add(passwordText);
loginASCho.addItemListener(new ItemListener() {
@Override
if (user.equals("Customer")){
Employer.setVisible(false);
nameText.setEditable(false);
28
EmployerText.setVisible(false);
meterNo.setVisible(true);
meterText.setVisible(true);
}else {
Employer.setVisible(true);
EmployerText.setVisible(true);
meterNo.setVisible(false);
meterText.setVisible(false);
});
create.setBackground(new Color(66,127,219));
create.setForeground(Color.black);
create.setBounds(50,285,100,25);
29
create.addActionListener(this);
add(create);
back.setBackground(new Color(66,127,219));
back.setForeground(Color.black);
back.setBounds(180,285,100,25);
back.addActionListener(this);
add(back);
ImageIcon(ClassLoader.getSystemResource("icon/boy.png"));
Image boyImg =
boyIcon.getImage().getScaledInstance(250,250,Image.SCALE_DEFAULT);
boyLabel.setBounds(320,30,250,250);
add(boyLabel);
30
setSize(600,380);
setLocation(500,200);
setLayout(null);
setVisible(true);
@Override
if (e.getSource()== create){
try{
31
String query= null;
if (loginASCho.equals("Admin")) {
}else {
c.statement.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Account Created");
setVisible(false);
new Login();
E.printStackTrace();
} else if (e.getSource()==back) {
32
setVisible(false);
new Login();
new Signup();
ackage electricity.billing.system;
import java.sql.*;
Connection connection;
Statement statement;
database(){
try {
33
connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/Bill_system","root
","AyushVish");
statement = connection.createStatement();
e.printStackTrace();
package electricity.billing.system;
import net.proteanit.sql.DbUtils;
import javax.swing.*;
import java.awt.*;
imort java.sql.ResultSet;
String meter;
bill_details(String meter){
this.meter =meter;
34
setSize(700,650);
setLocation(400,150);
setLayout(null);
getContentPane().setBackground(Color.WHITE);
try{
table.setModel(DbUtils.resultSetToTableModel(resultSet));
e.printStackTrace();
sp.setBounds(0,0,700,650);
add(sp);
35
setVisible(true);
new bill_details("");
package electricity.billing.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.ResultSet;
Choice searchmonthcho;
String meter;
JTextArea area;
JButton bill;
36
generate_bill(String meter){
this.meter=meter;
setSize(500,700);
setLocation(500,30);
searchmonthcho.add("January");
searchmonthcho.add("February");
searchmonthcho.add("March");
searchmonthcho.add("April");
searchmonthcho.add("May");
37
searchmonthcho.add("June");
searchmonthcho.add("July");
searchmonthcho.add("August");
searchmonthcho.add("September");
searchmonthcho.add("October");
searchmonthcho.add("November");
searchmonthcho.add("December");
area.setFont(new Font("Senserif",Font.ITALIC,15));
bill.addActionListener(this);
add(pane);
panel.add(heading);
panel.add(meter_no);
38
panel.add(searchmonthcho);
add(panel,"North");
add(bill,"South");
setVisible(true);
@Override
try{
"+smonth+",2023\n\n\n");
if (resultSet.next()){
"+resultSet.getString("name"));
39
area.append("\n Customer Meter Number:
"+resultSet.getString("meter_no"));
"+resultSet.getString("address"));
"+resultSet.getString("email"));
"+resultSet.getString("phone_no"));
package electricity.billing.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
40
public class meterInfo extends JFrame implements ActionListener {
JButton submit;
String meternumber;
meterInfo(String meternumber){
this.meternumber=meternumber;
panel.setLayout(null);
panel.setBackground(new Color(252,186,3));
add(panel);
heading.setBounds(180,10,200,20);
heading.setFont(new Font("Tahome",Font.BOLD,20));
panel.add(heading);
41
JLabel meterNumber = new JLabel("Meter Number");
meterNumber.setBounds(50,80,100,20);
panel.add(meterNumber);
meterNumberText.setBounds(180,80,150,20);
panel.add(meterNumberText);
meterLoc.setBounds(50,120,100,20);
panel.add(meterLoc);
meterLocCho.add("Outside");
meterLocCho.add("Inside");
meterLocCho.setBounds(180,120,150,20);
42
panel.add(meterLocCho);
meterTyp.setBounds(50,160,100,20);
panel.add(meterTyp);
meterTypCho.add("Electric Meter");
meterTypCho.add("Solar Meter");
meterTypCho.add("Smart Meter");
meterTypCho.setBounds(180,160,150,20);
panel.add(meterTypCho);
phaseCode.setBounds(50,200,100,20);
panel.add(phaseCode);
43
phaseCodeCho =new Choice();
phaseCodeCho.add("011");
phaseCodeCho.add("022");
phaseCodeCho.add("033");
phaseCodeCho.add("044");
phaseCodeCho.add("055");
phaseCodeCho.add("066");
phaseCodeCho.add("077");
phaseCodeCho.add("088");
phaseCodeCho.add("099");
phaseCodeCho.setBounds(180,200,150,20);
panel.add(phaseCodeCho);
billtyp.setBounds(50,240,100,20);
panel.add(billtyp);
44
billtypCho =new Choice();
billtypCho.add("Normal");
billtypCho.add("Industrial");
billtypCho.setBounds(180,240,150,20);
panel.add(billtypCho);
day.setBounds(50,280,150,20);
panel.add(day);
note.setBounds(50,320,100,20);
panel.add(note);
only");
note1.setBounds(50,340,300,20);
panel.add(note1);
submit.setBounds(220,390,100,25);
45
submit.setBackground(Color.black);
submit.setForeground(Color.white);
submit.addActionListener(this);
panel.add(submit
setLayout(new BorderLayout());
add(panel,"Center");
ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("icon/details.png"));
Image i2 =
i1.getImage().getScaledInstance(230,200,Image.SCALE_DEFAULT);
add(imgLabel,"East");
setSize(700,500);
setLocation(400,200);
setVisible(true);
@Override
46
public void actionPerformed(ActionEvent e) {
if (e.getSource()==submit){
values('"+smeterNum+"','"+smeterLoc+"','"+smeterTyp+"','"+sphaseCode+"','"+
sbillTyp+"','"+sday+"')";
try{
c.statement.executeUpdate(query_meterInfo);
Successfully");
setVisible(false);
47
}catch (Exception E){
E.printStackTrace();
}else {
setVisible(false);
new meterInfo("");
package electricity.billing.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
48
public class newCustomer extends JFrame implements ActionListener {
address,city,state,email,phone;
newCustomer(){
super("New Customer");
setSize(700,500);
setLocation(400,200);
panel.setLayout(null);
panel.setBackground(new Color(252,186,3));
add(panel);
heading.setBounds(180,10,200,20);
heading.setFont(new Font("Tahoma",Font.BOLD,20));
panel.add(heading);
49
customerName = new JLabel("New Customer");
customerName.setBounds(50,80,100,20);
panel.add(customerName);
nameText.setBounds(180,80,150,20);
panel.add(nameText);
meterNum.setBounds(50,120,100,20);
panel.add(meterNum);
meternumText.setBounds(180,120,150,20);
pnel.add(meternumText);
meternumText.setText(""+ Math.abs(number) );
50
address.setBounds(50,160,100,20);
panel.add(address);
addressText.setBounds(180,160,150,20);
panel.add(addressText);
city.setBounds(50,200,100,20);
panel.add(city);
cityText.setBounds(180,200,150,20);
panel.add(cityText);
state.setBounds(50,240,100,20);
paneladd(state);
stateText.setBounds(180,240,150,20);
51
panel.add(stateText);
email.setBounds(50,280,100,20);
panel.add(email);
emailText.setBounds(180,280,150,20);
panel.add(emailText);
phone.setBounds(50,320,100,20);
panel.add(phone);
phoneText.setBounds(180,320,150,20);
panel.add(phoneText);
next.setBounds(120,390,100,25);
next.setBackground(Color.black);
52
next.setForeground(Color.white);
next.addActionListener(this);
panel.add(next);
cancel.setBounds(230,390,100,25);
cancel.setBackground(Color.black);
cancel.setForeground(Color.white);
cancel.addActionListener(this);
panel.add(cancel);
package electricity.billing.system;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
JButton back;
String meter;
payment_bill(String meter){
53
this.meter = meter;
j.setEditable(false);
try{
j.setPage("https://paytm.com/online-payments");
j.setBounds(400,150,800,600);
E.printStackTrace();
j.setContentType("text/html");
</html>");
add(pane);
back.setBounds(640,20,80,30);
back.addActionListener(this);
j.add(back);
54
setSize(800,600);
setLocation(400,150);
setVisible(true);
@Override
setVisible(false);
new pay_bill(meter);
new payment_bill("");
package electricity.billing.system;
55
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.RectangularShape;
import java.sql.ResultSet;
JLabel nametext;
JTextField addressText,cityText,stateText,emailText,phoneText;
String meter;
JButton update,cancel;
update_information(String meter){
this.meter=meter;
setBounds(400,150,777,450);
getContentPane().setBackground(new Color(229,255,227));
setLayout(null);
56
JLabel heading = new JLabel("Update Customer Information");
heading.setBounds(50,10,400,40);
heading.setFont(new Font("serif",Font.BOLD,20));
add(heading);
name.setBounds(30,70,100,20);
add(name);
nametext.setBounds(150,70,200,20);
add(nametext);
meterNo.setBounds(30,110,100,20);
add(meterNo);
57
JLabel meterText = new JLabel("");
meterText.setBounds(150,110,100,20);
add(meterText);
address.setBounds(30,150,100,20);
add(address);
addressText.setBounds(150,150,200,20);
add(addressText);
city.setBounds(30,190,100,20);
add(city);
58
cityText = new JTextField();
cityText.setBounds(150,190,200,20);
add(cityText);
state.setBounds(30,230,100,20);
add(state);
stateText.setBounds(150,230,200,20);
add(stateText);
email.setBounds(30,270,100,20);
add(email);
59
emailText = new JTextField();
emailText.setBounds(150,270,200,20);
add(emailText);
phone.setBounds(30,310,100,20);
add(phone);
phoneText.setBounds(150,310,200,20);
add(phoneText);
try{
if (resultSet.next()){
nametext.setText(resultSet.getString("name"));
60
meterText.setText(resultSet.getString("meter_no"));
addressText.setText(resultSet.getString("address"));
cityText.setText(resultSet.getString("city"));
stateText.setText(resultSet.getString("state"));
emailText.setText(resultSet.getString("email"));
phoneText.setText(resultSet.getString("phone_no"));
e.printStackTrace();
update.setBackground(new Color(33,106,145));
update.setForeground(Color.white);
update.setBounds(50,360,120,25);
update.addActionListener(this);
add(update);
61
cancel = new JButton("Cancel");
cancel.setBackground(new Color(33,106,145));
cancel.setForeground(Color.white);
cancel.setBounds(200,360,120,25);
cancel.addActionListener(this);
add(cancel);
package electricity.billing.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.security.cert.Extension;
import java.sql.ResultSet;
62
String view;
JButton cancel;
view_information(String view){
this.view = view;
setBounds(350,150,850,650);
getContentPane().setBackground(Color.WHITE);
setLayout(null);
heading.setBounds(250,0,500,40);
heading.setFont(new Font("serif",Font.BOLD,20) );
add(heading);
nameLabel.setBounds(70,80,100,20);
add(nameLabel);
63
JLabel nameLabelText = new JLabel("");
nameLabelText.setBounds(200,80,150,20);
add(nameLabelText);
meterno.setBounds(70,140,100,20);
add(meterno);
meternoText.setBounds(200,140,150,20);
add(meternoText);
address.setBounds(70,200,100,20);
64
add(address);
addressText.setBounds(200,200,150,20);
add(addressText);
city.setBounds(70,260,100,20);
add(city);
cityText.setBounds(200,260,150,20);
add(cityText);
65
state.setBounds(500,80,100,20);
add(state);
stateText.setBounds(600,80,150,20);
add(stateText);
email.setBounds(500,140,100,20);
add(email);
emailText.setBounds(600,140,150,20);
add(emailText);
66
JLabel phone = new JLabel("phone");
phone.setBounds(500,200,100,20);
add(phone);
phoneText.setBounds(600,200,150,20);
add(phoneText);
try{
if (resultSet.next()){
nameLabelText.setText(resultSet.getString("name"));
meternoText.setText(resultSet.getString("meter_no"));
addressText.setText(resultSet.getString("address"));
cityText.setText(resultSet.getString("city"));
stateText.setText(resultSet.getString("state"));
67
emailText.setText(resultSet.getString("email"));
phoneText.setText(resultSet.getString("phone_no"));
e.printStackTrace();
cancel.setBackground(new Color(24,118,242));
cancel.setForeground(Color.white);
cancel.setBounds(220,350,120,25);
cancel.addActionListener(this);
add(cancel);
ImageIcon a1 = new
ImageIcon(ClassLoader.getSystemResource("icon/viewInfo.png"));
Image a2 =
a1.getImage().getScaledInstance(600,300,Image.SCALE_DEFAULT);
68
ImageIcon i3 = new ImageIcon(a2);
img.setBounds(100,320,600,300);
add(img);
setVisible(true);
@Override
if (e.getSource()==cancel){
setVisible(false);
new view_information("");
69
CHAPTER 5
72
Output of the login page:
73
Output of the customer details page:
74
Output of the bill slip details page:
75
Output of the bill update information page:
76
CHAPTER 6
CONCLUSION
After all the hard work is done for electricity bill management system
is here. It is a software which helps the user to work with the billing
working etc.
This software reduces the amount of manual data entry and gives
It also decreases the amount of time taken to write details and other
modules.
78
CHAPTER 7
REFERENCE
80