0% found this document useful (0 votes)
14 views

nisha project 01

The document is a project report on the 'Cafe Billing System' developed by Nisha Rathore as part of her Master's degree in Computer Applications. It outlines the system's objectives, benefits, and design, emphasizing its automated capabilities for managing billing, employee information, and order history. The project aims to enhance efficiency, accuracy, and user-friendliness in cafe management through a desktop application built using Netbeans IDE and MySQL database.

Uploaded by

aadi singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

nisha project 01

The document is a project report on the 'Cafe Billing System' developed by Nisha Rathore as part of her Master's degree in Computer Applications. It outlines the system's objectives, benefits, and design, emphasizing its automated capabilities for managing billing, employee information, and order history. The project aims to enhance efficiency, accuracy, and user-friendliness in cafe management through a desktop application built using Netbeans IDE and MySQL database.

Uploaded by

aadi singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

A Project Report on

“CAFE BILLING SYSTEM”


MASTER OF COMPUTER APPLICATION

BY
Nisha Rathore
Roll No:-2309015250025

Under the esteemed guidance of


Mrs. Pratibha Rashmi maam

DEPARTMENT OF COMPUTER SCIENCE ,


INSTITUTE OF ENGINEERING &
TECHNOLOGY KHANDARI , AGRA
2023-2025

1
,

GUIDED BY SUBMITTED BY

Nisha Rathore
Mrs. Pratibha Rashmi
Maam

SUBMITTED TO
DEPARTMENT OF COMPUTER SCIENCE
& IET 2

ARKA JAIN UNIVERSITY


A Project Report on
CAFE BILLING SYSTEM

Submitted in partial fulfilment


for the award of the Degree in

MASTER OF COMPUTER APPLICATION by


Nisha Rathore
Roll No :- 2309015250025

Under the guidance of


Mrs. Pratibha Rashmi Maam

DEPARTMENT OF COMPUTER SCIENCE ,INSTITUTE OF ENGINEERING


& TECHNOLOGY
2023-25
ARKA JAIN UNIVERSITY, JHARKHAND

DEPARTMENT OF COMPUTER SCIENCE & IT

CERTIFICATE

This is to certify that the project entitled, "Cafe Billing System", is bonafied work of Vishnu
kumar Mahato bearing Enrolment no- AJU/211694 submitted in partial fulfilment of the
requirements for the award of degree of MASTER OF COMPUTER APPLICATION (MCA)
from ARKA JAIN University, JHARKHAND.

Internal Guide HOD

Date: University Seal

II
ABSTRACT

The main goal of this project was to develop a desktop based billing system for a Cafe. This
desktop based application is designed to administer its users and customers. CBS is a billing
system, made for the effective utilization of modern technology in the organization. It is an
automated software that can handle a lot of information about the restaurant’s employees, order
history, reservation data. It has the capability to process bills and gather information about its
employees and billing history. It is designed for the sole purpose of efficiency, speed and accuracy.
This application allows the admin to view the detail history of day to day operation in terms of
sales, add or remove the employee, add new menu, view the detail of the employee like name,
address, salary and so on. This application was developed using Netbeans IDE 8.0.2 for the front
end and MySQL database was used to store data.

III
ACKNOWLEDGEMENT

I would like to express my sincere gratitude to several individuals and organization for supporting
me throughout the completion of my project.

First, I wish to express my sincere gratitude to my mentor (Mrs.Pratibha maam) for her
enthusiasm patience, insightful comments, helpful information, practical advices and unceasing
ideas that have helped me tremendously at all times in my Project and writing of these
thesis. Her immense knowledge, profound experience and professional expertise in
Backend has enabled me to complete this project successfully. Without her support and
guidance, this project would not have been possible.

I am also thankful to our respected H.O.D (Prof. V. K. Saraswat sir) and all faculty members for
loving inspiration and timely guidance. I also wish to express my sincere thanks to the
Department of Computer science ,Institute of Engineering and Technology Khandari Campus
Agra for accepting this project.

Thanks for all your encouragement!

IV
TABLE OF CONTENTS
Chapter 1
1. Introduction…………………………………………………………………..
1.1. Definition of problem...............................................................................
1.2. Objective…………………………………………………………………
1.3. Benefits of Existing System………………………………………………
Chapter 2
2. System Analysis……………………………………………………………...
2.1. Existing system………………………………………………………….
2.2. Proposed system………………………………………………………...
2.3. Feasibility Study………………………………………………………...
Chapter 3
3. System Design
3.1. Input design……………………………………………………………….
3.2. Output design……………………………………………………………..
3.3. Database design…………………………………………………………...
3.4. System tools………………………………………………………………
3.4.1. Front end…………………………………………………………..
3.4.1.1. PHP………………………………………………………...
3.4.2. Back end…………………………………………………………...
3.4.2.1. MS SQL Server 2008 R2………………………………….

Chapter 4
4. Requirement Specification………………………………………………….
Chapter 5
5. Data Flow Diagram…………………………………………………………..
5.1. Context Level……………………………………………………………
5.2. 1st Level………………………………………………………………….
5.3. 2nd Level…………………………………………………………………
Chapter 6
6. ER Diagram…………………………………………………………………..
Chapter 7
7. Database Tables………………………………………………………………
Chapter 8
8. Normalization………………………………………………………………..
8.1. UNF……………………………………………………………………..
8.2. 1NF.…………………….……………………………………………….
8.3. 2NF. …………………………………………………………………….
Chapter 9
9. Screenshots……………………………………………………………………
Chapter 10

V
10. Coding…………………………………………………………………………
Chapter 11
11. Implementation and System Testing
11.1. Unit testing…………………………………………………………
11.1.1. Test for the admin module…………………………………………
11.2. Integration testing………………………………………………….
Chapter 12
12. Conclusion…………………………………………………………………….

VI
1. INTRODUCTION

The “Cafe Billing System” or “CBS” is an application to automate the process of information
recording and billing of a restaurant. This desktop based application is designed to administer its
users and customers. RBS is a billing system, made for the effective utilization of modern
technology in the organization. It is an automated software that can handle a lot of information
about the restaurant’s employees, order history, reservation data. It has the capability to process
bills and gather information about its employees and billing history. It is designed for the sole
purpose of efficiency, speed and accuracy. Waterfall Model is used to develop this software where
different requirements are identified at first, analyze the requirements then design the software
using various tools and techniques and using the development language the software is developed.
Different testing like unit testing and integration testing are done during the development process.

1.1. Definition of problem


The problem occurred before having computerized system includes:

• File lost- When computerized system is not implemented file is always lost because of human
environment. Sometimes due to some human error there may be a loss of records.

• File damaged -When a computerized system is not their file is always lost due to some accident
like spilling of water by some member on file accidentally. Besides some natural disaster like
floods or fires may also damage the files.

• Difficult to search record- When there is no computerized system there is always a difficulty in
searching of records if the records are large in number.

• Space consuming- After the number of records become large the space for physical storage of
file and records also increases if no computerized system is implemented.

• Cost consuming- As there is no computerized system the to add each record paper will be needed
which will increase the cost for the management of library.
1.2. OBJECTIVE

Cafe Billing System is a computer based billing system with user friendly interface which
automatically manages the billing process of the customer very easily taking only a short period
of time. The system can large amount of data and also generates bill for the customer. Billing
history, reservation information and staff information can also be obtained with the use of RBS. It
is an automated desktop based software which has a simple design and very easy to use also. This
project’s main focus is on proper management of information regarding the staffs, billing and
reservation records. It is also specialized in automatically processing the customer bills and
discounts.

1.3. BENEFITS OF EXISTING SYSTEM

The project is identified by the merits of the system offered to the user. The merits of this project
are as follows: -

• It’s a web-enabled project.

• This project offers user to enter the data through simple and interactive forms. This is very
helpful for the client to enter the desired information through so much simplicity.

• The user is mainly more concerned about the validity of the data, whatever he is entering.
There are checks on every stages of any new creation, data entry or updation so that the
user cannot enter the invalid data, which can create problems at later date.

• Sometimes the user finds in the later stages of using project that he needs to update some
of the information that he entered earlier. There are options for him by which he can update
the records. There is restriction for his that he cannot change the primary data field. This
keeps the validity of the data to longer extent.

• User is provided the option of monitoring the records he entered earlier. He can see the
desired records with the variety of options provided by him.
• From every part of the project the user is provided with the links through framing so that
he can go from one option of the project to other as per the requirement. This is bound to
be simple and very friendly as per the user is concerned. That is, we can say that the project
is user friendly which is one of the primary concerns of any good project.

• Data storage and retrieval will become faster and easier to maintain because data is stored
in a systematic manner and in a single database.

• Decision making process would be greatly enhanced because of faster processing of


information since data collection from information available on computer takes much less
time than manual system.

• Allocating of sample results becomes much faster because at a time the user can see the
records of last years.

• Easier and faster data transfer through latest technology associated with the computer and
communication.

• Through these features it will increase the efficiency, accuracy and transparency.
2. SYSTEM ANALYSIS
System analysis is the process of gathering and interpreting facts, diagnosing problems and using
the information to recommend improvements on the system. System analysis is a problem-solving
activity that requires intensive communication between the system users and system developers.
System analysis or study is an important phase of any system development process. The system is
viewed as a whole, the inputs are identified and the system is subjected to close study to identify
the problem areas. The solutions are given as a proposal. The proposal is reviewed on user request
and suitable changes are made. This loop ends as soon as the user is satisfied with the proposal.

2.1. Existing System


o In Early days Bills are managed manually. It required lot of time to record or to retrieve
the details. The employees who have to record the details must perform their job very
carefully. Even a small mistake would create a lot of problems. Security of information is
very less. Report generations of all the information is very tough task.
o Maintenance of Bill catalogue and arrangement of the Records to the catalogue is very
complex task. In addition to its maintenance of member details, fee dates and fine dates
etc. manually is a complex task.
o All the operations must be performed in perfect manner for the maintenance of the bill
department without any degradation which may finally result in the failure of the entire
system.

2.2. Proposed System


To solve the inconveniences as mentioned in the existing system, an computerize fee management
system is proposed. The proposed system contains the following features:

o Admin can loging and maintain his details and can add other user or staff details, students
details, can add new course, and take and generate receipt and report of about students fee.
o Individually each member will have his account through which he can access the 4.4
2.3. Feasibility Study
Feasibility requirements are undertaken to have a view of understanding the features that are
incorporated in terms of the requirements to design and implementation. The references of the
feasibility study will be divided into multiple sections so that the understandability can be
organized so for example if we have to design software the required investment and flow of cash
has to be properly analysed in the same way technical associations are acquired to be discussed.

• Technical feasibility.

• Operational feasibility.

• Economic feasibility.
3. SYSTEM DESIGN
System design is the solution for the creation of a new system. This phase focuses on the detailed
implementation of the feasible system. It emphasis on translating design. Specifications to
performance specification. System design has two phases of development • Logical design •
Physical design During logical design phase the analyst describes inputs (sources), output
s(destinations), databases (data sores) and procedures (data flows) all in a format that meets the
user requirements. The analyst also specifies the needs of the user at a level that virtually
determines the information flow in and out of the system and the data resources. Here the logical
design is done through data flow diagrams and database design. The physical design is followed
by physical design or coding. Physical design produces the working system by defining the design
specifications, which specify exactly what the candidate system must do. The programmers write
the necessary programs that accept input from the user, perform necessary processing on accepted
data and produce the required report on a hard copy or display it on the screen.

3.1. Input design


Input design is the link that ties the information system into the world of its users. The input design
involves determining the inputs, validating the data, minimizing the data entry and provides a
multi-user facility. Inaccurate inputs are the most common cause of errors in data processing.
Errors entered by the data entry operators can be controlled by input design. The user-originated
inputs are converted to a computer-based format in the input design. Input data are collected and
organized into groups of similar data. Once identified, the appropriate input media are selected for
processing. All the input data are validated and if any data violates any conditions, the user is
warned by a message. If the data satisfies all the conditions, it is transferred to the appropriate
tables in the database. In this project the student details are to be entered at the time of registration.
A page is designed for this purpose which is user friendly and easy to use. The design is done such
that users get appropriate messages when exceptions occur.
3.2. Output Design
Computer output is the most important and direct source of information to the user. Output design
is a very important phase since the output needs to be in an efficient manner. Efficient and
intelligible output design improves the system relationship with the user and helps in decision
making. Allowing the user to view the sample screen is important because the user is the ultimate
judge of the quality of output. The output module of this system is the selected notifications.

3.3. Database Design


Databases are the storehouses of data used in the software systems. The data is stored in tables
inside the database. Several tables are created for the manipulation of the data for the system.

Two essential settings for a database are-

• The field that is unique for all the record occurrences.

• The field used to set relation between tables.

3.4. System Tools


The various system tools that have been used in developing both the front end and the back end of
the project are being discussed in this unit.

3.4.1. Front End:

PHP,HTML,CSS

3.4.1.1. PHP

PHP is a scripting language originally designed for producing dynamic web pages. It has evolved
to include a command line interface capability and can be used in standalone graphical
applications. While PHP was originally created by Rasmus Lerdorf in 1995, the main
implementation of PHP is now produced by The PHP Group and serves as the de facto standard
for PHP as there is no formal specification. PHP is free software released under the PHP License,
however it is incompatible with the GNU General Public License (GPL), due to restrictions on the
usage of the term PHP. It is a widely-used general-purpose scripting language that is especially
suited for web development and can be embedded into HTML. It generally runs on a web server,
taking PHP code as its input and creating web pages as output. It can be deployed on most web
servers and on almost every operating system and platform free of charge. PHP is installed on
more than 20 million websites and 1 million web servers.

3.4.2. Back End:

Microsoft SQL Server 2008 R2

3.4.2.1. Microsoft SQL Server 2008 R2

Microsoft SQL Server is a relational database management system developed by Microsoft. As a


database server, it is a software product with the primary function of storing and retrieving data as
requested by other software applications—which may run either on the same computer or on
another computer across a network (including the Internet). Microsoft markets at least a dozen
different editions of Microsoft SQL Server, aimed at different audiences and for workloads ranging
from small single-machine applications to large Internet-facing applications with many concurrent
users.
4. Requirement Specification

4.1 HARDWARE AND SOFTWARE REQUIREMENTS

4.1.1 Hardware Requirement :-

• Dual core processor and above


• 2GB of RAM & above
• 20GB of hard disk & above

4.1.2 Software Requirement :-

• Operating system: Windows 10


• Front end: Html, CSS, JavaScript
• Frameworks and library: Bootstrap, Font awesome, Google fonts
• Backend: PHP
• Text Editor: Visual Studio Code
• Database: MySQL
• Web Server: Apache
• Drawing tools: Star UML
5. DATA FLOW DIAGRAM
A Data Flow Diagram (DFD) is a structured analysis and design tool that can be used for
flowcharting. A DFD is a network that describes the flow of data and the processes that change or
transform the data throughout a system. This network is constructed by using a set of symbols that
do not imply any physical implementation. It has the purpose of clarifying system requirements
and identifying major transformations. So, it is the starting point of the design phase that
functionally decomposes the requirements specifications down to the lowest level of detail. DFD
can be considered to an abstraction of the logic of an information oriented or a process-oriented
system flow-chart. For these reasons DFD’s are often referred to as logical data flow diagrams.

EXTERNAL ENTITY

An external entity is a source or destination of a data flow. Only those entities which originate or
receive data are represented on a data flow diagram. The symbol used is a rectangular box.

Entity

PROCESS

A process shows a transformation or manipulation of data flow within the system. The symbol
used is an oval shape.

Process
DATAFLOW

The data flow shows the flow of information from a source to its destination. Data flow is
represented by a line, with arrowheads showing the direction of flow. Information always flows to
or from a process and may be written, verbal or electronic. Each data flow may be referenced by
the processes or data stores at its head and tail, or by a description of its contents.

Data Flow

DATA STORE

A data store is a holding place for information within the system: It is represented by an
openended narrow rectangle. Data stores may be long-term files such as sales ledgers, or may
be short-term accumulations: for example, batches of documents that are waiting to be
processed. Each data store should be given a reference followed by an arbitrary number.

Data Store
5.1. Context Level DFD

Orders Cafe Food Menu


Billing
System
User
Sales Report
5.2. 1st Level DFD

New user details/ Authentication of new user details/ Update


Existing user details 1.0 & search Existing User

User D User_Details
User
1
Confirmation or Error Information alert for
message new or existing user

New Category details/ Authentication of new Category details/ Update,


Existing Categories details
2.0 Delete & search Existing categories

User Food D Category_details


Category 2
Confirmation or Information alert for new
Error message or existing category
Alert

New Order details/ Existing Authentication of new Orders details/


Update, Delete & search Existing Order
Order details
3.0
User Customer
D Order_Details
Order 3
Confirmation or Error Information alert for new
message or existing orders
Food payment details
4.0 Generate Bill

User D Invoice
Bill 4
Information alert for
Confirmation or
Error message current or existing
Alert payment details
5.3. 2nd Level DFD

Check if already exist same user, if not


Add new user details 1.1 then add the details

User D User_details
New user 1
New user authentication
Confirmation or Error
details
message alert

Accept User ID & Check the Authentication of user


Password 1.2 by id
User D User_details
User
1
Login
Login or show error Fetch the password if
details exist

Check the
Accept User ID, old authentication and
and new password 1.3 Change the password

User Change
D User_details
Password 1
Confirmation or Error Alert update
message alert information
Check the
Accept user data authentication and
to be update 1.4 update

User Update
D User_details
User 1
Alert update
Confirmation or Error
information
message alert

Check if already exist same Category, if


Add new Category 2.1 not then add the details
Food Details
D Category_details
Category New
2
Category
New category details
Confirmation or Error
message alert

Accept category data to Check and update Category


be update 2.2 details
Food
D Category_details
Category Update
2
Category
Alert update information
Confirmation or Error
message alert
Accept category ID or Search the category by
name 2.3 ID or name

Category D Category_details
Search
2
Category
Fetch the information if exist
Show the record or error
message

Add new order Details Check if food available or not/if available


3.1 add order

Order D Order_details
New
3
Order
New order details
Confirmation or Error
message alert

Accept order data to be update


Check and update Order details
3.2
order D Order_details
Update
3
order
Alert update information
Confirmation or Error
message alert
Add the price details of ordered
food Total amount calculate
3.3
Order D order_details
Food
3
payment
Payment details
Print receipt/Bill

Search date/month Details of the orders


4.1
Report D order_Details
Sales
Report 3
Print the report Fetch the overall
payment details
6. ER DIAGRAM
7. DATABASE TABLES
Admin/User Table structure

Categories Table Structure

Order Menu Table Structure


Customer orders Table Structure

Payment table structure


8. NORMALIZATION
8.1. 1NF
Column name datatype constraints extra
Id Int(10) Primary Key not null Auto increment
Product_name Varchar(20) Not null
Product_id Varchar(40) Primary Key not null
quantity Varchar(40) Not null
name Varchar(40) Not null
description Varchar(40) Not null
Status Int(1) Not null
Bill no Varchar(20) Primary Key not null Auto increment
Order_id int(30) Primary Key not null
9. SCREENSHOTS
10. CODING

Login.php
<!DOCTYPE html>
<html lang="en">
<?php
session_start();
include('./db_connect.php');
ob_start();
// if(!isset($_SESSION['system'])){
$system = $conn->query("SELECT * FROM system_settings limit 1")->fetch_array();
foreach($system as $k => $v){
$_SESSION['system'][$k] = $v;
}
// }
ob_end_flush();
?>
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">

<title><?php echo $_SESSION['system']['name'] ?></title>

<?php include('./header.php'); ?>


<?php
if(isset($_SESSION['login_id']))
header("location:index.php?page=home");

?>

</head>
<style>
body{
width: 100%;
height: calc(100%);
position: fixed;
top:0;
left: 0
/*background: #007bff;*/
}
main#main{
width:100%;
height: calc(100%);
display: flex;
}

</style>

<body class="bg-dark">

<main id="main" >

<div class="align-self-center w-100">


<h4 class="text-white text-center"><b><?php echo $_SESSION['system']['name'] ?></b></h4>
<div id="login-center" class="bg-dark row justify-content-center">
<div class="card col-md-4">
<div class="card-body">
<form id="login-form" >
<div class="form-group">
<label for="username" class="control-label">Username</label>
<input type="text" id="username" name="username" class="form-control">
</div>
<div class="form-group">
<label for="password" class="control-label">Password</label>
<input type="password" id="password" name="password" class="form-control">
</div>
<center><button class="btn-sm btn-block btn-wave col-md-4 btn-
primary">Login</button></center>
</form>
</div>
</div>
</div>
</div>
</main>

<a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>

</body>
<script>
$('#login-form').submit(function(e){
e.preventDefault()
$('#login-form button[type="button"]').attr('disabled',true).html('Logging in...');
if($(this).find('.alert-danger').length > 0 )
$(this).find('.alert-danger').remove();
$.ajax({
url:'ajax.php?action=login',
method:'POST',
data:$(this).serialize(),
error:err=>{
console.log(err)
$('#login-form button[type="button"]').removeAttr('disabled').html('Login');

},
success:function(resp){
if(resp == 1){
location.href ='index.php?page=home';
}else{
$('#login-form').prepend('<div class="alert alert-danger">Username or password is
incorrect.</div>')
$('#login-form button[type="button"]').removeAttr('disabled').html('Login');
}
}
})
})
</script>
</html>

Category.php

<?php include('db_connect.php');?>

<div class="container-fluid">

<div class="col-lg-12">
<div class="row">
<!-- FORM Panel -->
<div class="col-md-4">
<form action="" id="manage-category">
<div class="card">
<div class="card-header">
Category Form
</div>
<div class="card-body">
<input type="hidden" name="id">
<div class="form-group">
<label class="control-label">Name</label>
<input type="text" class="form-control" name="name">
</div>
<div class="form-group">
<label class="control-label">Description</label>
<textarea name="description" id="description" cols="30" rows="4" class="form-
control"></textarea>
</div>
</div>

<div class="card-footer">
<div class="row">
<div class="col-md-12">
<button class="btn btn-sm btn-primary col-sm-3 offset-md-3"> Save</button>
<button class="btn btn-sm btn-default col-sm-3" type="button" onclick="$('#manage-
category').get(0).reset()"> Cancel</button>
</div>
</div>
</div>
</div>
</form>
</div>
<!-- FORM Panel -->

<!-- Table Panel -->


<div class="col-md-8">
<div class="card">
<div class="card-header">
<b>Category List</b>
</div>
<div class="card-body">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th class="text-center">#</th>
<th class="text-center">Category Info.</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$category = $conn->query("SELECT * FROM categories order by id asc");
while($row=$category->fetch_assoc()):
?>
<tr>
<td class="text-center"><?php echo $i++ ?></td>
<td class="">
<p>Name: <b><?php echo $row['name'] ?></b></p>
<p><small>Description: <b><?php echo $row['description'] ?></b></small></p>
</td>
<td class="text-center">
<button class="btn btn-sm btn-primary edit_category" type="button" data-id="<?php echo
$row['id'] ?>" data-description="<?php echo $row['description'] ?>" data-name="<?php echo
$row['name'] ?>" >Edit</button>
<button class="btn btn-sm btn-danger delete_category" type="button" data-id="<?php echo
$row['id'] ?>">Delete</button>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Table Panel -->
</div>
</div>

</div>
<style>

td{
vertical-align: middle !important;
}
td p {
margin:unset;
}
</style>
<script>
$('#manage-category').on('reset',function(){
$('input:hidden').val('')
})

$('#manage-category').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'ajax.php?action=save_category',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
alert_toast("Data successfully added",'success')
setTimeout(function(){
location.reload()
},1500)

}
else if(resp==2){
alert_toast("Data successfully updated",'success')
setTimeout(function(){
location.reload()
},1500)

}
}
})
})
$('.edit_category').click(function(){
start_load()
var cat = $('#manage-category')
cat.get(0).reset()
cat.find("[name='id']").val($(this).attr('data-id'))
cat.find("[name='name']").val($(this).attr('data-name'))
cat.find("[name='description']").val($(this).attr('data-description'))
end_load()
})
$('.delete_category').click(function(){
_conf("Are you sure to delete this category?","delete_category",[$(this).attr('data-id')])
})
function delete_category($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_category',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)
}
}
})
}
$('table').dataTable()
</script>
Orders.php

<?php include('db_connect.php');?>
<style>
input[type=checkbox]
{
/* Double-sized Checkboxes */
-ms-transform: scale(1.3); /* IE */
-moz-transform: scale(1.3); /* FF */
-webkit-transform: scale(1.3); /* Safari and Chrome */
-o-transform: scale(1.3); /* Opera */
transform: scale(1.3);
padding: 10px;
cursor:pointer;
}
</style>
<div class="container-fluid">

<div class="col-lg-12">
<div class="row mb-4 mt-4">
<div class="col-md-12">

</div>
</div>
<div class="row">
<!-- FORM Panel -->

<!-- Table Panel -->


<div class="col-md-12">
<div class="card">
<div class="card-header">
<b>List of Orders </b>
<span class="float:right"><a class="btn btn-primary btn-block btn-sm col-sm-2 float-right"
href="javascript:void(0)" id="new_order">
<i class="fa fa-plus"></i> New
</a></span>
</div>
<div class="card-body">
<table class="table table-condensed table-bordered table-hover">
<thead>
<tr>
<th class="text-center">#</th>
<th class="">Date</th>
<th class="">Invoice</th>
<th class="">Order Number</th>
<th class="">Amount</th>
<th class="">Status</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$order = $conn->query("SELECT * FROM orders order by unix_timestamp(date_created) desc
");
while($row=$order->fetch_assoc()):
?>
<tr>
<td class="text-center"><?php echo $i++ ?></td>
<td>
<p> <b><?php echo date("M d,Y",strtotime($row['date_created'])) ?></b></p>
</td>
<td>
<p> <b><?php echo $row['amount_tendered'] > 0 ? $row['ref_no'] : 'N/A' ?></b></p>
</td>
<td>
<p> <b><?php echo $row['order_number'] ?></b></p>
</td>
<td>
<p class="text-right"> <b><?php echo number_format($row['total_amount'],2) ?></b></p>
</td>
<td class="text-center">
<?php if($row['amount_tendered'] > 0): ?>
<span class="badge badge-success">Paid</span>
<?php else: ?>
<span class="badge badge-primary">Unpaid</span>
<?php endif; ?>
</td>
<td class="text-center">
<button class="btn btn-sm btn-outline-primary " type="button"
onclick="location.href='billing/index.php?id=<?php echo $row['id'] ?>'" data-id="<?php echo
$row['id'] ?>" >Edit</button>
<button class="btn btn-sm btn-outline-primary view_order" type="button" data-id="<?php echo
$row['id'] ?>">View</button>
<button class="btn btn-sm btn-outline-danger delete_order" type="button" data-id="<?php echo
$row['id'] ?>">Delete</button>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Table Panel -->
</div>
</div>

</div>
<style>

td{
vertical-align: middle !important;
}
td p{
margin: unset
}
img{
max-width:100px;
max-height: :150px;
}
</style>
<script>
$(document).ready(function(){
$('table').dataTable()
})
$('#new_order').click(function(){
uni_modal("New order ","manage_order.php","mid-large")

})
$('.view_order').click(function(){
uni_modal("Order Details","view_order.php?id="+$(this).attr('data-id'),"mid-large")

})
$('.delete_order').click(function(){
_conf("Are you sure to delete this order ?","delete_order",[$(this).attr('data-id')])
})
function delete_order($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_order',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)
}
}
})
}
</script>

Sales_Report.php

<?php
include 'db_connect.php';
$month = isset($_GET['month']) ? $_GET['month'] : date('Y-m');
?>
<div class="container-fluid">
<div class="col-lg-12">
<div class="card">
<div class="card_body">
<div class="row justify-content-center pt-4">
<label for="" class="mt-2">Month</label>
<div class="col-sm-3">
<input type="month" name="month" id="month" value="<?php echo $month ?>" class="form-
control">
</div>
</div>
<hr>
<div class="col-md-12">
<table class="table table-bordered" id='report-list'>
<thead>
<tr>
<th class="text-center">#</th>
<th class="">Date</th>
<th class="">Invoice</th>
<th class="">Order Number</th>
<th class="">Amount</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$total = 0;
$sales = $conn->query("SELECT * FROM orders where amount_tendered > 0 and
date_format(date_created,'%Y-%m') = '$month' order by unix_timestamp(date_created) asc ");
if($sales->num_rows > 0):
while($row = $sales->fetch_array()):
$total += $row['total_amount'];
?>
<tr>
<td class="text-center"><?php echo $i++ ?></td>
<td>
<p> <b><?php echo date("M d,Y",strtotime($row['date_created'])) ?></b></p>
</td>
<td>
<p> <b><?php echo $row['amount_tendered'] > 0 ? $row['ref_no'] : 'N/A' ?></b></p>
</td>
<td>
<p> <b><?php echo $row['order_number'] ?></b></p>
</td>
<td>
<p class="text-right"> <b><?php echo number_format($row['total_amount'],2) ?></b></p>
</td>
</tr>
<?php
endwhile;
else:
?>
<tr>
<th class="text-center" colspan="5">No Data.</th>
</tr>
<?php
endif;
?>
</tbody>
<tfoot>
<tr>
<th colspan="4" class="text-right">Total</th>
<th class="text-right"><?php echo number_format($total,2) ?></th>
</tr>
</tfoot>
</table>
<hr>
<div class="col-md-12 mb-4">
<center>
<button class="btn btn-success btn-sm col-sm-3" type="button" id="print"><i class="fa fa-
print"></i> Print</button>
</center>
</div>
</div>
</div>
</div>
</div>
</div>
<noscript>
<style>
table#report-list{
width:100%;
border-collapse:collapse
}
table#report-list td,table#report-list th{
border:1px solid
}
p{
margin:unset;
}
.text-center{
text-align:center
}
.text-right{
text-align:right
}
</style>
</noscript>
<script>
$('#month').change(function(){
location.replace('index.php?page=sales_report&month='+$(this).val())
})
$('#print').click(function(){
var _c = $('#report-list').clone();
var ns = $('noscript').clone();
ns.append(_c)
var nw = window.open('','_blank','width=900,height=600')
nw.document.write('<p class="text-center"><b>Order Report as of <?php echo date("F,
Y",strtotime($month)) ?></b></p>')
nw.document.write(ns.html())
nw.document.close()
nw.print()
setTimeout(() => {
nw.close()
}, 500);
})
</script>

Products.php
<?php include('db_connect.php');?>

<div class="container-fluid">

<div class="col-lg-12">
<div class="row">
<!-- FORM Panel -->
<div class="col-md-4">
<form action="" id="manage-product">
<div class="card">
<div class="card-header">
Product Form
</div>
<div class="card-body">
<input type="hidden" name="id">
<div class="form-group">
<label class="control-label">Category</label>
<select name="category_id" id="category_id" class="custom-select select2">
<option value=""></option>
<?php
$qry = $conn->query("SELECT * FROM categories order by name asc");
while($row=$qry->fetch_assoc()):
$cname[$row['id']] = ucwords($row['name']);
?>
<option value="<?php echo $row['id'] ?>"><?php echo $row['name'] ?></option>
<?php endwhile; ?>
</select>
</div>
<div class="form-group">
<label class="control-label">Name</label>
<input type="text" class="form-control" name="name">
</div>
<div class="form-group">
<label class="control-label">Description</label>
<textarea name="description" id="description" cols="30" rows="4" class="form-
control"></textarea>
</div>
<div class="form-group">
<label class="control-label">Price</label>
<input type="number" class="form-control text-right" name="price">
</div>
<div class="form-group">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="status" name="status" checked
value="1">
<label class="custom-control-label" for="status">Available</label>
</div>
</div>
</div>

<div class="card-footer">
<div class="row">
<div class="col-md-12">
<button class="btn btn-sm btn-primary col-sm-3 offset-md-3"> Save</button>
<button class="btn btn-sm btn-default col-sm-3" type="button" onclick="$('#manage-
product').get(0).reset()"> Cancel</button>
</div>
</div>
</div>
</div>
</form>
</div>
<!-- FORM Panel -->

<!-- Table Panel -->


<div class="col-md-8">
<div class="card">
<div class="card-header">
<b>Product List</b>
</div>
<div class="card-body">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th class="text-center">#</th>
<th class="text-center">Category</th>
<th class="text-center">Product Info.</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$product = $conn->query("SELECT * FROM products order by id asc");
while($row=$product->fetch_assoc()):
?>
<tr>
<td class="text-center"><?php echo $i++ ?></td>
<td class="">
<p><b><?php echo $cname[$row['category_id']] ?></b></p>
</td>
<td class="">
<p>Name: <b><?php echo $row['name'] ?></b></p>
<p><small>Price: <b><?php echo number_format($row['price'],2) ?></b></small></p>
<p><small>Status: <b><?php echo $row['status'] == 1 ? " Available" : "Unavailable"
?></b></small></p>
<p><small>Description: <b><?php echo $row['description'] ?></b></small></p>
</td>
<td class="text-center">
<button class="btn btn-sm btn-primary edit_product" type="button" data-id="<?php echo
$row['id'] ?>" data-description="<?php echo $row['description'] ?>" data-name="<?php echo
$row['name'] ?>" data-price="<?php echo $row['price'] ?>" data-status="<?php echo
$row['status'] ?>" data-category_id="<?php echo $row['category_id'] ?>">Edit</button>
<button class="btn btn-sm btn-danger delete_product" type="button" data-id="<?php echo
$row['id'] ?>">Delete</button>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Table Panel -->
</div>
</div>

</div>
<style>

td{
vertical-align: middle !important;
}
td p {
margin:unset;
}
.custom-switch{
cursor: pointer;
}
.custom-switch *{
cursor: pointer;
}
</style>
<script>
$('#manage-product').on('reset',function(){
$('input:hidden').val('')
$('.select2').val('').trigger('change')
})

$('#manage-product').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'ajax.php?action=save_product',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
alert_toast("Data successfully added",'success')
setTimeout(function(){
location.reload()
},1500)

}
else if(resp==2){
alert_toast("Data successfully updated",'success')
setTimeout(function(){
location.reload()
},1500)

}
}
})
})
$('.edit_product').click(function(){
start_load()
var cat = $('#manage-product')
cat.get(0).reset()
cat.find("[name='id']").val($(this).attr('data-id'))
cat.find("[name='name']").val($(this).attr('data-name'))
cat.find("[name='description']").val($(this).attr('data-description'))
cat.find("[name='price']").val($(this).attr('data-price'))
cat.find("[name='category_id']").val($(this).attr('data-category_id')).trigger('change')
if($(this).attr('data-status') == 1)
$('#status').prop('checked',true)
else
$('#status').prop('checked',false)
end_load()
})
$('.delete_product').click(function(){
_conf("Are you sure to delete this product?","delete_product",[$(this).attr('data-id')])
})
function delete_product($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_product',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)

}
}
})
}
$('table').dataTable()
</script>

Receipt.php
<?php
include 'db_connect.php';
$order = $conn->query("SELECT * FROM orders where id = {$_GET['id']}");
foreach($order->fetch_array() as $k => $v){
$$k= $v;
}
$items = $conn->query("SELECT o.*,p.name FROM order_items o inner join products p on p.id
= o.product_id where o.order_id = $id ");
?>

<style>
.flex{
display: inline-flex;
width: 100%;
}
.w-50{
width: 50%;
}
.text-center{
text-align:center;
}
.text-right{
text-align:right;
}
table.wborder{
width: 100%;
border-collapse: collapse;
}
table.wborder>tbody>tr, table.wborder>tbody>tr>td{
border:1px solid;
}
p{
margin:unset;
}

</style>
<div class="container-fluid">
<p class="text-center"><b><?php echo $amount_tendered > 0 ? "Receipt" : "Bill" ?></b></p>
<hr>
<div class="flex">
<div class="w-100">
<?php if($amount_tendered > 0): ?>
<p>Invoice Number: <b><?php echo $ref_no ?></b></p>
<?php endif; ?>
<p>Date: <b><?php echo date("M d, Y",strtotime($date_created)) ?></b></p>
</div>
</div>
<hr>
<p><b>Order List</b></p>
<table width="100%">
<thead>
<tr>
<td><b>QTY</b></td>
<td><b>Order</b></td>
<td class="text-right"><b>Amount</b></td>
</tr>
</thead>
<tbody>
<?php
while($row = $items->fetch_assoc()):
?>
<tr>
<td><?php echo $row['qty'] ?></td>
<td><p><?php echo $row['name'] ?></p><?php if($row['qty'] > 0): ?><small>(<?php echo
number_format($row['price'],2) ?>)</small> <?php endif; ?></td>
<td class="text-right"><?php echo number_format($row['amount'],2) ?></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
<hr>
<table width="100%">
<tbody>
<tr>
<td><b>Total Amount</b></td>
<td class="text-right"><b><?php echo number_format($total_amount,2) ?></b></td>
</tr>
<?php if($amount_tendered > 0): ?>

<tr>
<td><b>Amount Tendered</b></td>
<td class="text-right"><b><?php echo number_format($amount_tendered,2) ?></b></td>
</tr>
<tr>
<td><b>Change</b></td>
<td class="text-right"><b><?php echo number_format($amount_tendered - $total_amount,2)
?></b></td>
</tr>
<?php endif; ?>

</tbody>
</table>
<hr>
<p class="text-center"><b>Order No.</b></p>
<h4 class="text-center"><b><?php echo $order_number ?></b></h4>
</div>
11. IMPLEMENTATION AND SYSTEM TESTING

The aim of the system testing process was to determine all defects in our project .The program was
subjected to a set of test inputs and various observations were made and based on these
observations it will be decided whether the program behaves as expected or not. Our Project went
through two levels of testing
1. Unit testing
2. integration testing

11.1. Unit testing


Unit testing is undertaken when a module has been created and successfully reviewed .In order to
test a single module we need to provide a complete environment i.e. besides the module we would
require
• The procedures belonging to other modules that the module under test calls
• Non local data structures that module accesses
• A procedure to call the functions of the module under test with appropriate parameters Unit
testing was done on each and every module that is described under module description of chapter
11.1.1. Test for the admin module
• Testing admin login form-This form is used for log in of administrator of the system. In this we
enter the username and password if both are correct administration page will open otherwise if any
of data is wrong it will get redirected back to the login page and again ask for username and
password
• Student account addition- In this section the admin can verify student details from
student academic info and then only add student details to main library database it
contains add and delete buttons if user click add button data will be added to student
database and if he clicks delete button the student data will be deleted
• Course Addition- Admin can enter details of Course and can add the details to the main
Course table.

11.2. Integration testing


In this type of testing we test various integration of the project module by providing the input. The
primary objective is to test the module interfaces in order to ensure that no errors are occurring
when one module invokes the other module
12.CONCLUSION

It has been a great pleasure for me to work on this exciting and challenging project. This project
proved good for me as it provided practical knowledge of not only programming in PHP and
MySQL web-based application. It also provides knowledge about the latest technology used in
developing web enabled application and client server technology that will be great demand in
future. This will provide better opportunities and guidance in future in developing projects
independently.

You might also like