mirror of https://github.com/itflow-org/itflow
Attempt to stack Income and expense into one chart on dashboard
This commit is contained in:
parent
8a7c7d6321
commit
6c2bdb0ebe
|
|
@ -136,19 +136,6 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="?client_id=<?php echo $client_id; ?>&tab=trips" class="nav-link <?php if($_GET['tab'] == "trips") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-bicycle"></i>
|
||||
<p>
|
||||
Trips
|
||||
<?php
|
||||
if($num_trips > 0){ ?>
|
||||
<span class="right badge badge-light"><?php echo $num_trips; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="?client_id=<?php echo $client_id; ?>&tab=events" class="nav-link <?php if($_GET['tab'] == "events") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-calendar"></i>
|
||||
|
|
@ -188,7 +175,7 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-header">SALES</li>
|
||||
<li class="nav-header">SALES AND ACCOUNTING</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="?client_id=<?php echo $client_id; ?>&tab=invoices" class="nav-link <?php if($_GET['tab'] == "invoices") { echo "active"; } ?>">
|
||||
|
|
@ -242,6 +229,19 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="?client_id=<?php echo $client_id; ?>&tab=trips" class="nav-link <?php if($_GET['tab'] == "trips") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-bicycle"></i>
|
||||
<p>
|
||||
Trips
|
||||
<?php
|
||||
if($num_trips > 0){ ?>
|
||||
<span class="right badge badge-light"><?php echo $num_trips; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
|
|
|
|||
|
|
@ -491,6 +491,40 @@ var myLineChart = new Chart(ctx, {
|
|||
|
||||
?>
|
||||
|
||||
],
|
||||
},
|
||||
label: "Expense",
|
||||
lineTension: 0.3,
|
||||
backgroundColor: "rgba(2,2,216,0.2)",
|
||||
borderColor: "rgba(2,2,216,1)",
|
||||
pointRadius: 5,
|
||||
pointBackgroundColor: "rgba(2,117,216,1)",
|
||||
pointBorderColor: "rgba(255,255,255,0.8)",
|
||||
pointHoverRadius: 5,
|
||||
pointHoverBackgroundColor: "rgba(2,117,216,1)",
|
||||
pointHitRadius: 50,
|
||||
pointBorderWidth: 2,
|
||||
data: [
|
||||
<?php
|
||||
for($month = 1; $month<=12; $month++) {
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_amount_for_month FROM expenses WHERE YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0 AND expenses.company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$expenses_for_month = $row['expense_amount_for_month'];
|
||||
|
||||
if($expenses_for_month > 0 AND $expenses_for_month > $largest_expense_month){
|
||||
$largest_expense_month = $expenses_for_month;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<?php echo "$expenses_for_month,"; ?>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
],
|
||||
}],
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue