-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexpense.php
98 lines (90 loc) · 3.13 KB
/
expense.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
include_once 'config/Database.php';
include_once 'class/User.php';
include_once 'class/Expense.php';
$database = new Database();
$db = $database->getConnection();
$user = new User($db);
$expense = new Expense($db);
if(!$user->loggedIn()) {
header("Location: index.php");
}
include('inc/header.php');
?>
<title>Expense Management System PHP</title>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/dataTables.bootstrap.min.js"></script>
<link rel="stylesheet" href="css/dataTables.bootstrap.min.css" />
<script src="js/general.js"></script>
<script src="js/expense.js"></script>
<?php include('inc/container.php');?>
<div class="container" style="">
<h2>Expense Management System PHP</h2>
<br>
<?php include('top_menus.php'); ?>
<div>
<div class="panel-heading">
<div class="row">
<div class="col-md-10">
<h3 class="panel-title"></h3>
</div>
<div class="col-md-2" align="right">
<button type="button" id="addExpense" class="btn btn-info" title="Add expense"><span class="glyphicon glyphicon-plus"></span></button>
</div>
</div>
</div>
<table id="expenseListing" class="table table-bordered table-striped">
<thead>
<tr>
<th>Sn.</th>
<th>Amount</th>
<th>Category</th>
<th>Date</th>
<th></th>
<th></th>
</tr>
</thead>
</table>
</div>
<div id="expenseModal" class="modal fade">
<div class="modal-dialog">
<form method="post" id="expenseForm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><i class="fa fa-plus"></i> Edit Expense</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="country" class="control-label">Category</label>
<select class="form-control" id="expense_cat" name="expense_cat"/>
<option value="">Select Category</option>
<?php
$categoryResult = $expense->getCategoryList();
while ($category = $categoryResult->fetch_assoc()) {
?>
<option value="<?php echo $category['id']; ?>"><?php echo $category['name']; ?></option>
<?php } ?>
</select>
</div>
<div class="form-group">
<label for="Income" class="control-label">Amount</label>
<input type="text" name="amount" id="amount" autocomplete="off" class="form-control" />
</div>
<div class="form-group"
<label for="project" class="control-label">Date</label>
<input type="date" class="form-control" id="expense_date" name="expense_date" placeholder="Expense date" >
</div>
</div>
<div class="modal-footer">
<input type="hidden" name="id" id="id" />
<input type="hidden" name="action" id="action" value="" />
<input type="submit" name="save" id="save" class="btn btn-info" value="Save" />
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</form>
</div>
</div>
</div>
<?php include('inc/footer.php');?>