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

View File

@@ -1,6 +1,8 @@
<?php include("inc_all_reports.php"); ?>
<?php <?php
include("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) { if (isset($_GET['year'])) {
$year = intval($_GET['year']); $year = intval($_GET['year']);
} else { } else {
@@ -80,4 +82,4 @@ $sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE company_id = $s
</div> </div>
</div> </div>
<?php include("footer.php"); ?> <?php require_once("footer.php"); ?>

View File

@@ -1,4 +1,7 @@
<?php include("inc_all_reports.php"); <?php
require_once("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) { if (isset($_GET['year'])) {
$year = intval($_GET['year']); $year = intval($_GET['year']);
@@ -130,7 +133,7 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_
</div> </div>
</div> </div>
<?php include("footer.php"); ?> <?php require_once("footer.php"); ?>
<script> <script>
// Set new default font family and font color to mimic Bootstrap's default styling // Set new default font family and font color to mimic Bootstrap's default styling

View File

@@ -1,6 +1,8 @@
<?php include("inc_all_reports.php"); ?>
<?php <?php
require_once("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) { if (isset($_GET['year'])) {
$year = intval($_GET['year']); $year = intval($_GET['year']);
} else { } else {
@@ -80,4 +82,4 @@ $sql_clients = mysqli_query($mysqli,"SELECT * FROM clients WHERE company_id = $s
</div> </div>
</div> </div>
<?php include("footer.php"); ?> <?php require_once("footer.php"); ?>

View File

@@ -1,6 +1,8 @@
<?php include("inc_all_reports.php"); ?>
<?php <?php
require_once("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) { if (isset($_GET['year'])) {
$year = intval($_GET['year']); $year = intval($_GET['year']);
} else { } else {
@@ -148,7 +150,7 @@ $sql_categories = mysqli_query($mysqli, "SELECT * FROM categories WHERE category
</div> </div>
</div> </div>
<?php include("footer.php"); ?> <?php require_once("footer.php"); ?>
<script> <script>
// Set new default font family and font color to mimic Bootstrap's default styling // Set new default font family and font color to mimic Bootstrap's default styling

View File

@@ -1,7 +1,8 @@
<?php include("inc_all_reports.php"); ?>
<?php <?php
require_once("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) { if (isset($_GET['year'])) {
$year = intval($_GET['year']); $year = intval($_GET['year']);
} else { } else {
@@ -427,4 +428,4 @@ $sql_categories_expense = mysqli_query($mysqli,"SELECT * FROM categories WHERE c
</div> </div>
</div> </div>
<?php include("footer.php"); <?php require_once("footer.php");

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"); $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>
</div> </div>
<?php include("footer.php"); ?> <?php require_once("footer.php"); ?>

View File

@@ -1,7 +1,8 @@
<?php include("inc_all_reports.php"); ?>
<?php <?php
require_once("inc_all_reports.php");
validateAccountantRole();
if (isset($_GET['year'])) { if (isset($_GET['year'])) {
$year = intval($_GET['year']); $year = intval($_GET['year']);
} else { } else {
@@ -274,4 +275,4 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
</div> </div>
</div> </div>
<?php include("footer.php"); <?php require_once("footer.php");

View File

@@ -16,6 +16,7 @@
</a> </a>
</li> </li>
<?php if ($session_user_role == 1 || $session_user_role == 3) { ?>
<li class="nav-header">FINANCIAL</li> <li class="nav-header">FINANCIAL</li>
<li class="nav-item"> <li class="nav-item">
@@ -60,6 +61,7 @@
<p>Profit & Loss</p> <p>Profit & Loss</p>
</a> </a>
</li> </li>
<?php } // End financial reports IF statement ?>
</ul> </ul>