Daily Expense Tracking System: A Project Report On

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

A

Project Report on

Daily Expense Tracking System

DEPARTMENT OF MSC. COMPUTER SCIENCE

UDAYANATH COLLEGE OF SCIENCE AND TECHNOLOGY


ADASPUR, CUTTACK, ODISHA
(2021-22)
“WEBSITE DEVELOPMENT
ON
DAILY EXPENSE TRACKING SYSTEM”

Submitted to the Department of Computer Science As a part fulfilment


of the requirement for the Degree of
M.Sc. (Computer Science)

Submitted By
SAIPRASAD MAHARANA
ROLL NO – PGUNCSC20008

Under the Guidance of


YOUNGMINDS TECHNOLOGY SOLUTIONS PVT.LTD

UDAYANATH COLLEGE OF SCIENCE AND TECHNOLOGY


ADASPUR, CUTTACK, ODISHA

2
ACKNOWLEDGEMENTS

In completing this Post-Graduate project, I have been fortunate to have


help, support and encouragement from many people. I would like to
acknowledge them for their cooperation.

First and foremost, deeply thankful to YoungMinds Technology


Solutions Pvt. Ltd for his wonderful guidance during this project works
in field of Computer Science, at Udayanath Autonomous College of
Science and Technology, Adaspur. I am also thankful for his continuous
feedback and encouragement throughout this project work. His broad
knowledge and hardworking attitude have left me with very deep
impressions and they will greatly benefit me throughout my life.

I would like to thank my project Readers HoD Mrs. Arati Pradhan and
Lecturer Mrs. S.S.S. Mamtaj Swain for their support throughout this
project work. I give a hearty thanks to my all colleagues and friends for
their consistent support, inspiration and helps.

Specially thanks to the College:

SAIPRASAD MAHARANA
M.Sc. (Computer Science)
Roll No: PGUNCSC20008

3
DECLARATION

I Mr. SAIPRASAD MAHARANA declared that the project work


entitled “Daily Expense Tracking System” done at Udayanath
Autonomous College of Science and Technology, Adaspur is a benefited
work carried out by me on 2021-22 and has not been submitted to any
other University for the award of any other degree.

Name: SAIPRASAD MAHARANA


Roll No: PGUNCSC20008

4
5
ABSTRACT

We are developing an Web application named as “Daily Expense


Tracker System” and this application is used to manage the application
user‘s daily expenses in a more efficient and manageable way. By using
this application we can reduce the manual calculations for their daily
expenses and keep the track of the expenditure. In this application, user
can provide his/her expense to calculate his/her total expenses per day
and these results will stored for unique user.

SAIPRASAD MAHARANA
M.Sc. (Computer Science)
Roll No: PGUNCSC20008

6
EXISTING SYSTEM

In existing, we need to maintain the Excel sheets, CSV etc. files for the
user daily and monthly expenses. In existing, there is no as such
complete solution to keep a track of its daily expenditure easily. To do
so a person as to keep a log in a diary or in a computer, also all the
calculations needs to be done by the user which may sometimes results
in errors leading to losses.

7
CONTENT

SL NO. CHAPTER NAME PAGE NO


01 SOFTWARE AND HARDWARE SPECIFICATIONS 09

02 PROJECT OVERVIEW 10

03 SOFTWARE DEVELOPMENT ENVIRONMENT 11

04 DESIGN DOCUMENT 18

05 DATABASE DESIGN 27

06 SYSTEM TESTING 30

07 OUTPUT SCREEN OF PROJECT 32

08 CODING 41

09 CONCLUSION 65

10 REFERENCES 67

8
SOFTWARE AND HARDWARE SPECIFICATIONS

HARDWARE REQUIREMENTS:

Processor : Intel P-IV based system

Processor Speed : 2.0. GHz

RAM : 1GB

Hard Disk : 40GB to 80GB

SOFTWARE REQUIREMENTS:

Database : MySQL

Server : Apache

Frontend : HTML

Scripting language : Java Script

IDE : Sublime

Technology : PHP

9
PROJECT OVERVIEW

Daily Expense Tracker System


In Daily Expense Tracker System we use PHP and MySQL database. This is the
project which keeps records of daily expenses. DETS has two modules i.e.
user, and admin.

1. Dashboard: In this section, user can briefly view expenses on a daily basis,
monthly basis and yearly basis.
2. Expenses: In this section user can manage the expenses (add/delete).
3. Expense Report: In this section, user can view expenses on day wise basis,
month wise basis and year wise basis according to periods of time.
4. Profile: In this section, user can update his/her profile.
5. Change Password: In this section, user can change his/her passwords
6. Logout: Through this button, user can log out.

User can also recover his/her password.


Admin Module

1. Dashboard: In this section, Admin can briefly view expenses on a daily basis,
monthly basis, yearly basis and also check listed categories and registered users
2. Categories: In this section, Admin can create and manage(Edit and delete) the
expense categories.
3. Users: In this section, Admin can manage the registered user(Edit, delete) and
also check his/her expenses.
4. Reports: In this section, Admin can generate the user-wise report and also
generate the b/w dates report to check the registered users.
5. Profile: In this section, user can update his/her profile.
6. Change Password: In this section, user can change his/her passwords
7. Logout: Through this button, user can log out.

Admin can also recover his/her password.

10
SYSTEM DEVELOPMENT ENVIRONMENT

1. HTML
WHAT IS HTML?

To publish information for global distribution, one needs a university-understood


language, a kind of publishing mother tongue that all computers may potentially
understand. The publishing language used by the World Wide Web is HTML
(Hyper Text Markup Language)

HTML Gives Authors the Means To

1. Publish online documents with headings, text, tables, list, photos etc.
2. Retrieve online information via hypertext links, at the click of a button
3. Design forms for conducting transactions with remote services, for use in
searching information, making reservation, ordering products etc.;
4. Includes spreadsheets, video clips, sound clips, and other applications
directly in the documents.
5.
Some HTML Tags

<HTML> :Starting an HTML tag

<HEAD> : Creating a web page’s head

<TITLE> : Giving a web page ‘s body

11
</HEAD> : Ending a web pages head

</BODY> : Ending a web pages body

</HTML> :Ending a web page

<FORM> : Creating a HTML forms

<INPUT TYPE=BUTTON> : Creating a buttons

<INPUT TYPE=CHECKBOX> : Creating a checkboxes

<INPUT TYPE=SUBMIT> : Creating a submit button

<INPUT TYPE=TEXT> : Creating a text fields

HTML 4.0

HTML 4.0 extends with mechanisms for style sheets, scripting, frames embedding
objects, improved support for right to left and mixed direction texts, richer tables
and enhancements to form, offering improved accessibilities for people with
disability.

2. INTRODUCTION TO JAVA SCRIPT

WHAT IS JAVA SCRIPT?

JavaScript, originally supported by Netscape Navigator, is the most popular Web


scripting language today. JavaScript lets you embed programs right in your Web
pages and run these programs using the Web browser. You place these programs in
a <SCRIPT> element. If you want the script to write directly to the Web page,
place it in the <BODY> element.

EX: <HTML>

12
<HEAD>

<TITLE></TITLE>

</HEAD>

<BODY>

<SCRIPT LANGUAGE=”JavaScript”>

</SCRIPT>

</BODY></HTML>

JAVASCRIPTS OBJECTS

JavaScript is an object-oriented language. JavaScript comes with a number of


predefined objects.

Objects of the JavaScript

1. Document: Corresponds to the current Web page’s body. Using this object,
you have access to the HTML of the page itself, including the all links,
images and anchors in it.
2. Form: Holds information about HTML forms in the current page.
3. Frame: Refers to a frame in the browser’s window.
4. History: Holds the records of sites the Web browser has visited before
reaching the current page.
5. Location: Holds information about the location of the current web page.
6. Navigator: Refers to the browser itself, letting you determine what browser
the user has.
7. Window: Refers to the current browser window.

JAVASCRIPTS EVENTS

13
Some of the events of JavaScript

1. on Change: Occurs when data in a control, like a text field, changes.


2. on Click: Occurs when an element is clicked.
3. on Focus: Occurs when an element gets the focus.
4. on Mouse Down: Occurs when a mouse button goes down.
5. on Reset: Occurs when the user clicks the reset button.

JAVASCRIPTS FUNCTIONS

Declaration of function

Syntax: function function name ()

Write these functions in <SCRIPT> tag.

5.RDBMS CONCEPTS

1. DATA ABSTRACTION

A major purpose of a database system is to provide users with an abstract view


of the data. This system hides certain details of how the data is stored and
maintained. However in order for the system to be usable, data must be

14
retrieved efficiently. The efficiency lead to the design of complex data structure
for the representation of data in the database. Certain complexity must be
hidden from the database system users. This accomplished by defining several
levels of abstraction at which the database may be viewed.

2. CLASSIFICATION OF DATABASE

There are 3 types of database approaches given below,

a. Hierarchical Database:

In this type of model data is represented in simple tree structured. The


record at the top of three is known as root, the root may have any
number of dependents. Each of these may have any number of low
level dependents and so on up to any number of levels. The
disadvantages of the approach are that no independent record
occurrence can exist without it’s superior.

b. Network Database:

In a Network database, data is represented by Network structure. In


this approach record occurrence can have any number of superiors as
well as any number of immediate dependents thus allow many to
many correspondence directly than an hierarchical approach. The
main disadvantage of the Network model is data representation is very
complex resulting in complexity of the DML (Data Manipulation
Language).

c. Relational Database:

The Relational model represents data and relationships among data by


a collection of tables each of which has a number of columns with
unique names.

15
6. THE SQL LANGUAGE

SQL is a language for relational database. SQL is a non-procedural i.e., when we


use SQL we specify what we want to be done not how to do it.

Features of SQL

1. SQL is an interactive query language.


2. SQL is a database administration language.
3. SQL is a database programming language.
4. SQL is a client/server language.
5. SQL is a distributed database language.
6. SQL is a database gateway language.

Basic SQL Commands

 Data Definition Language commands (DDL)

 Data Manipulation Language commands (DML)

 Transaction Control Language commands (TCL)

 Data control Language commands (DCL)

PHP

 PHP is an acronym for "PHP: Hypertext Preprocessor"


 PHP is a widely-used, open source scripting language
 PHP scripts are executed on the server
 PHP is free to download and use

What is a PHP File?

 PHP files can contain text, HTML, CSS, JavaScript, and PHP code
 PHP code are executed on the server, and the result is returned to the
browser as plain HTML

16
 PHP files have extension ".php"

What Can PHP Do?

 PHP can generate dynamic page content


 PHP can create, open, read, write, delete, and close files on the server
 PHP can collect form data
 PHP can send and receive cookies
 PHP can add, delete, modify data in your database
 PHP can be used to control user-access
 PHP can encrypt data

With PHP you are not limited to output HTML. You can output images, PDF files,
and even Flash movies. You can also output any text, such as XHTML and XML.

17
DESIGN DOCUMENT

 The entire system is projected with a physical diagram which specifics the
actual storage parameters that are physically necessary for any database to
be stored on to the disk. The overall systems existential idea is derived
from this diagram.

 The relation upon the system is structure through a conceptual ER-


Diagram, which not only specifics the existential entities but also the
standard relations through which the system exists and the cardinalities
that are necessary for the system state to continue.

 The content level DFD is provided to have an idea of the functional inputs
and outputs that are achieved through the system. The system depicts the
input and output standards at the high level of the systems existence.

A DFD does not show a sequence of steps. A DFD only shows what the different
process in a system is and what data flows between them.

The following are some DFD symbols used in the project

External entities

Process: A transaction of information that resides within the


bounds of the system to be module.

18
DATAFLOWS

DATASTORE: A repository of data that is to be


stored for use by one or more processes, may be as
simple as buffer of queue or as a relational
database.
RULES FOR DFD:

 Fix the scope of the system by means of context diagrams.


 Organize the DFD so that the main sequence of the actions reads left to
right and top to bottom.
 Identify all inputs and outputs.
 Identify and label each process internal to the system with rounded circles.
 A process is required for all the data transformation and transfers.
Therefore, never connect a data store to a data source or the destinations or
another data store with just a data flow arrow.
 Do not indicate hardware and ignore control information.
 Make sure the names of the processes accurately convey everything the
process is done.
 There must not be unnamed process.
 Indicate external sources and destinations of the data, with squares.
 Number each occurrence of repeated external entities.
 Identify all data flows for each process step, except simple Record
retrievals.
 Label data flow on each arrow.
 Use details flow on each arrow.
 Use the details flow arrow to indicate data movements.
 There can’t be unnamed data flow.
 A data flow can’t connect two external entities.
LEVELS OF DFD:

19
The complexity of the business system means that it is a responsible to represent the operations
of any system of single data flow diagram. At the top level, an Overview of the different systems
in an organization is shown by the way of context analysis diagram. When exploded into DFD
They are represented by:
 LEVEL-0 : SYSTEM INPUT/OUTPUT
 LEVEL-1:SUBSYSTEM LEVEL DATAFLOW FUNCTIONAL
 LEVEL-2: FILE LEVEL DETAIL DATA FLOW.
The input and output data shown should be consistent from one level to the next.

LEVEL-0: SYSTEM INPUT/OUTPUT LEVEL


A level-0 DFD describes the system-wide boundaries, dealing inputs to and outputs from
the system and major processes. This diagram is similar to the combined user-level context
diagram.

LEVEL-1: SUBSYSTEM LEVEL DATA FLOW


A level-1 DFD describes the next level of details within the system, detailing the data
flows between subsystems, which makeup the whole.

LEVEL-2: FILE LEVEL DETAIL DATA FLOW


All the projects are feasible given unlimited resources and infinite time. It is both necessary and
prudent to evaluate the feasibility of the project at the earliest possible time. Feasibility and the
risk analysis are pertained in many ways. If project risk is great.

FIRST LEVEL DTAFLOW DIAGRAM

0.0

Daily Expense Tracker


User

20
2nd Level DFDs

1.1

Expenses

DB DB

1.2

User

1.1.1.1
Add
Expenses

Item and Expense

User Info

2. Unified Modeling Language Diagrams(UML):

21
 The unified modeling language allows the software engineer to express an
analysis model using the modeling notation that is governed by a set of
syntactic semantic and pragmatic rules.

 A UML system is represented using five different views that describe the
system from distinctly different perspective. Each view is defined by a set of
diagram, which is as follows.

User Model View

i. This view represents the system from the users perspective.

ii. The analysis representation describes a usage scenario from the end-users
perspective.
Structural model view

 In this model the data and functionality are arrived from inside the
system.

 This model view models the static structures.

Behavioral Model View

 It represents the dynamic of behavioral as parts of the system, depicting


the interactions of collection between various structural elements
described in the user model and structural model view.

Implementation Model View

 In this the structural and behavioral as parts of the system are


represented as they are to be built.

Environmental Model View

In this the structural and behavioral aspects of the environment in which the
system is to be implemented are represented.

22
UML is specifically constructed through two different domains they are

 UML Analysis modeling, which focuses on the user model and


structural model views of the system?

 UML design modeling, which focuses on the behavioral modeling,


implementation modeling and environmental model views.

Use Case Diagrams User

Signup

Sign in

Dashboard

Manage Expense
(Add/ Edit)

Generate Reports

Update Own Profile

Change Password

23
Use Case Diagrams Admin

Sign in

Dashboard

categories (Add,
edit,

Registered users
(Edit/ Delete)

Generate Reports

Update Own
Profile

Change Password

24
ENTITY-RELATIONSHIP Diagrams

E-R (Entity-Relationship) Diagram is used to represents the relationship


between entities in the table.

The symbols used in E-R diagrams are:

SYMBOL PURPOSE

Represents Entity sets.

Represent attributes.

Represent Relationship Sets.

Line represents flow


Structured analysis is a set of tools and techniques that the analyst.
To develop a new kind of a system:

25
The traditional approach focuses on the cost benefit and feasibility analysis,
Project management, and hardware and software selection a personal
considerations.

26
27
DATABASE DESIGN

The data in the system has to be stored and retrieved from database. Designing the

database is part of system design. Data elements and data structures to be stored

have been identified at analysis stage. They are structured and put together to

design the data storage and retrieval system.

A database is a collection of interrelated data stored with minimum redundancy to

serve many users quickly and efficiently. The general objective is to make database

access easy, quick, inexpensive and flexible for the user. Relationships are

established between the data items and unnecessary data items are removed.

Normalization is done to get an internal consistency of data and to have minimum

redundancy and maximum stability. This ensures minimizing data storage required,

minimizing chances of data inconsistencies and optimizing for updates. The

MySQL database has been chosen for developing the relevant databases.

Daily Expense Tracking System (dets) contains 4 MySQL tables:

tbluser table Structure: This table store the login and personal details of user.

28
tblexpense table Structure: This table store the item expense details.

tblcategory table structure: This table stores the expense categories.

tbladmin table structure: This table stores the admin login details.

29
Class Diagram:

The class diagram shows a set of classes, interfaces, collaborations and their
relationships.

30
SYSTEM TESTING

SOFTWARE TESTING TECHNIQUES:

Software testing is a critical element of software quality assurance and

represents the ultimate review of specification, designing and coding.

TESTING OBJECTIVES:

1. Testing is process of executing a program with the intent of finding an


error.

2. A good test case design is one that has a probability of finding an as

yet undiscovered error.

3. A successful test is one that uncovers an as yet undiscovered error.

These above objectives imply a dramatic change in view port.

Testing cannot show the absence of defects, it can only show that software

errors are present.

There are three types of testing strategies

1. Unit test
2. Integration test
3. Performance test
Unit Testing:
Unit testing focuses verification efforts on the smallest unit of software design
module. The unit test is always white box oriented. The tests that occur as part
of unit testing are testing the module interface, examining the local data
structures, testing the boundary conditions, execution all the independent paths
and testing error-handling paths.

31
Integration Testing:

Integration testing is a systematic technique or construction the program


structure while at the same time conducting tests to uncover errors associated
with interfacing. Scope of testing summarizes the specific functional,
performance, and internal design characteristics that are to be tested. It employs
top-down testing and bottom-up testing methods for this case.

Performance Testing:

Timing for both read and update transactions should be gathered to determine
whether system functions are being performed in an acceptable timeframe.

32
Output Screen of Project

Home Page

Registration Page

33
Login Page

Dashboard

34
Add Expense

Manage Expense

Expense Report

Date wise Reports

35
Month wise Report

36
Year wise Reports

37
Profile

Change Password

Forgot Password

38
Reset Password

Admin Modules
Login

Dashboard

39
Add Category

Manage Category

Registered Users

40
User Report

User Report Details

Registered Users Report

41
CODING –
Main Page –
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,
shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>Daily Expense Tracter</title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
<!-- Bootstrap icons-->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-
icons.css" rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="css/styles1.css" rel="stylesheet" />
</head>
<body class="d-flex flex-column h-100">
<main class="flex-shrink-0">
<!-- Navigation-->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container px-5">
<a class="navbar-brand" href="index.html">DETS</a>
<button class="navbar-toggler" type="button" data-bs-
toggle="collapse" data-bs-target="#navbarSupportedContent" aria-
controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle
navigation"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse"
id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item"><a class="nav-link"
href="index.php">Home</a></li>
<li class="nav-item"><a class="nav-link"
href="register.php">User Signup</a></li>

42
<li class="nav-item"><a class="nav-link" href="login.php">User
Signin</a></li>
<li class="nav-item"><a class="nav-link" href="admin/">Admin
Signin</a></li>

</ul>
</div>
</div>
</nav>
<!-- Header-->
<header class="bg-dark py-5">
<div class="container px-5">
<div class="row gx-5 align-items-center justify-content-center">
<div class="col-lg-8 col-xl-7 col-xxl-6">
<div class="my-5 text-center text-xl-start">
<h1 class="display-5 fw-bolder text-white mb-2">Daily
Expense Tracker System</h1>
<p class="lead fw-normal text-white-50 mb-4">DETS
Developed using PHP and MySQL</p>
<div class="d-grid gap-3 d-sm-flex justify-content-sm-center
justify-content-xl-start">
<a class="btn btn-primary btn-lg px-4 me-sm-3"
href="login.php">User</a>
<a class="btn btn-outline-light btn-lg px-4"
href="admin">Admin</a>
</div>
</div>
</div>
<div class="col-xl-5 col-xxl-6 d-none d-xl-block text-center"><img
class="img-fluid rounded-3 my-5" src="assets/images/expense.png" alt="DETS"
/></div>
</div>
</div>
</header>

</main>
<!-- Footer-->
<footer class="bg-dark py-4 mt-auto">
<div class="container px-5">

43
<div class="row align-items-center justify-content-between flex-
column flex-sm-row">
<div class="col-auto"><div class="small m-0 text-white">Daily
Expense Trakcer System (DETS) <?php echo date('Y');?></div></div>

</div>
</div>
</footer>
<!-- Bootstrap core JS-->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.
min.js"></script>
<!-- Core theme JS-->
<script src="js/scripts.js"></script>
</body>
</html>

User Profile Page -

<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['detsuid']==0)) {
header('location:logout.php');
} else{
if(isset($_POST['submit']))
{
$userid=$_SESSION['detsuid'];
$fullname=$_POST['fullname'];
$mobno=$_POST['contactnumber'];

$query=mysqli_query($con, "update tbluser set FullName ='$fullname',


MobileNumber='$mobno' where ID='$userid'");
if ($query) {
$msg="User profile has been updated.";
}
else
{
$msg="Something Went Wrong. Please try again.";

44
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Daily Expense Tracker || User Profile</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/datepicker3.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">

<!--Custom Font-->
<link href="https://fonts.googleapis.com/css?
family=Montserrat:300,300i,400,400i,500,500i,600,600i,700,700i"
rel="stylesheet">
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<?php include_once('includes/header.php');?>
<?php include_once('includes/sidebar.php');?>

<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">


<div class="row">
<ol class="breadcrumb">
<li><a href="#">
<em class="fa fa-home"></em>
</a></li>
<li class="active">Profile</li>
</ol>
</div><!--/.row-->

<div class="row">
<div class="col-lg-12">

45
<div class="panel panel-default">
<div class="panel-heading">Profile</div>
<div class="panel-body">
<p style="font-size:16px; color:red"
align="center"> <?php if($msg){
echo $msg;
} ?> </p>
<div class="col-md-12">
<?php
$userid=$_SESSION['detsuid'];
$ret=mysqli_query($con,"select * from tbluser where ID='$userid'");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {

?>
<form role="form" method="post"
action="">
<div class="form-group">
<label>Full
Name</label>
<input class="form-
control" type="text" value="<?php echo $row['FullName'];?>"
name="fullname" required="true">
</div>
<div class="form-group">
<label>Email</label>
<input type="email" class="form-control" name="email" value="<?php echo
$row['Email'];?>" required="true" readonly="true">
</div>

<div class="form-group">
<label>Mobile
Number</label>
<input class="form-
control" type="text" value="<?php echo $row['MobileNumber'];?>"
required="true" name="contactnumber" maxlength="10">
</div>
<div class="form-group">

46
<label>Registration
Date</label>
<input class="form-
control" name="regdate" type="text" value="<?php echo $row['RegDate'];?>"
readonly="true">
</div>

<div class="form-group has-


success">
<button
type="submit" class="btn btn-primary" name="submit">Update</button>
</div>

</div>
<?php } ?>
</form>
</div>
</div>
</div><!-- /.panel-->
</div><!-- /.col-->
<?php include_once('includes/footer.php');?>
</div><!-- /.row -->
</div><!--/.main-->

<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/chart.min.js"></script>
<script src="js/chart-data.js"></script>
<script src="js/easypiechart.js"></script>
<script src="js/easypiechart-data.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/custom.js"></script>

</body>
</html>
<?php } ?>

Manage Expense –
<?php
session_start();
error_reporting(0);
47
include('includes/dbconnection.php');
if (strlen($_SESSION['detsuid']==0)) {
header('location:logout.php');
} else{

//code deletion
if(isset($_GET['delid']))
{
$rowid=intval($_GET['delid']);
$query=mysqli_query($con,"delete from tblexpense where ID='$rowid'");
if($query){
echo "<script>alert('Record successfully deleted');</script>";
echo "<script>window.location.href='manage-expense.php'</script>";
} else {
echo "<script>alert('Something went wrong. Please try again');</script>";

?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Daily Expense Tracker || Manage Expense</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/datepicker3.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">

<!--Custom Font-->
<link href="https://fonts.googleapis.com/css?
family=Montserrat:300,300i,400,400i,500,500i,600,600i,700,700i"
rel="stylesheet">
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
48
</head>
<body>
<?php include_once('includes/header.php');?>
<?php include_once('includes/sidebar.php');?>

<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">


<div class="row">
<ol class="breadcrumb">
<li><a href="#">
<em class="fa fa-home"></em>
</a></li>
<li class="active">Expense</li>
</ol>
</div><!--/.row-->

<div class="row">
<div class="col-lg-12">

<div class="panel panel-default">


<div class="panel-heading">Expense</div>
<div class="panel-body">
<p style="font-size:16px; color:red"
align="center"> <?php if($msg){
echo $msg;
} ?> </p>
<div class="col-md-12">

<div class="table-responsive">
<table class="table table-bordered mg-b-0">
<thead>
<tr>
<th>S.NO</th>
<th>Category Name</th>
<th>Expense Item</th>
<th>Expense Cost</th>
<th>Expense Date</th>
<th>Action</th>
</tr>

49
</thead>
<?php
$userid=$_SESSION['detsuid'];
$ret=mysqli_query($con,"select * from tblexpense where UserId='$userid'");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {

?>
<tbody>
<tr>
<td><?php echo $cnt;?></td>
<td><?php echo $row['CategoryName'];?></td>
<td><?php echo $row['ExpenseItem'];?></td>
<td><?php echo $row['ExpenseCost'];?></td>
<td><?php echo $row['ExpenseDate'];?></td>
<td><a href="manage-expense.php?delid=<?php echo $row['ID'];?
>">Delete</a>
</tr>
<?php
$cnt=$cnt+1;
}?>

</tbody>
</table>
</div>
</div>
</div>
</div><!-- /.panel-->
</div><!-- /.col-->
<?php include_once('includes/footer.php');?>
</div><!-- /.row -->
</div><!--/.main-->

<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/chart.min.js"></script>
<script src="js/chart-data.js"></script>
<script src="js/easypiechart.js"></script>
<script src="js/easypiechart-data.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/custom.js"></script>

50
</body>
</html>
<?php } ?>

Login Page –
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');

if(isset($_POST['login']))
{
$email=$_POST['email'];
$password=md5($_POST['password']);
$query=mysqli_query($con,"select ID from tbluser where Email='$email' &&
Password='$password' ");
$ret=mysqli_fetch_array($query);
if($ret>0){
$_SESSION['detsuid']=$ret['ID'];
header('location:dashboard.php');
}
else{
echo "<script>alert('Invalid Details.');</script>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Daily Expense Tracker - Login</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/datepicker3.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">

</head>
<body>

<div class="row">
51
<h2 align="center">Daily Expense Tracker | User
Login</h2>
<hr />
<div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-
md-4 col-md-offset-4">
<div class="login-panel panel panel-default">
<div class="panel-heading">Log in</div>
<div class="panel-body">
<form role="form" action="" method="post"
id="" name="login">
<fieldset>
<div class="form-group">
<input class="form-control"
placeholder="E-mail" name="email" type="email" autofocus=""
required="true">
</div>
<a href="forgot-
password.php">Forgot Password?</a>
<div class="form-group">
<input class="form-control"
placeholder="Password" name="password" type="password" value=""
required="true">
</div>
<div class="checkbox">
<button type="submit"
value="login" name="login" class="btn btn-primary">login</button><span
style="padding-left:250px">
</div>
<p>Not Registered Yet? <a
href="register.php" >Register here</a></span></p>
</fieldset>
</form>
</div>
</div>
</div><!-- /.col-->
</div><!-- /.row -->

<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
52
</html>
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');

if(isset($_POST['login']))
{
$email=$_POST['email'];
$password=md5($_POST['password']);
$query=mysqli_query($con,"select ID from tbluser where Email='$email' &&
Password='$password' ");
$ret=mysqli_fetch_array($query);
if($ret>0){
$_SESSION['detsuid']=$ret['ID'];
header('location:dashboard.php');
}
else{
echo "<script>alert('Invalid Details.');</script>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Daily Expense Tracker - Login</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/datepicker3.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">

</head>
<body>

<div class="row">
<h2 align="center">Daily Expense Tracker | User
Login</h2>
<hr />
<div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-
md-4 col-md-offset-4">
53
<div class="login-panel panel panel-default">
<div class="panel-heading">Log in</div>
<div class="panel-body">
<form role="form" action="" method="post"
id="" name="login">
<fieldset>
<div class="form-group">
<input class="form-control"
placeholder="E-mail" name="email" type="email" autofocus=""
required="true">
</div>
<a href="forgot-
password.php">Forgot Password?</a>
<div class="form-group">
<input class="form-control"
placeholder="Password" name="password" type="password" value=""
required="true">
</div>
<div class="checkbox">
<button type="submit"
value="login" name="login" class="btn btn-primary">login</button><span
style="padding-left:250px">
</div>
<p>Not Registered Yet? <a
href="register.php" >Register here</a></span></p>
</fieldset>
</form>
</div>
</div>
</div><!-- /.col-->
</div><!-- /.row -->

<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
54
if(isset($_POST['login']))
{
$email=$_POST['email'];
$password=md5($_POST['password']);
$query=mysqli_query($con,"select ID from tbluser where Email='$email' &&
Password='$password' ");
$ret=mysqli_fetch_array($query);
if($ret>0){
$_SESSION['detsuid']=$ret['ID'];
header('location:dashboard.php');
}
else{
echo "<script>alert('Invalid Details.');</script>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Daily Expense Tracker - Login</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/datepicker3.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">

</head>
<body>

<div class="row">
<h2 align="center">Daily Expense Tracker | User
Login</h2>
<hr />
<div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-
md-4 col-md-offset-4">
<div class="login-panel panel panel-default">
<div class="panel-heading">Log in</div>
<div class="panel-body">
<form role="form" action="" method="post"
id="" name="login">
55
<fieldset>
<div class="form-group">
<input class="form-control"
placeholder="E-mail" name="email" type="email" autofocus=""
required="true">
</div>
<a href="forgot-
password.php">Forgot Password?</a>
<div class="form-group">
<input class="form-control"
placeholder="Password" name="password" type="password" value=""
required="true">
</div>
<div class="checkbox">
<button type="submit"
value="login" name="login" class="btn btn-primary">login</button><span
style="padding-left:250px">
</div>
<p>Not Registered Yet? <a
href="register.php" >Register here</a></span></p>
</fieldset>
</form>
</div>
</div>
</div><!-- /.col-->
</div><!-- /.row -->

<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>

Registration Page –
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if(isset($_POST['submit']))
{

56
$fname=$_POST['name'];
$mobno=$_POST['mobilenumber'];
$email=$_POST['email'];
$password=md5($_POST['password']);

$ret=mysqli_query($con, "select Email from tbluser where Email='$email' ");


$result=mysqli_fetch_array($ret);
if($result>0){
$msg="This email associated with another account";
}
else{
$query=mysqli_query($con, "insert into tbluser(FullName, MobileNumber,
Email, Password) value('$fname', '$mobno', '$email', '$password' )");
if ($query) {
echo "<script>alert('You have successfully registered');</script>";
echo "<script type='text/javascript'> document.location ='index.php';
</script>";
}
else
{
echo "<script>alert('Something Went Wrong. Please try again');</script>";
}
}
}

?>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Daily Expense Tracker - Signup</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/datepicker3.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<script type="text/javascript">
function checkpass()
{
if(document.signup.password.value!=document.signup.repeatpassword.value)

57
{
alert('Password and Repeat Password field does not match');
document.signup.repeatpassword.focus();
return false;
}
return true;
}

</script>
<body>
<div class="row">
<h2 align="center">Daily Expense Tracker | User
Registration</h2>
<hr />
<div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-
md-4 col-md-offset-4">
<div class="login-panel panel panel-default">
<div class="panel-heading">Sign Up</div>
<div class="panel-body">
<form role="form" action="" method="post"
id="" name="signup" onsubmit="return checkpass();">
<fieldset>
<div class="form-group">
<input class="form-control"
placeholder="Full Name" name="name" type="text" required="true">
</div>
<div class="form-group">
<input class="form-control"
placeholder="E-mail" name="email" type="email" required="true">
</div>
<div class="form-group">
<input type="text"
class="form-control" id="mobilenumber" name="mobilenumber"
placeholder="Mobile Number" maxlength="10" pattern="[0-9]{10}"
required="true">
</div>
<div class="form-group">
<input class="form-control"
placeholder="Password" name="password" type="password" value=""
required="true">

58
</div>
<div class="form-group">
<input type="password"
class="form-control" id="repeatpassword" name="repeatpassword"
placeholder="Repeat Password" required="true">
</div>
<div class="checkbox">
<button type="submit"
value="submit" name="submit" class="btn
btn-primary">Register</button><span style="padding-left:250px">
</div>
<p>Already Registered <a
href="login.php" >Login here</a></span></p>
</fieldset>
</form>
</div>
</div>
</div><!-- /.col-->
</div><!-- /.row -->

<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>

Dashboard Page –
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['detsuid']==0)) {
header('location:logout.php');
} else{

?>
<!DOCTYPE html>
<html>

59
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Daily Expense Tracker - Dashboard</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/datepicker3.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">

<!--Custom Font-->
<link href="https://fonts.googleapis.com/css?
family=Montserrat:300,300i,400,400i,500,500i,600,600i,700,700i"
rel="stylesheet">
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>

<?php include_once('includes/header.php');?>
<?php include_once('includes/sidebar.php');?>

<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">


<div class="row">
<ol class="breadcrumb">
<li><a href="#">
<em class="fa fa-home"></em>
</a></li>
<li class="active">Dashboard</li>
</ol>
</div><!--/.row-->

<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Dashboard</h1>
</div>
</div><!--/.row-->

<div class="row">
60
<div class="col-xs-6 col-md-3">

<div class="panel panel-default">


<div class="panel-body easypiechart-panel">
<?php
//Today Expense
$userid=$_SESSION['detsuid'];
$tdate=date('Y-m-d');
$query=mysqli_query($con,"select sum(ExpenseCost) as todaysexpense from
tblexpense where date(ExpenseDate)='$tdate' && (UserId='$userid');");
$result=mysqli_fetch_array($query);
$sum_today_expense=$result['todaysexpense'];
?>

<h4>Today's Expense</h4>
<div class="easypiechart"
id="easypiechart-blue" data-percent="<?php echo $sum_today_expense;?>"
><span class="percent"><?php if($sum_today_expense==""){
echo "0";
} else {
echo $sum_today_expense;
}

?></span></div>
</div>
</div>
</div>
<div class="col-xs-6 col-md-3">
<div class="panel panel-default">
<?php
//Yestreday Expense
$userid=$_SESSION['detsuid'];
$ydate=date('Y-m-d',strtotime("-1 days"));
$query1=mysqli_query($con,"select sum(ExpenseCost) as yesterdayexpense
from tblexpense where (ExpenseDate)='$ydate' && (UserId='$userid');");
$result1=mysqli_fetch_array($query1);
$sum_yesterday_expense=$result1['yesterdayexpense'];
?>
<div class="panel-body easypiechart-panel">
<h4>Yesterday's Expense</h4>

61
<div class="easypiechart"
id="easypiechart-orange" data-percent="<?php echo
$sum_yesterday_expense;?>" ><span class="percent"><?php
if($sum_yesterday_expense==""){
echo "0";
} else {
echo $sum_yesterday_expense;
}

?></span></div>
</div>
</div>
</div>
<div class="col-xs-6 col-md-3">
<div class="panel panel-default">
<?php
//Weekly Expense
$userid=$_SESSION['detsuid'];
$pastdate= date("Y-m-d", strtotime("-1 week"));
$crrntdte=date("Y-m-d");
$query2=mysqli_query($con,"select sum(ExpenseCost) as weeklyexpense
from tblexpense where ((ExpenseDate) between '$pastdate' and '$crrntdte')
&& (UserId='$userid');");
$result2=mysqli_fetch_array($query2);
$sum_weekly_expense=$result2['weeklyexpense'];
?>
<div class="panel-body easypiechart-panel">
<h4>Last 7day's Expense</h4>
<div class="easypiechart"
id="easypiechart-teal" data-percent="<?php echo $sum_weekly_expense;?
>"><span class="percent"><?php if($sum_weekly_expense==""){
echo "0";
} else {
echo $sum_weekly_expense;
}

?></span></div>
</div>
</div>
</div>

62
<div class="col-xs-6 col-md-3">
<div class="panel panel-default">
<?php
//Monthly Expense
$userid=$_SESSION['detsuid'];
$monthdate= date("Y-m-d", strtotime("-1 month"));
$crrntdte=date("Y-m-d");
$query3=mysqli_query($con,"select sum(ExpenseCost) as monthlyexpense
from tblexpense where ((ExpenseDate) between '$monthdate' and '$crrntdte')
&& (UserId='$userid');");
$result3=mysqli_fetch_array($query3);
$sum_monthly_expense=$result3['monthlyexpense'];
?>
<div class="panel-body easypiechart-panel">
<h4>Last 30day's Expenses</h4>
<div class="easypiechart"
id="easypiechart-red" data-percent="<?php echo $sum_monthly_expense;?>"
><span class="percent"><?php if($sum_monthly_expense==""){
echo "0";
} else {
echo $sum_monthly_expense;
}

?></span></div>
</div>
</div>
</div>

</div><!--/.row-->
<div class="row">
<div class="col-xs-6 col-md-3">
<div class="panel panel-default">
<?php
//Yearly Expense
$userid=$_SESSION['detsuid'];
$cyear= date("Y");
$query4=mysqli_query($con,"select sum(ExpenseCost) as yearlyexpense from
tblexpense where (year(ExpenseDate)='$cyear') && (UserId='$userid');");
$result4=mysqli_fetch_array($query4);
$sum_yearly_expense=$result4['yearlyexpense'];
?>
63
<div class="panel-body easypiechart-panel">
<h4>Current Year Expenses</h4>
<div class="easypiechart"
id="easypiechart-red" data-percent="<?php echo $sum_yearly_expense;?>"
><span class="percent"><?php if($sum_yearly_expense==""){
echo "0";
} else {
echo $sum_yearly_expense;
}

?></span></div>

</div>

</div>

</div>

<div class="col-xs-6 col-md-3">


<div class="panel panel-default">
<?php
//Yearly Expense
$userid=$_SESSION['detsuid'];
$query5=mysqli_query($con,"select sum(ExpenseCost) as totalexpense from
tblexpense where UserId='$userid';");
$result5=mysqli_fetch_array($query5);
$sum_total_expense=$result5['totalexpense'];
?>
<div class="panel-body easypiechart-panel">
<h4>Total Expenses</h4>
<div class="easypiechart"
id="easypiechart-red" data-percent="<?php echo $sum_total_expense;?>"
><span class="percent"><?php if($sum_total_expense==""){
echo "0";
} else {
echo $sum_total_expense;
}

?></span></div>

64
</div>

</div>

</div>

</div>

<!--/.row-->
</div> <!--/.main-->
<?php include_once('includes/footer.php');?>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/chart.min.js"></script>
<script src="js/chart-data.js"></script>
<script src="js/easypiechart.js"></script>
<script src="js/easypiechart-data.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/custom.js"></script>
<script>
window.onload = function () {
var chart1 = document.getElementById("line-chart").getContext("2d");
window.myLine = new Chart(chart1).Line(lineChartData, {
responsive: true,
scaleLineColor: "rgba(0,0,0,.2)",
scaleGridLineColor: "rgba(0,0,0,.05)",
scaleFontColor: "#c5c7cc"
});
};
</script>

</body>
</html>
<?php } ?>

65
Conclusion

The project titled as Daily Expense Tracker System was deeply studied and
analyzed to design the code and implement. It was done under the guidance of
the experienced project guide. All the current requirements and possibilities
have been taken care during the project time.

Daily Expense Tracker System is used for maintain the daily expenses.

66
Bibliography

For PHP
 https://www.w3schools.com/php/default.asp
 https://www.sitepoint.com/php/
 https://www.php.net/

For MySQL
 https://www.mysql.com/
 http://www.mysqltutorial.org

For XAMPP
 https://www.apachefriends.org/download.html

67

You might also like