Daily Expense Tracking System: A Project Report On
Daily Expense Tracking System: A Project Report On
Project Report on
Submitted By
SAIPRASAD MAHARANA
ROLL NO – PGUNCSC20008
2
ACKNOWLEDGEMENTS
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.
SAIPRASAD MAHARANA
M.Sc. (Computer Science)
Roll No: PGUNCSC20008
3
DECLARATION
4
5
ABSTRACT
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
02 PROJECT OVERVIEW 10
04 DESIGN DOCUMENT 18
05 DATABASE DESIGN 27
06 SYSTEM TESTING 30
08 CODING 41
09 CONCLUSION 65
10 REFERENCES 67
8
SOFTWARE AND HARDWARE SPECIFICATIONS
HARDWARE REQUIREMENTS:
RAM : 1GB
SOFTWARE REQUIREMENTS:
Database : MySQL
Server : Apache
Frontend : HTML
IDE : Sublime
Technology : PHP
9
PROJECT OVERVIEW
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.
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.
10
SYSTEM DEVELOPMENT ENVIRONMENT
1. HTML
WHAT IS HTML?
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
11
</HEAD> : Ending a web pages head
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.
EX: <HTML>
12
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE=”JavaScript”>
</SCRIPT>
</BODY></HTML>
JAVASCRIPTS OBJECTS
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
JAVASCRIPTS FUNCTIONS
Declaration of function
5.RDBMS CONCEPTS
1. DATA ABSTRACTION
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
a. Hierarchical Database:
b. Network Database:
c. Relational Database:
15
6. THE SQL LANGUAGE
Features of SQL
PHP
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"
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 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.
External entities
18
DATAFLOWS
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.
0.0
20
2nd Level DFDs
1.1
Expenses
DB DB
1.2
User
1.1.1.1
Add
Expenses
User Info
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.
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.
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
Signup
Sign in
Dashboard
Manage Expense
(Add/ Edit)
Generate Reports
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
SYMBOL PURPOSE
Represent attributes.
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
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.
redundancy and maximum stability. This ensures minimizing data storage required,
MySQL database has been chosen for developing the relevant databases.
tbluser table Structure: This table store the login and personal details of user.
28
tblexpense table Structure: This table store the item expense details.
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
TESTING OBJECTIVES:
Testing cannot show the absence of defects, it can only show that software
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:
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
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
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>
<?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'];
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="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>
<?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="row">
<div class="col-lg-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']);
?>
<!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="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">
<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>
?></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