Merge branch 'itflow-org:master' into edit-currnet-expenses-amount-regex

This commit is contained in:
Andrew Malsbury 2023-10-13 22:12:03 -05:00 committed by GitHub
commit 29279d0a7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 176 additions and 82 deletions

View File

@ -46,7 +46,68 @@
</a>
</li>
<li class="nav-header mt-3">Documentation</li>
<li class="nav-header mt-3">SUPPORT</li>
<?php if ($config_module_enable_ticketing == 1) { ?>
<li class="nav-item">
<a href="client_tickets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_tickets.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-life-ring"></i>
<p>
Tickets
<?php
if ($num_active_tickets > 0) { ?>
<span class="right badge <?php if ($num_active_tickets > 0) { ?> badge-danger <?php } ?> text-light"><?php echo $num_active_tickets; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="client_scheduled_tickets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_scheduled_tickets.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-calendar-check"></i>
<p>
Schedule Ticket
<?php
if ($num_scheduled_tickets > 0) { ?>
<span class="right badge text-light"><?php echo $num_scheduled_tickets; ?></span>
<?php } ?>
</p>
</a>
</li>
<?php } ?>
<li class="nav-item">
<a href="client_vendors.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_vendors.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-building"></i>
<p>
Vendors
<?php
if ($num_vendors > 0) { ?>
<span class="right badge text-light"><?php echo $num_vendors; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="client_events.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_events.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-calendar-alt"></i>
<p>
Events
<?php
if ($num_events > 0) { ?>
<span class="right badge text-light"><?php echo $num_events; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-header mt-3">DOCUMENTATION</li>
<li class="nav-item">
<a href="client_assets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_assets.php") { echo "active"; } ?>">
@ -61,20 +122,6 @@
</a>
</li>
<li class="nav-item">
<a href="client_documents.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_documents.php" || basename($_SERVER["PHP_SELF"]) == "client_document_details.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-folder"></i>
<p>
Documents
<?php
if ($num_documents > 0) { ?>
<span class="right badge text-light"><?php echo $num_documents; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="client_software.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_software.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-certificate"></i>
@ -142,53 +189,6 @@
</a>
</li>
<li class="nav-item">
<a href="client_files.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_files.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-paperclip"></i>
<p>
Files
<?php
if ($num_files > 0) { ?>
<span class="right badge text-light"><?php echo $num_files; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-header mt-3">SUPPORT</li>
<?php if ($config_module_enable_ticketing == 1) { ?>
<li class="nav-item">
<a href="client_tickets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_tickets.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-life-ring"></i>
<p>
Tickets
<?php
if ($num_active_tickets > 0) { ?>
<span class="right badge <?php if ($num_active_tickets > 0) { ?> badge-danger <?php } ?> text-light"><?php echo $num_active_tickets; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="client_scheduled_tickets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_scheduled_tickets.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-calendar-check"></i>
<p>
Schedule Ticket
<?php
if ($num_scheduled_tickets > 0) { ?>
<span class="right badge text-light"><?php echo $num_scheduled_tickets; ?></span>
<?php } ?>
</p>
</a>
</li>
<?php } ?>
<li class="nav-item">
<a href="client_services.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_services.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-stream"></i>
@ -203,26 +203,27 @@
</li>
<li class="nav-item">
<a href="client_vendors.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_vendors.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-building"></i>
<a href="client_documents.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_documents.php" || basename($_SERVER["PHP_SELF"]) == "client_document_details.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-folder"></i>
<p>
Vendors
Documents
<?php
if ($num_vendors > 0) { ?>
<span class="right badge text-light"><?php echo $num_vendors; ?></span>
if ($num_documents > 0) { ?>
<span class="right badge text-light"><?php echo $num_documents; ?></span>
<?php } ?>
</p>
</a>
</li>
<li class="nav-item">
<a href="client_events.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_events.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-calendar-alt"></i>
<a href="client_files.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_files.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-paperclip"></i>
<p>
Events
Files
<?php
if ($num_events > 0) { ?>
<span class="right badge text-light"><?php echo $num_events; ?></span>
if ($num_files > 0) { ?>
<span class="right badge text-light"><?php echo $num_files; ?></span>
<?php } ?>
</p>
</a>

View File

@ -169,7 +169,7 @@ $vendors_added = intval($row['vendors_added']);
<div class="col-lg-4 col-md-6 col-sm-12">
<!-- small box -->
<div class="small-box bg-success">
<a class="small-box bg-success" href="report_profit_loss.php">
<div class="inner">
<h3><?php echo numfmt_format_currency($currency_format, $profit, "$session_company_currency"); ?></h3>
<p>Profit</p>
@ -177,13 +177,13 @@ $vendors_added = intval($row['vendors_added']);
<div class="icon">
<i class="fa fa-heart"></i>
</div>
</div>
</a>
</div>
<!-- ./col -->
<div class="col-lg-4 col-md-6 col-sm-12">
<!-- small box -->
<div class="small-box bg-info">
<a class="small-box bg-info" href="report_recurring_by_client.php">
<div class="inner">
<h3><?php echo numfmt_format_currency($currency_format, $recurring_monthly_total, "$session_company_currency"); ?></h3>
<p>Monthly Recurring Income</p>
@ -191,13 +191,13 @@ $vendors_added = intval($row['vendors_added']);
<div class="icon">
<i class="fa fa-sync-alt"></i>
</div>
</div>
</a>
</div>
<!-- ./col -->
<div class="col-lg-4 col-md-6 col-sm-12">
<!-- small box -->
<div class="small-box bg-pink">
<a class="small-box bg-pink" href="report_expense_by_vendor.php">
<div class="inner">
<h3><?php echo numfmt_format_currency($currency_format, $recurring_expense_monthly_total, "$session_company_currency"); ?></h3>
<p>Monthly Recurring Expense</p>
@ -205,7 +205,7 @@ $vendors_added = intval($row['vendors_added']);
<div class="icon">
<i class="fa fa-clock"></i>
</div>
</div>
</a>
</div>
<!-- ./col -->

View File

@ -126,7 +126,7 @@ $expiring_certificates = $sql_certs_expiring['expiring_certs'];
<!-- ./col -->
<div class="col-lg-4 col-6">
<a class="small-box bg-info">
<a class="small-box bg-info" href="/report_all_assets_by_client.php">
<div class="inner">
<h3><?php echo $assets_added; ?></h3>
<p>New Assets</p>

View File

@ -48,7 +48,7 @@ if (isset($_POST['add_account_type'])) {
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Account', log_action = 'Create', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Account Type', log_action = 'Create', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
$_SESSION['alert_message'] = "Account added";
@ -65,10 +65,24 @@ if (isset($_POST['edit_account_type'])) {
mysqli_query($mysqli,"UPDATE account_types SET account_type_name = '$name', account_type_description = '$description' WHERE account_type_id = $account_type_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Account', log_action = 'Edit', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Account Type', log_action = 'Edit', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
$_SESSION['alert_message'] = "Account edited";
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if (isset($_GET['archive_account_type'])) {
$account_type_id = intval($_GET['archive_account_type']);
mysqli_query($mysqli,"UPDATE account_types SET account_type_archived_at = NOW() WHERE account_type_id = $account_type_id");
//logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Account Type', log_action = 'Archive', log_description = '$account_id', log_ip = '$session_ip', log_user_agent = '$session_user_agent'");
$_SESSION['alert_message'] = "Account Archived";
header("Location: " . $_SERVER["HTTP_REFERER"]);
}

View File

@ -0,0 +1,74 @@
<?php
require_once("inc_all_reports.php");
validateTechRole();
if (isset($_GET['year'])) {
$year = intval($_GET['year']);
} else {
$year = date('Y');
}
$sql_clients = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients ORDER BY client_name ASC");
?>
<div class="card card-dark">
<div class="card-header py-2">
<h3 class="card-title mt-2"><i class="fas fa-fw fa-life-ring mr-2"></i>All Assets by Client</h3>
<div class="card-tools">
<button type="button" class="btn btn-primary d-print-none" onclick="window.print();"><i class="fas fa-fw fa-print mr-2"></i>Print</button>
</div>
</div>
<div class="card-body">
<div class="table-responsive-sm">
<table class="table table-striped">
<thead>
<tr>
<th>Client</th>
<th>Asset Name</th>
<th>Asset Type</thss=>
<th>Asset Status</th=>
</tr>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_array($sql_clients)) {
$client_id = intval($row['client_id']);
$client_name = nullable_htmlentities($row['client_name']);
$sql_assets = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_client_id = $client_id ORDER BY asset_name ASC");
foreach ($sql_assets as $asset) {
$asset_id = intval($asset['asset_id']);
$asset_name = nullable_htmlentities($asset['asset_name']);
$asset_type = nullable_htmlentities($asset['asset_type']);
$asset_status = nullable_htmlentities($asset['asset_status']);
?>
<tr>
<td>
<a href="/client_assets.php?client_id=<?php echo $client_id ?>">
<?php echo $client_name ?>
</a>
</td>
<td>
<a href="client_asset_details.php?client_id=<?php echo $client_id ?>&asset_id=<?php echo $asset_id ?>">
<?php echo $asset_name ?>
</a>
</td>
<td><?php echo $asset_type ?></td>
<td><?php echo $asset_status ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<?php
require_once("footer.php");

View File

@ -98,7 +98,12 @@
<p>Password rotation</p>
</a>
</li>
<li class="nav-item">
<a href="report_all_assets_by_client.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_all_assets_by_client.php") { echo "active"; } ?>">
<i class="nav-icon fas fa-life-ring"></i>
<p>All Assets</p>
</a>
</li>
<?php } // End technical reports IF statement ?>
</ul>