mirror of https://github.com/itflow-org/itflow
Graphes are starting to work in dashboard
This commit is contained in:
parent
8ba1ec21d9
commit
cf7003e7f1
|
|
@ -3,11 +3,21 @@
|
|||
<ul class="sidebar navbar-nav d-print-none">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="clients.php">
|
||||
<button class="btn btn-outline-light btn-block">
|
||||
<i class="fas fa-fw fa-arrow-left mx-2"></i>
|
||||
<span>Back</span>
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?php if($_GET['tab'] == "overview") { echo "active"; } ?>"
|
||||
href="?client_id=<?php echo $client_id; ?>&tab=overview">
|
||||
<i class="fas fa-fw fa-chart-bar mx-2"></i>
|
||||
<span>Overview</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?php if($_GET['tab'] == "contacts") { echo "active"; } ?>"
|
||||
href="?client_id=<?php echo $client_id; ?>&tab=contacts">
|
||||
|
|
|
|||
|
|
@ -22,17 +22,29 @@ if(isset($_GET['search'])){
|
|||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<form>
|
||||
<form>
|
||||
<div class="col-2">
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Search clients..." name="search">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark" type="submit"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="input-group">
|
||||
<select class="form-control" name="orderby">
|
||||
<option>Sort By</option>
|
||||
<option value="client_name">Client Name</option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark" type="submit" name="sort" value="ASC"><i class="fa fa-arrow-down"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<button type="button" class="btn btn-primary mr-auto float-right" data-toggle="modal" data-target="#addClientModal"><i class="fas fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
445
dashboard.php
445
dashboard.php
|
|
@ -1,18 +1,35 @@
|
|||
<?php include("header.php"); ?>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
|
||||
function roundUpToNearestMultiple($n, $increment = 1000)
|
||||
{
|
||||
return (int) ($increment * ceil($n / $increment));
|
||||
}
|
||||
|
||||
if(isset($_GET['year'])){
|
||||
$year = intval($_GET['year']);
|
||||
}else{
|
||||
$year = date('Y');
|
||||
}
|
||||
|
||||
//GET THE YEARS
|
||||
$sql_payment_years = mysqli_query($mysqli,"SELECT DISTINCT YEAR(payment_date) AS payment_year FROM payments WHERE invoice_id > 0 ORDER BY payment_year DESC");
|
||||
|
||||
|
||||
//Get Total income Do not grab transfer payment as these have an invoice_id of 0
|
||||
$sql_total_income = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_income FROM payments WHERE invoice_id > 0");
|
||||
$sql_total_income = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_income FROM payments WHERE invoice_id > 0 AND YEAR(payment_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_total_income);
|
||||
$total_income = $row['total_income'];
|
||||
|
||||
//Get Total expenses and do not grab transfer expenses as these have a vendor of 0
|
||||
$sql_total_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE vendor_id > 0");
|
||||
$sql_total_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE vendor_id > 0 AND YEAR(expense_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_total_expenses);
|
||||
$total_expenses = $row['total_expenses'];
|
||||
|
||||
//Total up all the
|
||||
$sql_invoice_totals = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS invoice_totals FROM invoices WHERE invoice_status NOT LIKE 'Draft'");
|
||||
$sql_invoice_totals = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS invoice_totals FROM invoices WHERE invoice_status NOT LIKE 'Draft' AND AND YEAR(invoice_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_invoice_totals);
|
||||
$invoice_totals = $row['invoice_totals'];
|
||||
|
||||
|
|
@ -36,6 +53,22 @@ $sql_latest_expenses = mysqli_query($mysqli,"SELECT * FROM expenses, vendors, ca
|
|||
|
||||
?>
|
||||
|
||||
<form>
|
||||
<select onchange="this.form.submit()" class="form-control mb-3" name="year">
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_payment_years)){
|
||||
$payment_year = $row['payment_year'];
|
||||
?>
|
||||
<option <?php if($year == $payment_year){ ?> selected <?php } ?> > <?php echo $payment_year; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</form>
|
||||
|
||||
<!-- Icon Cards-->
|
||||
<div class="row">
|
||||
<div class="col-xl-4 col-sm-6 mb-3">
|
||||
|
|
@ -70,142 +103,168 @@ $sql_latest_expenses = mysqli_query($mysqli,"SELECT * FROM expenses, vendors, ca
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Area Chart Example-->
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chart-area"></i>
|
||||
Cash Flow</div>
|
||||
<div class="card-body">
|
||||
<canvas id="myAreaChart" width="100%" height="30"></canvas>
|
||||
<div class="col-md-12">
|
||||
<!-- Area Chart Example-->
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chart-area"></i>
|
||||
Cash Flow</div>
|
||||
<div class="card-body">
|
||||
<canvas id="myAreaChart" width="100%" height="25"></canvas>
|
||||
</div>
|
||||
<div class="card-footer"></div>
|
||||
</div>
|
||||
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
|
||||
</div>
|
||||
|
||||
<!-- DataTables Example -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">Account Balance</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysqli_fetch_array($sql_accounts)){
|
||||
$account_id = $row['account_id'];
|
||||
$account_name = $row['account_name'];
|
||||
$opening_balance = $row['opening_balance'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $account_name; ?></a></td>
|
||||
<?php
|
||||
$sql2 = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_payments FROM payments WHERE account_id = $account_id");
|
||||
$row2 = mysqli_fetch_array($sql2);
|
||||
|
||||
$sql3 = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE account_id = $account_id");
|
||||
$row3 = mysqli_fetch_array($sql3);
|
||||
|
||||
$balance = $opening_balance + $row2['total_payments'] - $row3['total_expenses'];
|
||||
if($balance == ''){
|
||||
$balance = '0.00';
|
||||
}
|
||||
?>
|
||||
|
||||
<td class="text-right text-monospace">$<?php echo number_format($balance,2); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chart-pie"></i>
|
||||
Income By Category
|
||||
</div>
|
||||
</div> <!-- .col -->
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Latest Payments
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Customer</th>
|
||||
<th>Invoice</th>
|
||||
<th class="text-right">Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysqli_fetch_array($sql_latest_income_payments)){
|
||||
$payment_date = $row['payment_date'];
|
||||
$payment_amount = $row['payment_amount'];
|
||||
$invoice_number = $row['invoice_number'];
|
||||
$client_name = $row['client_name'];
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $payment_date; ?></td>
|
||||
<td><?php echo $client_name; ?></td>
|
||||
<td><?php echo $invoice_number; ?></td>
|
||||
<td class="text-right text-monospace">$<?php echo number_format($payment_amount,2); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<canvas id="incomeByCategoryPieChart" width="100%" height="60"></canvas>
|
||||
</div>
|
||||
</div> <!-- .col -->
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Latest Expenses
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Vendor</th>
|
||||
<th>Category</th>
|
||||
<th class="text-right">Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysqli_fetch_array($sql_latest_expenses)){
|
||||
$expense_date = $row['expense_date'];
|
||||
$expense_amount = $row['expense_amount'];
|
||||
$vendor_name = $row['vendor_name'];
|
||||
$category_name = $row['category_name'];
|
||||
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $expense_date; ?></td>
|
||||
<td><?php echo $vendor_name; ?></td>
|
||||
<td><?php echo $category_name; ?></td>
|
||||
<td class="text-right text-monospace">$<?php echo number_format($expense_amount,2); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chart-pie"></i>
|
||||
Expense By Category
|
||||
</div>
|
||||
</div> <!-- .col -->
|
||||
</div> <!-- row -->
|
||||
<div class="card-body">
|
||||
<canvas id="expenseByCategoryPieChart" width="100%" height="60"></canvas>
|
||||
</div>
|
||||
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Account Balance
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysqli_fetch_array($sql_accounts)){
|
||||
$account_id = $row['account_id'];
|
||||
$account_name = $row['account_name'];
|
||||
$opening_balance = $row['opening_balance'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $account_name; ?></a></td>
|
||||
<?php
|
||||
$sql2 = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_payments FROM payments WHERE account_id = $account_id");
|
||||
$row2 = mysqli_fetch_array($sql2);
|
||||
|
||||
$sql3 = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE account_id = $account_id");
|
||||
$row3 = mysqli_fetch_array($sql3);
|
||||
|
||||
$balance = $opening_balance + $row2['total_payments'] - $row3['total_expenses'];
|
||||
if($balance == ''){
|
||||
$balance = '0.00';
|
||||
}
|
||||
?>
|
||||
|
||||
<td class="text-right text-monospace">$<?php echo number_format($balance,2); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .col -->
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Latest Payments
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Customer</th>
|
||||
<th>Invoice</th>
|
||||
<th class="text-right">Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysqli_fetch_array($sql_latest_income_payments)){
|
||||
$payment_date = $row['payment_date'];
|
||||
$payment_amount = $row['payment_amount'];
|
||||
$invoice_number = $row['invoice_number'];
|
||||
$client_name = $row['client_name'];
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $payment_date; ?></td>
|
||||
<td><?php echo $client_name; ?></td>
|
||||
<td><?php echo $invoice_number; ?></td>
|
||||
<td class="text-right text-monospace">$<?php echo number_format($payment_amount,2); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .col -->
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Latest Expenses
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Vendor</th>
|
||||
<th>Category</th>
|
||||
<th class="text-right">Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysqli_fetch_array($sql_latest_expenses)){
|
||||
$expense_date = $row['expense_date'];
|
||||
$expense_amount = $row['expense_amount'];
|
||||
$vendor_name = $row['vendor_name'];
|
||||
$category_name = $row['category_name'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $expense_date; ?></td>
|
||||
<td><?php echo $vendor_name; ?></td>
|
||||
<td><?php echo $category_name; ?></td>
|
||||
<td class="text-right text-monospace">$<?php echo number_format($expense_amount,2); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .col -->
|
||||
</div> <!-- row -->
|
||||
|
||||
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<script>
|
||||
|
||||
// Set new default font family and font color to mimic Bootstrap's default styling
|
||||
Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
||||
Chart.defaults.global.defaultFontColor = '#292b2c';
|
||||
|
|
@ -215,9 +274,9 @@ var ctx = document.getElementById("myAreaChart");
|
|||
var myLineChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ["Mar 1", "Mar 2", "Mar 3", "Mar 4", "Mar 5", "Mar 6", "Mar 7", "Mar 8", "Mar 9", "Mar 10", "Mar 11", "Mar 12", "Mar 13"],
|
||||
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Nov", "Dec"],
|
||||
datasets: [{
|
||||
label: "Sessions",
|
||||
label: "Income",
|
||||
lineTension: 0.3,
|
||||
backgroundColor: "rgba(2,117,216,0.2)",
|
||||
borderColor: "rgba(2,117,216,1)",
|
||||
|
|
@ -228,7 +287,27 @@ var myLineChart = new Chart(ctx, {
|
|||
pointHoverBackgroundColor: "rgba(2,117,216,1)",
|
||||
pointHitRadius: 50,
|
||||
pointBorderWidth: 2,
|
||||
data: [10000, 30162, 26263, 18394, 18287, 28682, 31274, 33259, 25849, 24159, 32651, 31984, 38451],
|
||||
data: [
|
||||
<?php
|
||||
for($month = 1; $month<=12; $month++) {
|
||||
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$income_for_month = $row['payment_amount_for_month'];
|
||||
if($income_for_month > 0 AND $income_for_month > $largest_income_month){
|
||||
$largest_income_month = $income_for_month;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<?php echo "$income_for_month,"; ?>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
],
|
||||
}],
|
||||
},
|
||||
options: {
|
||||
|
|
@ -241,13 +320,13 @@ var myLineChart = new Chart(ctx, {
|
|||
display: false
|
||||
},
|
||||
ticks: {
|
||||
maxTicksLimit: 7
|
||||
maxTicksLimit: 12
|
||||
}
|
||||
}],
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
min: 0,
|
||||
max: 40000,
|
||||
max: <?php echo roundUpToNearestMultiple($largest_income_month); ?>,
|
||||
maxTicksLimit: 5
|
||||
},
|
||||
gridLines: {
|
||||
|
|
@ -261,4 +340,106 @@ var myLineChart = new Chart(ctx, {
|
|||
}
|
||||
});
|
||||
|
||||
// Set new default font family and font color to mimic Bootstrap's default styling
|
||||
Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
||||
Chart.defaults.global.defaultFontColor = '#292b2c';
|
||||
|
||||
// Pie Chart Example
|
||||
var ctx = document.getElementById("incomeByCategoryPieChart");
|
||||
var myPieChart = new Chart(ctx, {
|
||||
type: 'pie',
|
||||
data: {
|
||||
labels: [
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli,"SELECT DISTINCT category_name FROM categories, expenses WHERE expenses.category_id = categories.category_id AND YEAR(expense_date) = $year");
|
||||
while($row = mysqli_fetch_array($sql_categories)){
|
||||
$category_name = $row['category_name'];
|
||||
echo "\"$category_name\",";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
],
|
||||
datasets: [{
|
||||
data: [
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'expense'");
|
||||
while($row = mysqli_fetch_array($sql_categories)){
|
||||
$category_id = $row['category_id'];
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_amount_for_year FROM expenses WHERE category_id = $category_id AND YEAR(expense_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$expense_amount_for_year = $row['expense_amount_for_year'];
|
||||
echo "$expense_amount_for_year,";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
],
|
||||
backgroundColor: [
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli,"SELECT DISTINCT category_name, category_color FROM categories, expenses WHERE expenses.category_id = categories.category_id AND YEAR(expense_date) = $year");
|
||||
while($row = mysqli_fetch_array($sql_categories)){
|
||||
$category_color = $row['category_color'];
|
||||
echo "\"$category_color\",";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
],
|
||||
}],
|
||||
},
|
||||
});
|
||||
|
||||
// Set new default font family and font color to mimic Bootstrap's default styling
|
||||
Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
||||
Chart.defaults.global.defaultFontColor = '#292b2c';
|
||||
|
||||
// Pie Chart Example
|
||||
var ctx = document.getElementById("expenseByCategoryPieChart");
|
||||
var myPieChart = new Chart(ctx, {
|
||||
type: 'pie',
|
||||
data: {
|
||||
labels: [
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli,"SELECT DISTINCT category_name FROM categories, expenses WHERE expenses.category_id = categories.category_id AND YEAR(expense_date) = $year");
|
||||
while($row = mysqli_fetch_array($sql_categories)){
|
||||
$category_name = $row['category_name'];
|
||||
echo "\"$category_name\",";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
],
|
||||
datasets: [{
|
||||
data: [
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'expense'");
|
||||
while($row = mysqli_fetch_array($sql_categories)){
|
||||
$category_id = $row['category_id'];
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_amount_for_year FROM expenses WHERE category_id = $category_id AND YEAR(expense_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$expense_amount_for_year = $row['expense_amount_for_year'];
|
||||
echo "$expense_amount_for_year,";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
],
|
||||
backgroundColor: [
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli,"SELECT DISTINCT category_name, category_color FROM categories, expenses WHERE expenses.category_id = categories.category_id AND YEAR(expense_date) = $year");
|
||||
while($row = mysqli_fetch_array($sql_categories)){
|
||||
$category_color = $row['category_color'];
|
||||
echo "\"$category_color\",";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
],
|
||||
}],
|
||||
},
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
@ -20,13 +20,11 @@
|
|||
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
|
||||
|
||||
<!-- Page level plugin JavaScript-->
|
||||
<script src="vendor/chart.js/Chart.min.js"></script>
|
||||
<script src="vendor/datatables/jquery.dataTables.js"></script>
|
||||
<script src="vendor/datatables/dataTables.bootstrap4.js"></script>
|
||||
|
||||
<script src="vendor/easy-markdown-editor-2.5.1/dist/easymde.min.js"></script>
|
||||
|
||||
<script src="vendor/chart.js/Chart.min.js"></script>
|
||||
|
||||
|
||||
<!-- Custom scripts for all pages-->
|
||||
<script src="js/sb-admin.min.js"></script>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,112 @@
|
|||
<?php //include("header.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
include("config.php");
|
||||
//include("check_login.php");
|
||||
//include("vendor/Parsedown.php");
|
||||
//include("functions.php");
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title><?php echo $config_company_name; ?></title>
|
||||
|
||||
|
||||
<!-- Page level plugin CSS-->
|
||||
<link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- Custom fonts for this template-->
|
||||
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- Custom styles for this template-->
|
||||
<link href="css/sb-admin.css" rel="stylesheet" type="text/css">
|
||||
|
||||
</head>
|
||||
|
||||
<body id="page-top">
|
||||
|
||||
|
||||
<div id="wrapper">
|
||||
|
||||
<div id="content-wrapper">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<canvas id="myAreaChart" width="100%" height="30"></canvas>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chart-bar"></i>
|
||||
Bar Chart Example</div>
|
||||
<div class="card-body">
|
||||
<canvas id="myBarChart" width="100%" height="50"></canvas>
|
||||
</div>
|
||||
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chart-pie"></i>
|
||||
Pie Chart Example</div>
|
||||
<div class="card-body">
|
||||
<canvas id="myPieChart" width="100%" height="100"></canvas>
|
||||
</div>
|
||||
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.container-fluid -->
|
||||
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
|
||||
</div>
|
||||
<!-- /#wrapper -->
|
||||
|
||||
<!-- Scroll to Top Button-->
|
||||
<a class="scroll-to-top rounded" href="#page-top">
|
||||
<i class="fas fa-angle-up"></i>
|
||||
</a>
|
||||
|
||||
<!-- Bootstrap core JavaScript-->
|
||||
<script src="vendor/jquery/jquery.min.js"></script>
|
||||
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Core plugin JavaScript-->
|
||||
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
|
||||
|
||||
<!-- Page level plugin JavaScript-->
|
||||
<script src="vendor/chart.js/Chart.min.js"></script>
|
||||
|
||||
<!-- Custom scripts for all pages-->
|
||||
<script src="js/sb-admin.min.js"></script>
|
||||
|
||||
<script src="js/demo/chart-area-demo.js"></script>
|
||||
<script src="js/demo/chart-bar-demo.js"></script>
|
||||
<script src="js/demo/chart-pie-demo.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<?php //include("footer.php"); ?>
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>SB Admin - Charts</title>
|
||||
|
||||
<!-- Custom fonts for this template-->
|
||||
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- Page level plugin CSS-->
|
||||
<link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom styles for this template-->
|
||||
<link href="css/sb-admin.css" rel="stylesheet">
|
||||
|
||||
</head>
|
||||
|
||||
<body id="page-top">
|
||||
|
||||
<nav class="navbar navbar-expand navbar-dark bg-dark static-top">
|
||||
|
||||
<a class="navbar-brand mr-1" href="index.html">Start Bootstrap</a>
|
||||
|
||||
<button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">
|
||||
<i class="fas fa-bars"></i>
|
||||
</button>
|
||||
|
||||
<!-- Navbar Search -->
|
||||
<form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary" type="button">
|
||||
<i class="fas fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Navbar -->
|
||||
<ul class="navbar-nav ml-auto ml-md-0">
|
||||
<li class="nav-item dropdown no-arrow mx-1">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="alertsDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-bell fa-fw"></i>
|
||||
<span class="badge badge-danger">9+</span>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="alertsDropdown">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#">Something else here</a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item dropdown no-arrow mx-1">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="messagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-envelope fa-fw"></i>
|
||||
<span class="badge badge-danger">7</span>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="messagesDropdown">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#">Something else here</a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item dropdown no-arrow">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-user-circle fa-fw"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">
|
||||
<a class="dropdown-item" href="#">Settings</a>
|
||||
<a class="dropdown-item" href="#">Activity Log</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">Logout</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
<div id="wrapper">
|
||||
|
||||
<!-- Sidebar -->
|
||||
<ul class="sidebar navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="index.html">
|
||||
<i class="fas fa-fw fa-tachometer-alt"></i>
|
||||
<span>Dashboard</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="pagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-fw fa-folder"></i>
|
||||
<span>Pages</span>
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="pagesDropdown">
|
||||
<h6 class="dropdown-header">Login Screens:</h6>
|
||||
<a class="dropdown-item" href="login.html">Login</a>
|
||||
<a class="dropdown-item" href="register.html">Register</a>
|
||||
<a class="dropdown-item" href="forgot-password.html">Forgot Password</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<h6 class="dropdown-header">Other Pages:</h6>
|
||||
<a class="dropdown-item" href="404.html">404 Page</a>
|
||||
<a class="dropdown-item" href="blank.html">Blank Page</a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="charts.html">
|
||||
<i class="fas fa-fw fa-chart-area"></i>
|
||||
<span>Charts</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="tables.html">
|
||||
<i class="fas fa-fw fa-table"></i>
|
||||
<span>Tables</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="content-wrapper">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- Breadcrumbs-->
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="#">Dashboard</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">Charts</li>
|
||||
</ol>
|
||||
|
||||
<!-- Area Chart Example-->
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chart-area"></i>
|
||||
Area Chart Example</div>
|
||||
<div class="card-body">
|
||||
<canvas id="myAreaChart" width="100%" height="30"></canvas>
|
||||
</div>
|
||||
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chart-bar"></i>
|
||||
Bar Chart Example</div>
|
||||
<div class="card-body">
|
||||
<canvas id="myBarChart" width="100%" height="50"></canvas>
|
||||
</div>
|
||||
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chart-pie"></i>
|
||||
Pie Chart Example</div>
|
||||
<div class="card-body">
|
||||
<canvas id="myPieChart" width="100%" height="100"></canvas>
|
||||
</div>
|
||||
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="small text-center text-muted my-5">
|
||||
<em>More chart examples coming soon...</em>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<!-- /.container-fluid -->
|
||||
|
||||
<!-- Sticky Footer -->
|
||||
<footer class="sticky-footer">
|
||||
<div class="container my-auto">
|
||||
<div class="copyright text-center my-auto">
|
||||
<span>Copyright © Your Website 2019</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
|
||||
</div>
|
||||
<!-- /#wrapper -->
|
||||
|
||||
<!-- Scroll to Top Button-->
|
||||
<a class="scroll-to-top rounded" href="#page-top">
|
||||
<i class="fas fa-angle-up"></i>
|
||||
</a>
|
||||
|
||||
<!-- Logout Modal-->
|
||||
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
|
||||
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
|
||||
<a class="btn btn-primary" href="login.html">Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap core JavaScript-->
|
||||
<script src="vendor/jquery/jquery.min.js"></script>
|
||||
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Core plugin JavaScript-->
|
||||
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
|
||||
|
||||
<!-- Page level plugin JavaScript-->
|
||||
<script src="vendor/chart.js/Chart.min.js"></script>
|
||||
|
||||
<!-- Custom scripts for all pages-->
|
||||
<script src="js/sb-admin.min.js"></script>
|
||||
|
||||
<!-- Demo scripts for this page-->
|
||||
<script src="js/demo/chart-area-demo.js"></script>
|
||||
<script src="js/demo/chart-bar-demo.js"></script>
|
||||
<script src="js/demo/chart-pie-demo.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
include("config.php");
|
||||
include("check_login.php");
|
||||
include("vendor/Parsedown.php");
|
||||
//include("vendor/Parsedown.php");
|
||||
//include("functions.php");
|
||||
|
||||
?>
|
||||
|
|
|
|||
10
invoice.php
10
invoice.php
|
|
@ -77,11 +77,13 @@ if(isset($_GET['invoice_id'])){
|
|||
<a href="client.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">INV-<?php echo $invoice_number; ?></li>
|
||||
<span class="ml-3 p-2 badge badge-<?php echo $invoice_badge_color; ?>"><?php echo $invoice_status; ?></span>
|
||||
<span class="p-2 ml-2 badge badge-<?php echo $invoice_badge_color; ?>"><?php echo $invoice_status; ?></span>
|
||||
</ol>
|
||||
|
||||
<div class="row mb-4 d-print-none">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-primary btn-sm float-right" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
|
|
@ -90,7 +92,7 @@ if(isset($_GET['invoice_id'])){
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editInvoiceModal">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addinvoiceCopyModal<?php echo $invoice_id; ?>">Copy</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addinvoiceCopyModal<?php echo $invoice_id; ?>">Recurring</a>
|
||||
<a class="dropdown-item" href="post.php?email_invoice=<?php echo $invoice_id; ?>">Send Email</a>
|
||||
<a class="dropdown-item" href="post.php?email_invoice=<?php echo $invoice_id; ?>">Send</a>
|
||||
<?php if($invoice_status == "Draft"){ ?><a class="dropdown-item" href="post.php?mark_invoice_sent=<?php echo $invoice_id; ?>">Mark Sent</a><?php } ?>
|
||||
<?php if($invoice_status !== "Paid"){ ?><a class="dropdown-item" href="#" data-toggle="modal" data-target="#addPaymentModal">Add Payment</a><?php } ?>
|
||||
<a class="dropdown-item" href="#" onclick="window.print();">Print</a>
|
||||
|
|
@ -327,7 +329,7 @@ if(isset($_GET['invoice_id'])){
|
|||
<th>Date</th>
|
||||
<th>Amount</th>
|
||||
<th>Account</th>
|
||||
<th></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_
|
|||
$payment_total_amount_for_month = $row['payment_total_amount_for_month'];
|
||||
$total_payment_for_all_months = $payment_total_amount_for_month + $total_payment_for_all_months;
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<th class="text-right">$<?php echo number_format($payment_total_amount_for_month,2); ?></th>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<nav class="navbar navbar-expand navbar-dark bg-primary static-top">
|
||||
|
||||
<a class="navbar-brand mr-1" href="index.html"><?php echo "$config_company_name";?></a>
|
||||
<a class="navbar-brand mr-1" href="index.php"><?php echo "$config_company_name";?></a>
|
||||
|
||||
<button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">
|
||||
<i class="fas fa-bars"></i>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<ul class="navbar-nav ml-auto ml-md-0">
|
||||
<li class="nav-item dropdown no-arrow mx-2">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="alertsDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-bell"></i>
|
||||
<i class="fas fa-bell mt-2"></i>
|
||||
<?php if($num_alerts > 0){ ?> <span class="badge badge-danger"><?php echo $num_alerts; ?></span> <?php } ?>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="alertsDropdown">
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue