Enforce accountant/admin roles to view financial reports

This commit is contained in:
Marcus Hill
2023-02-01 21:28:17 +00:00
parent e79ba696bd
commit baf03d46ac
8 changed files with 935 additions and 919 deletions
+8 -6
View File
@@ -1,15 +1,17 @@
<?php include("inc_all_reports.php"); ?>
<?php
include("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) {
$year = intval($_GET['year']);
}else{
} else {
$year = date('Y');
}
if (isset($_GET['year'])) {
$year = intval($_GET['year']);
}else{
} else {
$year = date('Y');
}
@@ -19,7 +21,7 @@ $sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE company_id = $s
?>
<div class="card card-dark">
<div class="card card-dark">
<div class="card-header py-2">
<h3 class="card-title mt-2"><i class="fa fa-fw fa-building"></i> Expense By Vendor</h3>
<div class="card-tools">
@@ -78,6 +80,6 @@ $sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE company_id = $s
</table>
</div>
</div>
</div>
</div>
<?php include("footer.php"); ?>
<?php require_once("footer.php"); ?>
+7 -4
View File
@@ -1,14 +1,17 @@
<?php include("inc_all_reports.php");
<?php
require_once("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) {
$year = intval($_GET['year']);
}else{
} else {
$year = date('Y');
}
if (isset($_GET['year'])) {
$year = intval($_GET['year']);
}else{
} else {
$year = date('Y');
}
@@ -130,7 +133,7 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_
</div>
</div>
<?php include("footer.php"); ?>
<?php require_once("footer.php"); ?>
<script>
// Set new default font family and font color to mimic Bootstrap's default styling
+6 -4
View File
@@ -1,15 +1,17 @@
<?php include("inc_all_reports.php"); ?>
<?php
require_once("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) {
$year = intval($_GET['year']);
}else{
} else {
$year = date('Y');
}
if (isset($_GET['year'])) {
$year = intval($_GET['year']);
}else{
} else {
$year = date('Y');
}
@@ -80,4 +82,4 @@ $sql_clients = mysqli_query($mysqli,"SELECT * FROM clients WHERE company_id = $s
</div>
</div>
<?php include("footer.php"); ?>
<?php require_once("footer.php"); ?>
+4 -2
View File
@@ -1,6 +1,8 @@
<?php include("inc_all_reports.php"); ?>
<?php
require_once("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) {
$year = intval($_GET['year']);
} else {
@@ -148,7 +150,7 @@ $sql_categories = mysqli_query($mysqli, "SELECT * FROM categories WHERE category
</div>
</div>
<?php include("footer.php"); ?>
<?php require_once("footer.php"); ?>
<script>
// Set new default font family and font color to mimic Bootstrap's default styling
+7 -6
View File
@@ -1,10 +1,11 @@
<?php include("inc_all_reports.php"); ?>
<?php
require_once("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) {
$year = intval($_GET['year']);
}else{
} else {
$year = date('Y');
}
@@ -18,7 +19,7 @@ $sql_categories_expense = mysqli_query($mysqli,"SELECT * FROM categories WHERE c
?>
<div class="card card-dark">
<div class="card card-dark">
<div class="card-header py-2">
<h3 class="card-title mt-2"><i class="fa fa-fw fa-balance-scale"></i> Profit & Loss</h3>
<div class="card-tools">
@@ -425,6 +426,6 @@ $sql_categories_expense = mysqli_query($mysqli,"SELECT * FROM categories WHERE c
</table>
</div>
</div>
</div>
</div>
<?php include("footer.php");
<?php require_once("footer.php");
+5 -2
View File
@@ -1,4 +1,7 @@
<?php include("inc_all_reports.php");
<?php
require_once("inc_all_reports.php");
validateAccountantRole();
$sql_clients = mysqli_query($mysqli,"SELECT * FROM clients WHERE company_id = $session_company_id");
@@ -64,4 +67,4 @@ $sql_clients = mysqli_query($mysqli,"SELECT * FROM clients WHERE company_id = $s
</div>
</div>
<?php include("footer.php"); ?>
<?php require_once("footer.php"); ?>
+7 -6
View File
@@ -1,10 +1,11 @@
<?php include("inc_all_reports.php"); ?>
<?php
require_once("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) {
$year = intval($_GET['year']);
}else{
} else {
$year = date('Y');
}
@@ -15,7 +16,7 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
?>
<div class="card card-dark">
<div class="card card-dark">
<div class="card-header py-2">
<h3 class="card-title mt-2"><i class="fa fa-fw fa-balance-scale"></i> Collected Tax Summary</h3>
<div class="card-tools">
@@ -272,6 +273,6 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
</table>
</div>
</div>
</div>
</div>
<?php include("footer.php");
<?php require_once("footer.php");
+2
View File
@@ -16,6 +16,7 @@
</a>
</li>
<?php if ($session_user_role == 1 || $session_user_role == 3) { ?>
<li class="nav-header">FINANCIAL</li>
<li class="nav-item">
@@ -60,6 +61,7 @@
<p>Profit & Loss</p>
</a>
</li>
<?php } // End financial reports IF statement ?>
</ul>