mirror of https://github.com/itflow-org/itflow
More progress on consolidating files into user and admin
This commit is contained in:
parent
95950700d8
commit
38e2e50a29
|
|
@ -1,53 +0,0 @@
|
|||
<?php
|
||||
require_once "../includes/inc_confirm_modal.php";
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (str_contains(basename($_SERVER["PHP_SELF"]), "admin_")) { ?>
|
||||
<p class="text-right font-weight-light">ITFlow <?php echo APP_VERSION ?> · <a target="_blank" href="https://docs.itflow.org">Docs</a> · <a target="_blank" href="https://forum.itflow.org">Forum</a> · <a target="_blank" href="https://services.itflow.org">Services</a></p>
|
||||
<br>
|
||||
<?php } ?>
|
||||
|
||||
</div><!-- /.container-fluid -->
|
||||
</div> <!-- /.content -->
|
||||
</div> <!-- /.content-wrapper -->
|
||||
</div> <!-- ./wrapper -->
|
||||
|
||||
<!-- Set the browser window title to the clients name -->
|
||||
<script>document.title = <?php echo json_encode("$tab_title - $page_title"); ?>;</script>
|
||||
|
||||
<!-- REQUIRED SCRIPTS -->
|
||||
|
||||
<!-- Bootstrap 4 -->
|
||||
<script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Custom js-->
|
||||
<script src="../plugins/moment/moment.min.js"></script>
|
||||
<script src="../plugins/chart.js/Chart.min.js"></script>
|
||||
<script src="../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
|
||||
<script src='../plugins/daterangepicker/daterangepicker.js'></script>
|
||||
<script src='../plugins/select2/js/select2.min.js'></script>
|
||||
<script src='../plugins/inputmask/jquery.inputmask.min.js'></script>
|
||||
<script src="../plugins/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
|
||||
<script src="../plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js"></script>
|
||||
<script src="../plugins/clipboardjs/clipboard.min.js"></script>
|
||||
<script src="../js/keepalive.js"></script>
|
||||
<script src="../plugins/DataTables/datatables.min.js"></script>
|
||||
<script src="../plugins/intl-tel-input/js/intlTelInput.min.js"></script>
|
||||
|
||||
<!-- AdminLTE App -->
|
||||
<script src="../plugins/adminlte/js/adminlte.min.js"></script>
|
||||
<script src="../js/app.js"></script>
|
||||
<script src="../js/ajax_modal.js"></script>
|
||||
<script src="../js/confirm_modal.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
|
||||
// Calculate Execution time Uncomment for test
|
||||
|
||||
//$time_end = microtime(true);
|
||||
//$execution_time = ($time_end - $time_start);
|
||||
//echo '<h2>Total Execution Time: '.number_format((float) $execution_time, 10) .' seconds</h2>';
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
<?php
|
||||
|
||||
// Calculate Execution time start
|
||||
// uncomment for test
|
||||
// $time_start = microtime(true);
|
||||
|
||||
header("X-Frame-Options: DENY");
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="robots" content="noindex">
|
||||
|
||||
<title><?php echo $session_company_name; ?></title>
|
||||
|
||||
<!--
|
||||
Favicon
|
||||
If Fav Icon exists else use the default one
|
||||
-->
|
||||
<?php if(file_exists('../uploads/favicon.ico')) { ?>
|
||||
<link rel="icon" type="image/x-icon" href="/uploads/favicon.ico">
|
||||
<?php } ?>
|
||||
|
||||
<!-- Font Awesome Icons -->
|
||||
<link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css">
|
||||
|
||||
<!-- Custom Style Sheet -->
|
||||
<link href="../plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="../plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css" rel="stylesheet" type="text/css">
|
||||
<link href='../plugins/daterangepicker/daterangepicker.css' rel='stylesheet' />
|
||||
<link href="../plugins/toastr/toastr.min.css" rel="stylesheet">
|
||||
<link href="../plugins/DataTables/datatables.min.css" rel="stylesheet">
|
||||
<link href="../plugins/intl-tel-input/css/intlTelInput.min.css" rel="stylesheet">
|
||||
<!-- CSS to allow regular button to show as block button in mobile response view using the class btn-responsive -->
|
||||
<link href="../css/itflow_custom.css" rel="stylesheet">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="../plugins/adminlte/css/adminlte.min.css">
|
||||
<!-- jQuery -->
|
||||
<script src="../plugins/jquery/jquery.min.js"></script>
|
||||
<script src="../plugins/toastr/toastr.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body class="
|
||||
hold-transition sidebar-mini layout-fixed layout-navbar-fixed
|
||||
accent-<?php if (isset($_GET['client_id'])) { echo "blue"; } else { echo nullable_htmlentities($config_theme); } ?>
|
||||
<?php if ($config_theme_dark) { echo "dark-mode"; } ?>
|
||||
">
|
||||
<div class="wrapper text-sm">
|
||||
|
|
@ -7,7 +7,7 @@ require_once "../includes/page_title.php";
|
|||
if (!isset($session_is_admin) || !$session_is_admin) {
|
||||
exit(WORDING_ROLECHECK_FAILED . "<br>Tell your admin: Your role does not have admin access.");
|
||||
}
|
||||
require_once "includes/header.php";
|
||||
require_once "../includes/header.php";
|
||||
require_once "../includes/top_nav.php";
|
||||
require_once "includes/side_nav.php";
|
||||
require_once "../includes/inc_wrapper.php";
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
<script src="js/app.js"></script>
|
||||
<script src="plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js"></script>
|
||||
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
|
||||
// Return the title and content as a JSON response
|
||||
echo json_encode(['content' => $content]);
|
||||
?>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
|
||||
require_once "../../../config.php";
|
||||
require_once "../../../functions.php";
|
||||
require_once "../../../includes/check_login.php";
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// Check for the 'id' parameter
|
||||
//if (!isset($_GET['id'])) {
|
||||
// echo json_encode(['error' => 'ID missing.']);
|
||||
// exit;
|
||||
//}
|
||||
|
|
@ -1,354 +0,0 @@
|
|||
<!-- Main Sidebar Container -->
|
||||
<aside class="main-sidebar sidebar-dark-<?php if (isset($_GET['client_id'])) { echo "gray"; } else { echo nullable_htmlentities($config_theme); } ?> d-print-none">
|
||||
|
||||
<a class="brand-link pb-1 mt-1" href="clients.php">
|
||||
<p class="h5">
|
||||
<i class="nav-icon fas fa-arrow-left ml-3 mr-2"></i>
|
||||
<span class="brand-text">
|
||||
Back | <strong><?php echo $client_abbreviation; ?></strong>
|
||||
</span>
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav>
|
||||
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
|
||||
|
||||
<li class="nav-item mt-3">
|
||||
<a href="client_overview.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_overview.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-tachometer-alt"></i>
|
||||
<p>Overview</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="contacts.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "contacts.php" || basename($_SERVER["PHP_SELF"]) == "contact_details.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-address-book"></i>
|
||||
<p>
|
||||
Contacts
|
||||
<?php
|
||||
if ($num_contacts > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_contacts; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="locations.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "locations.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-map-marker-alt"></i>
|
||||
<p>
|
||||
Locations
|
||||
<?php
|
||||
if ($num_locations > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_locations; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if ($config_module_enable_ticketing == 1 && lookupUserPermission("module_support") >= 1) { ?>
|
||||
<li class="nav-header mt-3">SUPPORT</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="tickets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "tickets.php" || basename($_SERVER["PHP_SELF"]) == "ticket.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 badge-pill <?php } ?> text-light"><?php echo $num_active_tickets; ?></span>
|
||||
<?php } ?>
|
||||
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="recurring_tickets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "recurring_tickets.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-redo-alt"></i>
|
||||
<p>
|
||||
Recurring Tickets
|
||||
<?php
|
||||
if ($num_recurring_tickets) { ?>
|
||||
<span class="right badge"><?php echo $num_recurring_tickets; ?></span>
|
||||
<?php } ?>
|
||||
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="projects.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "projects.php" || basename($_SERVER["PHP_SELF"]) == "project_details.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-project-diagram"></i>
|
||||
<p>
|
||||
Projects
|
||||
<?php if ($num_active_projects) { ?>
|
||||
<span class="right badge text-light" data-toggle="tooltip" title="Open Projects"><?php echo $num_active_projects; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="vendors.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "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="calendar.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "calendar.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-calendar-alt"></i>
|
||||
<p>
|
||||
Calendar
|
||||
<?php
|
||||
if ($num_calendar_events > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_calendar_events; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if ($config_module_enable_itdoc == 1) { ?>
|
||||
|
||||
<li class="nav-header mt-3">DOCUMENTATION</li>
|
||||
|
||||
<?php if (lookupUserPermission("module_support") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="assets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "assets.php" || basename($_SERVER["PHP_SELF"]) == "client_asset_details.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-desktop"></i>
|
||||
<p>
|
||||
Assets
|
||||
<?php
|
||||
if ($num_assets > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_assets; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="software.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "software.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-cube"></i>
|
||||
<p>
|
||||
Licenses
|
||||
<?php
|
||||
if ($num_software > 0) { ?>
|
||||
<span class="right badge <?php if ($num_software_expiring > 0) { ?> badge-warning text-dark <?php } ?> <?php if ($num_software_expired > 0) { ?> badge-danger <?php } ?> text-white"><?php echo $num_software; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if (lookupUserPermission("module_credential") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="credentials.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "credentials.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-key"></i>
|
||||
<p>
|
||||
Credentials
|
||||
<?php
|
||||
if ($num_credentials > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_credentials; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="networks.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "networks.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-network-wired"></i>
|
||||
<p>
|
||||
Networks
|
||||
<?php
|
||||
if ($num_networks > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_networks; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="client_racks.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_racks.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-server"></i>
|
||||
<p>
|
||||
Racks
|
||||
<?php
|
||||
if ($num_racks > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_racks; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="certificates.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "certificates.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-lock"></i>
|
||||
<p>
|
||||
Certificates
|
||||
|
||||
<?php
|
||||
if ($num_certificates > 0) { ?>
|
||||
<span class="right badge <?php if ($num_certificates_expiring > 0) { ?> badge-warning text-dark <?php } ?> <?php if ($num_certificates_expired > 0) { ?> badge-danger badge-pill <?php } ?> text-white"><?php echo $num_certificates; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="domains.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "domains.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-globe"></i>
|
||||
<p>
|
||||
Domains
|
||||
|
||||
<?php
|
||||
if ($num_domains > 0) { ?>
|
||||
<span class="right badge <?php if (isset($num_domains_expiring)) { ?> badge-warning text-dark<?php } ?> <?php if (isset($num_domains_expired)) { ?> badge-danger badge-pill <?php } ?> text-white"><?php echo $num_domains; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="services.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "services.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-stream"></i>
|
||||
<p>
|
||||
Services
|
||||
<?php
|
||||
if ($num_services > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_services; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</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>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- Allow files even without module_support for things like contracts, etc. ) -->
|
||||
<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>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($config_module_enable_accounting == 1) { ?>
|
||||
|
||||
<li class="nav-header mt-3">BILLING</li>
|
||||
|
||||
<?php if (lookupUserPermission("module_sales") >= 1) { ?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="invoices.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "invoices.php" || basename($_SERVER["PHP_SELF"]) == "invoice.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-file-invoice"></i>
|
||||
<p>
|
||||
Invoices
|
||||
<?php
|
||||
if ($num_invoices > 0) { ?>
|
||||
<span class="right badge <?php if ($num_invoices_open > 0) { ?> badge-danger badge-pill <?php } ?> text-light"><?php echo $num_invoices; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="recurring_invoices.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "recurring_invoices.php" || basename($_SERVER["PHP_SELF"]) == "recurring_invoice.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-redo-alt"></i>
|
||||
<p>
|
||||
Recurring Invoices
|
||||
<?php
|
||||
if ($num_recurring_invoices) { ?>
|
||||
<span class="right badge"><?php echo $num_recurring_invoices; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="quotes.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "quotes.php" || basename($_SERVER["PHP_SELF"]) == "quote.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-comment-dollar"></i>
|
||||
<p>
|
||||
Quotes
|
||||
<?php
|
||||
if ($num_quotes > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_quotes; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if (lookupUserPermission("module_financial") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="payments.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "payments.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-credit-card"></i>
|
||||
<p>
|
||||
Payments
|
||||
<?php
|
||||
if ($num_payments > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_payments; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="trips.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "trips.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-route"></i>
|
||||
<p>
|
||||
Trips
|
||||
<?php
|
||||
if ($num_trips > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_trips; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
|
||||
<div class="mb-3"></div>
|
||||
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
// DB Connection
|
||||
|
||||
$mysqli = mysqli_connect($dbhost, $dbusername, $dbpassword, $database) or die('Database Connection Failed');
|
||||
|
||||
|
|
@ -3,7 +3,7 @@ require_once "../includes/inc_confirm_modal.php";
|
|||
?>
|
||||
|
||||
<?php
|
||||
if (str_contains(basename($_SERVER["PHP_SELF"]), "admin_")) { ?>
|
||||
if ($_SERVER['REQUEST_URI'] === '/admin') { ?>
|
||||
<p class="text-right font-weight-light">ITFlow <?php echo APP_VERSION ?> · <a target="_blank" href="https://docs.itflow.org">Docs</a> · <a target="_blank" href="https://forum.itflow.org">Forum</a> · <a target="_blank" href="https://services.itflow.org">Services</a></p>
|
||||
<br>
|
||||
<?php } ?>
|
||||
|
|
@ -22,24 +22,24 @@ if (str_contains(basename($_SERVER["PHP_SELF"]), "admin_")) { ?>
|
|||
<script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Custom js-->
|
||||
<script src="../plugins/moment/moment.min.js"></script>
|
||||
<script src="../plugins/chart.js/Chart.min.js"></script>
|
||||
<script src="../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
|
||||
<script src='../plugins/daterangepicker/daterangepicker.js'></script>
|
||||
<script src='../plugins/select2/js/select2.min.js'></script>
|
||||
<script src='../plugins/inputmask/jquery.inputmask.min.js'></script>
|
||||
<script src="../plugins/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
|
||||
<script src="../plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js"></script>
|
||||
<script src="../plugins/clipboardjs/clipboard.min.js"></script>
|
||||
<script src="../js/keepalive.js"></script>
|
||||
<script src="../plugins/DataTables/datatables.min.js"></script>
|
||||
<script src="../plugins/intl-tel-input/js/intlTelInput.min.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/moment/moment.min.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/chart.js/Chart.min.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/daterangepicker/daterangepicker.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/select2/js/select2.min.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/inputmask/jquery.inputmask.min.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/clipboardjs/clipboard.min.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../js/keepalive.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/DataTables/datatables.min.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/intl-tel-input/js/intlTelInput.min.js"></script>
|
||||
|
||||
<!-- AdminLTE App -->
|
||||
<script src="../plugins/adminlte/js/adminlte.min.js"></script>
|
||||
<script src="../js/app.js"></script>
|
||||
<script src="../js/ajax_modal.js"></script>
|
||||
<script src="../js/confirm_modal.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/adminlte/js/adminlte.min.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../js/app.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../js/ajax_modal.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../js/confirm_modal.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,13 @@
|
|||
|
||||
header("X-Frame-Options: DENY");
|
||||
|
||||
// Determine URI prepending logic (URI Routing maybe move to /includes/router.php)
|
||||
if ($_SERVER['REQUEST_URI'] === '/user/reports') {
|
||||
$prepend_uri = "../";
|
||||
} else {
|
||||
$prepend_uri = '';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
|
@ -18,37 +25,33 @@ header("X-Frame-Options: DENY");
|
|||
|
||||
<title><?php echo $session_company_name; ?></title>
|
||||
|
||||
<!--
|
||||
Favicon
|
||||
If Fav Icon exists else use the default one
|
||||
-->
|
||||
<?php if(file_exists('../uploads/favicon.ico')) { ?>
|
||||
<link rel="icon" type="image/x-icon" href="..//uploads/favicon.ico">
|
||||
<?php } ?>
|
||||
|
||||
<!-- Font Awesome Icons -->
|
||||
<link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css">
|
||||
<!-- Favicon -->
|
||||
<?php if(file_exists($prepend_uri . '../uploads/favicon.ico')): ?>
|
||||
<link rel="icon" type="image/x-icon" href="<?= $prepend_uri ?>../uploads/favicon.ico">
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Custom Style Sheet -->
|
||||
<link href="../plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="../plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css" rel="stylesheet" type="text/css">
|
||||
<link href='../plugins/daterangepicker/daterangepicker.css' rel='stylesheet' />
|
||||
<link href="../plugins/toastr/toastr.min.css" rel="stylesheet">
|
||||
<link href="../plugins/DataTables/datatables.min.css" rel="stylesheet">
|
||||
<link href="../plugins/intl-tel-input/css/intlTelInput.min.css" rel="stylesheet">
|
||||
<!-- CSS to allow regular button to show as block button in mobile response view using the class btn-responsive -->
|
||||
<link href="../css/itflow_custom.css" rel="stylesheet">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="../plugins/adminlte/css/adminlte.min.css">
|
||||
<!-- jQuery -->
|
||||
<script src="../plugins/jquery/jquery.min.js"></script>
|
||||
<script src="../plugins/toastr/toastr.min.js"></script>
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="<?= $prepend_uri ?>../plugins/fontawesome-free/css/all.min.css">
|
||||
|
||||
<!-- Custom Styles -->
|
||||
<link href="<?= $prepend_uri ?>../plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="<?= $prepend_uri ?>../plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="<?= $prepend_uri ?>../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="<?= $prepend_uri ?>../plugins/daterangepicker/daterangepicker.css" rel="stylesheet">
|
||||
<link href="<?= $prepend_uri ?>../plugins/toastr/toastr.min.css" rel="stylesheet">
|
||||
<link href="<?= $prepend_uri ?>../plugins/DataTables/datatables.min.css" rel="stylesheet">
|
||||
<link href="<?= $prepend_uri ?>../plugins/intl-tel-input/css/intlTelInput.min.css" rel="stylesheet">
|
||||
<link href="<?= $prepend_uri ?>../css/itflow_custom.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= $prepend_uri ?>../plugins/adminlte/css/adminlte.min.css">
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="<?= $prepend_uri ?>../plugins/jquery/jquery.min.js"></script>
|
||||
<script src="<?= $prepend_uri ?>../plugins/toastr/toastr.min.js"></script>
|
||||
</head>
|
||||
<body class="
|
||||
hold-transition sidebar-mini layout-fixed layout-navbar-fixed
|
||||
accent-<?php if (isset($_GET['client_id'])) { echo "blue"; } else { echo nullable_htmlentities($config_theme); } ?>
|
||||
<?php if ($config_theme_dark) { echo "dark-mode"; } ?>
|
||||
accent-<?php echo isset($_GET['client_id']) ? 'blue' : nullable_htmlentities($config_theme); ?>
|
||||
<?php if ($config_theme_dark) echo 'dark-mode'; ?>
|
||||
">
|
||||
<div class="wrapper text-sm">
|
||||
|
||||
|
|
|
|||
|
|
@ -1,316 +0,0 @@
|
|||
<?php
|
||||
|
||||
require_once "config.php";
|
||||
require_once "functions.php";
|
||||
require_once "check_login.php";
|
||||
require_once "page_title.php";
|
||||
|
||||
// Perms
|
||||
enforceUserPermission('module_client');
|
||||
|
||||
if (isset($_GET['client_id'])) {
|
||||
$client_id = intval($_GET['client_id']);
|
||||
|
||||
// Client Access Check
|
||||
// Ensure the user has permission to access this client (admins ignored)
|
||||
if (!in_array($client_id, $client_access_array) AND !empty($client_access_string) AND !$session_is_admin) {
|
||||
// Logging
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Client', log_action = 'Access', log_description = '$session_name was denied permission from accessing client', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $client_id");
|
||||
|
||||
$_SESSION['alert_type'] = "error";
|
||||
$_SESSION['alert_message'] = "Access Denied - You do not have permission to access that client!";
|
||||
|
||||
echo "<script>window.history.back();</script>";
|
||||
exit();
|
||||
}
|
||||
|
||||
$sql = mysqli_query($mysqli, "UPDATE clients SET client_accessed_at = NOW() WHERE client_id = $client_id");
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM clients
|
||||
LEFT JOIN locations ON clients.client_id = locations.location_client_id AND location_primary = 1
|
||||
LEFT JOIN contacts ON clients.client_id = contacts.contact_client_id AND contact_primary = 1
|
||||
WHERE client_id = $client_id"
|
||||
);
|
||||
|
||||
if (mysqli_num_rows($sql) == 0) {
|
||||
require_once "header.php";
|
||||
|
||||
echo "<center><h1 class='text-secondary mt-5'>Nothing to see here</h1></center>";
|
||||
} else {
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$client_is_lead = intval($row['client_lead']);
|
||||
$client_type = nullable_htmlentities($row['client_type']);
|
||||
$client_website = nullable_htmlentities($row['client_website']);
|
||||
$client_referral = nullable_htmlentities($row['client_referral']);
|
||||
$client_currency_code = nullable_htmlentities($row['client_currency_code']);
|
||||
$client_net_terms = intval($row['client_net_terms']);
|
||||
if ($client_net_terms == 0) {
|
||||
$client_net_terms = $config_default_net_terms;
|
||||
}
|
||||
$client_tax_id_number = nullable_htmlentities($row['client_tax_id_number']);
|
||||
$client_abbreviation = nullable_htmlentities($row['client_abbreviation']);
|
||||
$client_rate = floatval($row['client_rate']);
|
||||
$client_notes = nullable_htmlentities($row['client_notes']);
|
||||
$client_created_at = nullable_htmlentities($row['client_created_at']);
|
||||
$client_archived_at = nullable_htmlentities($row['client_archived_at']);
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$contact_title = nullable_htmlentities($row['contact_title']);
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
$contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']);
|
||||
$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code));
|
||||
$contact_extension = nullable_htmlentities($row['contact_extension']);
|
||||
$contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']);
|
||||
$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code));
|
||||
$contact_primary = intval($row['contact_primary']);
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
$location_address = nullable_htmlentities($row['location_address']);
|
||||
$location_city = nullable_htmlentities($row['location_city']);
|
||||
$location_state = nullable_htmlentities($row['location_state']);
|
||||
$location_zip = nullable_htmlentities($row['location_zip']);
|
||||
$location_country = nullable_htmlentities($row['location_country']);
|
||||
$location_phone_country_code = nullable_htmlentities($row['location_phone_country_code']);
|
||||
$location_phone = nullable_htmlentities(formatPhoneNumber($row['location_phone'], $location_phone_country_code));
|
||||
$location_primary = intval($row['location_primary']);
|
||||
|
||||
// Tab Title // No Sanitizing needed
|
||||
$tab_title = $row['client_name'];
|
||||
|
||||
// Client Tags
|
||||
|
||||
$client_tag_name_display_array = array();
|
||||
$client_tag_id_array = array();
|
||||
$sql_client_tags = mysqli_query($mysqli, "SELECT * FROM client_tags LEFT JOIN tags ON client_tags.tag_id = tags.tag_id WHERE client_id = $client_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_client_tags)) {
|
||||
|
||||
$client_tag_id = intval($row['tag_id']);
|
||||
$client_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
$client_tag_color = nullable_htmlentities($row['tag_color']);
|
||||
if (empty($client_tag_color)) {
|
||||
$client_tag_color = "dark";
|
||||
}
|
||||
$client_tag_icon = nullable_htmlentities($row['tag_icon']);
|
||||
if (empty($client_tag_icon)) {
|
||||
$client_tag_icon = "tag";
|
||||
}
|
||||
|
||||
$client_tag_id_array[] = $client_tag_id;
|
||||
$client_tag_name_display_array[] = "<span class='badge text-light p-1 mr-1' style='background-color: $client_tag_color;'><i class='fa fa-fw fa-$client_tag_icon mr-2'></i>$client_tag_name</span>";
|
||||
}
|
||||
$client_tags_display = implode('', $client_tag_name_display_array);
|
||||
|
||||
//Add up all the payments for the invoice and get the total amount paid to the invoice
|
||||
$sql_invoice_amounts = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_amounts FROM invoices WHERE invoice_client_id = $client_id AND invoice_status != 'Draft' AND invoice_status != 'Cancelled' AND invoice_status != 'Non-Billable'");
|
||||
$row = mysqli_fetch_array($sql_invoice_amounts);
|
||||
|
||||
$invoice_amounts = floatval($row['invoice_amounts']);
|
||||
|
||||
$sql_amount_paid = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS amount_paid FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_client_id = $client_id");
|
||||
$row = mysqli_fetch_array($sql_amount_paid);
|
||||
|
||||
$amount_paid = floatval($row['amount_paid']);
|
||||
|
||||
$balance = $invoice_amounts - $amount_paid;
|
||||
|
||||
//Get Monthly Recurring Total
|
||||
$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_invoice_amount) AS recurring_monthly_total FROM recurring_invoices WHERE recurring_invoice_status = 1 AND recurring_invoice_frequency = 'month' AND recurring_invoice_client_id = $client_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_monthly_total);
|
||||
|
||||
$recurring_monthly_total = floatval($row['recurring_monthly_total']);
|
||||
|
||||
//Get Yearly Recurring Total
|
||||
$sql_recurring_yearly_total = mysqli_query($mysqli, "SELECT SUM(recurring_invoice_amount) AS recurring_yearly_total FROM recurring_invoices WHERE recurring_invoice_status = 1 AND recurring_invoice_frequency = 'year' AND recurring_invoice_client_id = $client_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_yearly_total);
|
||||
|
||||
$recurring_yearly_total = floatval($row['recurring_yearly_total']) / 12;
|
||||
|
||||
$recurring_monthly = $recurring_monthly_total + $recurring_yearly_total;
|
||||
|
||||
// Get Credit Balance
|
||||
$sql_credit_balance = mysqli_query($mysqli, "SELECT SUM(credit_amount) AS credit_balance FROM credits WHERE credit_client_id = $client_id");
|
||||
$row = mysqli_fetch_array($sql_credit_balance);
|
||||
|
||||
$credit_balance = floatval($row['credit_balance']);
|
||||
|
||||
// Badge Counts
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('contact_id') AS num FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id"));
|
||||
$num_contacts = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('location_id') AS num FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id"));
|
||||
$num_locations = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('asset_id') AS num FROM assets WHERE asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
||||
$num_assets = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id') AS num FROM tickets WHERE ticket_archived_at IS NULL AND ticket_closed_at IS NULL AND ticket_status != 4 AND ticket_client_id = $client_id"));
|
||||
$num_active_tickets = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id') AS num FROM tickets WHERE ticket_archived_at IS NULL AND ticket_closed_at IS NOT NULL AND ticket_client_id = $client_id"));
|
||||
$num_closed_tickets = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('recurring_ticket_id') AS num FROM recurring_tickets WHERE recurring_ticket_client_id = $client_id"));
|
||||
$num_recurring_tickets = $row['num'];
|
||||
|
||||
// Active Project Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('project_id') AS num FROM projects WHERE project_archived_at IS NULL AND project_completed_at IS NULL AND project_client_id = $client_id"));
|
||||
$num_active_projects = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('service_id') AS num FROM services WHERE service_client_id = $client_id"));
|
||||
$num_services = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('vendor_id') AS num FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id"));
|
||||
$num_vendors = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('credential_id') AS num FROM credentials WHERE credential_archived_at IS NULL AND credential_client_id = $client_id"));
|
||||
$num_credentials = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('network_id') AS num FROM networks WHERE network_archived_at IS NULL AND network_client_id = $client_id"));
|
||||
$num_networks = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('rack_id') AS num FROM racks WHERE rack_archived_at IS NULL AND rack_client_id = $client_id"));
|
||||
$num_racks = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('domain_id') AS num FROM domains WHERE domain_archived_at IS NULL AND domain_client_id = $client_id"));
|
||||
$num_domains = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('certificate_id') AS num FROM certificates WHERE certificate_archived_at IS NULL AND certificate_client_id = $client_id"));
|
||||
$num_certificates = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('software_id') AS num FROM software WHERE software_archived_at IS NULL AND software_client_id = $client_id"));
|
||||
$num_software = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE (invoice_status = 'Sent' OR invoice_status = 'Viewed' OR invoice_status = 'Partial') AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_open = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Draft' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_draft = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Sent' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_sent = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Viewed' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_viewed = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Partial' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_partial = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Paid' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_paid = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('quote_id') AS num FROM quotes WHERE quote_archived_at IS NULL AND quote_client_id = $client_id"));
|
||||
$num_quotes = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('recurring_invoice_id') AS num FROM recurring_invoices WHERE recurring_invoice_archived_at IS NULL AND recurring_invoice_client_id = $client_id"));
|
||||
$num_recurring_invoices = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('payment_id') AS num FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_client_id = $client_id"));
|
||||
$num_payments = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('file_id') AS num FROM files WHERE file_archived_at IS NULL AND file_client_id = $client_id"));
|
||||
$num_files = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('document_id') AS num FROM documents WHERE document_archived_at IS NULL AND document_client_id = $client_id"));
|
||||
$num_documents = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('event_id') AS num FROM calendar_events WHERE event_client_id = $client_id"));
|
||||
$num_calendar_events = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('trip_id') AS num FROM trips WHERE trip_archived_at IS NULL AND trip_client_id = $client_id"));
|
||||
$num_trips = $row['num'];
|
||||
|
||||
// Expiring Items
|
||||
|
||||
// Count Domains Expiring within 45 Days
|
||||
$row = mysqli_fetch_assoc(mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT COUNT('domain_id') AS num FROM domains
|
||||
WHERE domain_client_id = $client_id
|
||||
AND domain_expire IS NOT NULL
|
||||
AND domain_expire < CURRENT_DATE + INTERVAL 45 DAY
|
||||
AND domain_archived_at IS NULL"
|
||||
));
|
||||
$num_domains_expiring_warning= intval($row['num']);
|
||||
|
||||
// Count Domains Expired or within 7 days
|
||||
$row = mysqli_fetch_assoc(mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT COUNT('domain_id') AS num FROM domains
|
||||
WHERE domain_client_id = $client_id
|
||||
AND domain_expire IS NOT NULL
|
||||
AND (
|
||||
domain_expire < CURRENT_DATE
|
||||
OR domain_expire < CURRENT_DATE + INTERVAL 7 DAY
|
||||
)
|
||||
AND domain_archived_at IS NULL"
|
||||
));
|
||||
$num_domains_urgent = intval($row['num']);
|
||||
|
||||
// Count Certificates Expiring within 7 Days
|
||||
$row = mysqli_fetch_assoc(mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT COUNT('certificate_id') AS num FROM certificates
|
||||
WHERE certificate_client_id = $client_id
|
||||
AND certificate_expire IS NOT NULL
|
||||
AND certificate_expire < CURRENT_DATE + INTERVAL 7 DAY
|
||||
AND certificate_archived_at IS NULL"
|
||||
));
|
||||
$num_certificates_expiring = intval($row['num']);
|
||||
|
||||
// Count Certificates Expired or within 7 days
|
||||
$row = mysqli_fetch_assoc(mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT COUNT('certificate_id') AS num FROM certificates
|
||||
WHERE certificate_client_id = $client_id
|
||||
AND certificate_expire IS NOT NULL
|
||||
AND (
|
||||
certificate_expire < CURRENT_DATE
|
||||
OR certificate_expire < CURRENT_DATE + INTERVAL 1 DAY
|
||||
)
|
||||
AND certificate_archived_at IS NULL"
|
||||
));
|
||||
$num_certificates_expired = intval($row['num']);
|
||||
|
||||
// Count Software Expiring within 90 Days
|
||||
$row = mysqli_fetch_assoc(mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT COUNT('software_id') AS num FROM software
|
||||
WHERE software_client_id = $client_id
|
||||
AND software_expire IS NOT NULL
|
||||
AND software_expire < CURRENT_DATE + INTERVAL 45 DAY
|
||||
AND software_archived_at IS NULL"
|
||||
));
|
||||
$num_software_expiring = intval($row['num']);
|
||||
|
||||
// Count Software Expired or within 14 days
|
||||
$row = mysqli_fetch_assoc(mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT COUNT('software_id') AS num FROM software
|
||||
WHERE software_client_id = $client_id
|
||||
AND software_expire IS NOT NULL
|
||||
AND (
|
||||
software_expire < CURRENT_DATE
|
||||
OR software_expire < CURRENT_DATE + INTERVAL 7 DAY
|
||||
)
|
||||
AND software_archived_at IS NULL"
|
||||
));
|
||||
$num_software_expired = intval($row['num']);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
require_once "header.php";
|
||||
require_once "top_nav.php";
|
||||
require_once "client_side_nav.php";
|
||||
require_once "inc_wrapper.php";
|
||||
require_once "inc_alert_feedback.php";
|
||||
require_once "inc_client_top_head.php";
|
||||
require_once "filter_header.php";
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
|
||||
require_once "config.php";
|
||||
require_once "functions.php";
|
||||
require_once "check_login.php";
|
||||
require_once "page_title.php";
|
||||
require_once "header.php";
|
||||
require_once "top_nav.php";
|
||||
require_once "user_side_nav.php";
|
||||
require_once "inc_wrapper.php";
|
||||
require_once "inc_alert_feedback.php";
|
||||
require_once "filter_header.php";
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
|
||||
require_once "config.php";
|
||||
require_once "functions.php";
|
||||
require_once "check_login.php";
|
||||
require_once "page_title.php";
|
||||
require_once "header.php";
|
||||
require_once "top_nav.php";
|
||||
require_once "client_overview_side_nav.php";
|
||||
require_once "inc_wrapper.php";
|
||||
require_once "inc_alert_feedback.php";
|
||||
require_once "filter_header.php";
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
|
||||
require_once "../config.php";
|
||||
require_once "../functions.php";
|
||||
require_once "check_login.php";
|
||||
require_once "page_title.php";
|
||||
require_once "header.php";
|
||||
require_once "top_nav.php";
|
||||
require_once "get_side_nav_counts.php";
|
||||
require_once "side_nav.php";
|
||||
require_once "inc_wrapper.php";
|
||||
require_once "inc_alert_feedback.php";
|
||||
require_once "filter_header.php";
|
||||
|
|
@ -6,7 +6,7 @@ require_once "../includes/check_login.php";
|
|||
require_once "../includes/page_title.php";
|
||||
require_once "../includes/header.php";
|
||||
require_once "../includes/top_nav.php";
|
||||
require_once "../includes/get_side_nav_counts.php";
|
||||
require_once "includes/get_side_nav_counts.php";
|
||||
require_once "includes/side_nav.php";
|
||||
require_once "../includes/inc_wrapper.php";
|
||||
require_once "../includes/inc_alert_feedback.php";
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
require_once "config.php";
|
||||
require_once "functions.php";
|
||||
require_once "check_login.php";
|
||||
require_once "page_title.php";
|
||||
require_once "../config.php";
|
||||
require_once "../functions.php";
|
||||
require_once "../includes/check_login.php";
|
||||
require_once "../includes/page_title.php";
|
||||
|
||||
// Perms
|
||||
enforceUserPermission('module_client');
|
||||
|
|
@ -35,7 +35,7 @@ if (isset($_GET['client_id'])) {
|
|||
);
|
||||
|
||||
if (mysqli_num_rows($sql) == 0) {
|
||||
require_once "header.php";
|
||||
require_once "../includes/header.php";
|
||||
|
||||
echo "<center><h1 class='text-secondary mt-5'>Nothing to see here</h1></center>";
|
||||
} else {
|
||||
|
|
@ -307,10 +307,10 @@ if (isset($_GET['client_id'])) {
|
|||
}
|
||||
}
|
||||
|
||||
require_once "header.php";
|
||||
require_once "top_nav.php";
|
||||
require_once "client_side_nav.php";
|
||||
require_once "inc_wrapper.php";
|
||||
require_once "inc_alert_feedback.php";
|
||||
require_once "inc_client_top_head.php";
|
||||
require_once "filter_header.php";
|
||||
require_once "../includes/header.php";
|
||||
require_once "../includes/top_nav.php";
|
||||
require_once "includes/side_nav.php";
|
||||
require_once "../includes/inc_wrapper.php";
|
||||
require_once "../includes/inc_alert_feedback.php";
|
||||
require_once "includes/inc_client_top_head.php";
|
||||
require_once "../includes/filter_header.php";
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
<?php
|
||||
|
||||
require_once "config.php";
|
||||
require_once "functions.php";
|
||||
require_once "check_login.php";
|
||||
require_once "page_title.php";
|
||||
require_once "header.php";
|
||||
require_once "top_nav.php";
|
||||
require_once "user_side_nav.php";
|
||||
require_once "inc_wrapper.php";
|
||||
require_once "inc_alert_feedback.php";
|
||||
require_once "filter_header.php";
|
||||
require_once "../config.php";
|
||||
require_once "../functions.php";
|
||||
require_once "../includes/check_login.php";
|
||||
require_once "../includes/page_title.php";
|
||||
require_once "../includes/header.php";
|
||||
require_once "../includes/top_nav.php";
|
||||
require_once "includes/user_side_nav.php";
|
||||
require_once "../includes/inc_wrapper.php";
|
||||
require_once "../includes/inc_alert_feedback.php";
|
||||
require_once "../includes/filter_header.php";
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
require_once "../config.php";
|
||||
require_once "../functions.php";
|
||||
require_once "../includes/check_login.php";
|
||||
require_once "../includes/page_title.php";
|
||||
require_once "../includes/header.php";
|
||||
require_once "../includes/top_nav.php";
|
||||
require_once "includes/client_overview_side_nav.php";
|
||||
require_once "../includes/inc_wrapper.php";
|
||||
require_once "../includes/inc_alert_feedback.php";
|
||||
require_once "../includes/filter_header.php";
|
||||
|
||||
|
|
@ -174,6 +174,6 @@
|
|||
</div>
|
||||
|
||||
<?php
|
||||
require_once "modals/client_credit_add_modal.php";
|
||||
require_once "modals/client_delete_modal.php";
|
||||
require_once "modals/client_download_pdf_modal.php";
|
||||
require_once "modals/client/client_credit_add.php";
|
||||
require_once "modals/client/client_delete.php";
|
||||
require_once "modals/client/client_download_pdf.php";
|
||||
|
|
@ -17,4 +17,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/client_delete_confirm.js"></script>
|
||||
<script src="../js/client_delete_confirm.js"></script>
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
<?php
|
||||
require_once "../includes/inc_confirm_modal.php";
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (str_contains(basename($_SERVER["PHP_SELF"]), "admin_")) { ?>
|
||||
<p class="text-right font-weight-light">ITFlow <?php echo APP_VERSION ?> · <a target="_blank" href="https://docs.itflow.org">Docs</a> · <a target="_blank" href="https://forum.itflow.org">Forum</a> · <a target="_blank" href="https://services.itflow.org">Services</a></p>
|
||||
<br>
|
||||
<?php } ?>
|
||||
|
||||
</div><!-- /.container-fluid -->
|
||||
</div> <!-- /.content -->
|
||||
</div> <!-- /.content-wrapper -->
|
||||
</div> <!-- ./wrapper -->
|
||||
|
||||
<!-- Set the browser window title to the clients name -->
|
||||
<script>document.title = <?php echo json_encode("$tab_title - $page_title"); ?>;</script>
|
||||
|
||||
<!-- REQUIRED SCRIPTS -->
|
||||
|
||||
<!-- Bootstrap 4 -->
|
||||
<script src="../../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Custom js-->
|
||||
<script src="../../plugins/moment/moment.min.js"></script>
|
||||
<script src="../../plugins/chart.js/Chart.min.js"></script>
|
||||
<script src="../../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
|
||||
<script src='../../plugins/daterangepicker/daterangepicker.js'></script>
|
||||
<script src='../../plugins/select2/js/select2.min.js'></script>
|
||||
<script src='../../plugins/inputmask/jquery.inputmask.min.js'></script>
|
||||
<script src="../../plugins/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
|
||||
<script src="../../plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js"></script>
|
||||
<script src="../../plugins/clipboardjs/clipboard.min.js"></script>
|
||||
<script src="../../js/keepalive.js"></script>
|
||||
<script src="../../plugins/DataTables/datatables.min.js"></script>
|
||||
<script src="../../plugins/intl-tel-input/js/intlTelInput.min.js"></script>
|
||||
|
||||
<!-- AdminLTE App -->
|
||||
<script src="../../plugins/adminlte/js/adminlte.min.js"></script>
|
||||
<script src="../../js/app.js"></script>
|
||||
<script src="../../js/ajax_modal.js"></script>
|
||||
<script src="../../js/confirm_modal.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
|
||||
// Calculate Execution time Uncomment for test
|
||||
|
||||
//$time_end = microtime(true);
|
||||
//$execution_time = ($time_end - $time_start);
|
||||
//echo '<h2>Total Execution Time: '.number_format((float) $execution_time, 10) .' seconds</h2>';
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
<?php
|
||||
|
||||
// Calculate Execution time start
|
||||
// uncomment for test
|
||||
// $time_start = microtime(true);
|
||||
|
||||
header("X-Frame-Options: DENY");
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="robots" content="noindex">
|
||||
|
||||
<title><?php echo $session_company_name; ?></title>
|
||||
|
||||
<!--
|
||||
Favicon
|
||||
If Fav Icon exists else use the default one
|
||||
-->
|
||||
<?php if(file_exists('../../uploads/favicon.ico')) { ?>
|
||||
<link rel="icon" type="image/x-icon" href="/uploads/favicon.ico">
|
||||
<?php } ?>
|
||||
|
||||
<!-- Font Awesome Icons -->
|
||||
<link rel="stylesheet" href="../../plugins/fontawesome-free/css/all.min.css">
|
||||
|
||||
<!-- Custom Style Sheet -->
|
||||
<link href="../../plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="../../plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="../../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css" rel="stylesheet" type="text/css">
|
||||
<link href='../../plugins/daterangepicker/daterangepicker.css' rel='stylesheet' />
|
||||
<link href="../../plugins/toastr/toastr.min.css" rel="stylesheet">
|
||||
<link href="../../plugins/DataTables/datatables.min.css" rel="stylesheet">
|
||||
<link href="../../plugins/intl-tel-input/css/intlTelInput.min.css" rel="stylesheet">
|
||||
<!-- CSS to allow regular button to show as block button in mobile response view using the class btn-responsive -->
|
||||
<link href="../../css/itflow_custom.css" rel="stylesheet">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="../../plugins/adminlte/css/adminlte.min.css">
|
||||
<!-- jQuery -->
|
||||
<script src="../../plugins/jquery/jquery.min.js"></script>
|
||||
<script src="../../plugins/toastr/toastr.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body class="
|
||||
hold-transition sidebar-mini layout-fixed layout-navbar-fixed
|
||||
accent-<?php if (isset($_GET['client_id'])) { echo "blue"; } else { echo nullable_htmlentities($config_theme); } ?>
|
||||
<?php if ($config_theme_dark) { echo "dark-mode"; } ?>
|
||||
">
|
||||
<div class="wrapper text-sm">
|
||||
|
|
@ -6,7 +6,7 @@ require_once "../../includes/check_login.php";
|
|||
require_once "../../includes/page_title.php";
|
||||
// Reporting Perms
|
||||
enforceUserPermission('module_reporting');
|
||||
require_once "includes/header.php";
|
||||
require_once "../../includes/header.php";
|
||||
require_once "../../includes/top_nav.php";
|
||||
require_once "includes/side_nav.php";
|
||||
require_once "../../includes/inc_wrapper.php";
|
||||
|
|
|
|||
|
|
@ -283,12 +283,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<?php require_once "../../includes/filter_footer.php";
|
||||
<?php require_once "../includes/filter_footer.php";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="js/bulk_actions.js"></script>
|
||||
<script src="../js/bulk_actions.js"></script>
|
||||
|
||||
<?php
|
||||
require_once "modals/vendor_add_modal.php";
|
||||
|
|
|
|||
Loading…
Reference in New Issue