mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Added Expense and categories module
This commit is contained in:
122
expenses.php
122
expenses.php
@@ -1,12 +1,18 @@
|
||||
<?php include("header.php"); ?>
|
||||
|
||||
<?php $sql = mysqli_query($mysqli,"SELECT * FROM expenses ORDER BY expense_id DESC"); ?>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM expenses, categories, vendors, accounts
|
||||
WHERE expenses.category_id = categories.category_id
|
||||
AND expenses.vendor_id = vendors.vendor_id
|
||||
AND expenses.account_id = accounts.account_id
|
||||
ORDER BY expenses.expense_date DESC");
|
||||
?>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-table"></i>
|
||||
Expenses
|
||||
<button type="button" class="btn btn-primary btn-sm ml-4" data-toggle="modal" data-target="#addExpenseModal"><i class="fas fa-plus"></i> Add New</button>
|
||||
<h6 class="float-left mt-1"><i class="fa fa-money"></i> Expenses</h6>
|
||||
<button type="button" class="btn btn-primary btn-sm mr-auto float-right" data-toggle="modal" data-target="#addExpenseModal"><i class="fas fa-plus"></i> Add New</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
@@ -28,103 +34,29 @@
|
||||
$expense_id = $row['expense_id'];
|
||||
$expense_date = $row['expense_date'];
|
||||
$expense_amount = $row['expense_amount'];
|
||||
$expense_description = $row['expense_description'];
|
||||
$vendor_id = $row['vendor_id'];
|
||||
$vendor_name = $row['vendor_name'];
|
||||
$expense_category = $row['expense_category'];
|
||||
$category_id = $row['category_id'];
|
||||
$category_name = $row['category_name'];
|
||||
$account_name = $row['account_name'];
|
||||
$account_id = $row['account_id'];
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo "$expense_date"; ?></td>
|
||||
<td><?php echo "$expense_date - $expense_id"; ?></td>
|
||||
<td class="text-right text-monospace">$<?php echo "$expense_amount"; ?></td>
|
||||
<td>Amazon</td>
|
||||
<td>Office Supplies</td>
|
||||
<td>PNC Bank</td>
|
||||
<td><?php echo "$vendor_name"; ?></td>
|
||||
<td><?php echo "$category_name"; ?></td>
|
||||
<td><?php echo "$account_name"; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#">Edit</a>
|
||||
<a class="dropdown-item" href="#">Duplicate</a>
|
||||
<a class="dropdown-item" href="#">Refund</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#">15 Nov 2018</a></td>
|
||||
<td class="text-right text-monospace">$14.53</td>
|
||||
<td>Amazon</td>
|
||||
<td>Office Supplies</td>
|
||||
<td>PNC Bank</td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-link btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#">Edit</a>
|
||||
<a class="dropdown-item" href="#">Duplicate</a>
|
||||
<a class="dropdown-item" href="#">Refund</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#">15 Nov 2018</a></td>
|
||||
<td class="text-right text-monospace">$14.53</td>
|
||||
<td>Amazon</td>
|
||||
<td>Office Supplies</td>
|
||||
<td>PNC Bank</td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-dark btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#">Edit</a>
|
||||
<a class="dropdown-item" href="#">Duplicate</a>
|
||||
<a class="dropdown-item" href="#">Refund</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#">15 Nov 2018</a></td>
|
||||
<td class="text-right text-monospace">$14.53</td>
|
||||
<td>Amazon</td>
|
||||
<td>Office Supplies</td>
|
||||
<td>PNC Bank</td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-light btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#">Edit</a>
|
||||
<a class="dropdown-item" href="#">Duplicate</a>
|
||||
<a class="dropdown-item" href="#">Refund</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#">15 Nov 2018</a></td>
|
||||
<td class="text-right text-monospace">$1,014.53</td>
|
||||
<td>Amazon</td>
|
||||
<td>Office Supplies</td>
|
||||
<td>PNC Bank</td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editExpenseModal<?php echo $expense_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Duplicate</a>
|
||||
<a class="dropdown-item" href="#">Refund</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
@@ -132,6 +64,14 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("edit_expense_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -139,6 +79,6 @@
|
||||
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
|
||||
</div>
|
||||
|
||||
<?php include("add_account_modal.php"); ?>
|
||||
<?php include("add_expense_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php");
|
||||
Reference in New Issue
Block a user