Merge branch 'master' into stage
# Conflicts: # guest/guest_post.php
This commit is contained in:
@@ -1,275 +0,0 @@
|
||||
<!-- Main Sidebar Container -->
|
||||
<aside class="main-sidebar sidebar-dark-<?php echo nullable_htmlentities($config_theme); ?> d-print-none">
|
||||
<a class="brand-link pb-1 mt-1" href="clients.php">
|
||||
<p class="h6">
|
||||
<i class="nav-icon fas fa-arrow-left ml-3 mr-2"></i>
|
||||
<span class="brand-text">
|
||||
Back | <strong>Administration</strong>
|
||||
</span>
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
<!-- Sidebar Menu -->
|
||||
<nav>
|
||||
<ul class="nav nav-pills nav-sidebar flex-column mt-2" data-widget="treeview" data-accordion="false">
|
||||
<!-- ACCESS Section -->
|
||||
<li class="nav-item">
|
||||
<a href="admin_user.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "admin_user.php") {echo "active";} ?>">
|
||||
<i class="nav-icon fas fa-users"></i>
|
||||
<p>Users</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_role.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "admin_role.php") {echo "active";} ?>">
|
||||
<i class="nav-icon fas fa-user-shield"></i>
|
||||
<p>Roles</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_api.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "admin_api.php") {echo "active";} ?>">
|
||||
<i class="nav-icon fas fa-key"></i>
|
||||
<p>API Keys</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-header">TAGS & CATEGORIES</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="admin_tag.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_tag.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-tags"></i>
|
||||
<p>Tags</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_category.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_category.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-list-ul"></i>
|
||||
<p>Categories</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php if ($config_module_enable_accounting) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="admin_tax.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_tax.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-balance-scale"></i>
|
||||
<p>Taxes</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if ($config_module_enable_ticketing) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="admin_ticket_status.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_ticket_status.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-info-circle"></i>
|
||||
<p>Ticket Statuses</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="nav-item">
|
||||
<a href="admin_custom_link.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_custom_link.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-external-link-alt"></i>
|
||||
<p>Custom Links</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if ($config_module_enable_itdoc) { ?>
|
||||
<li class="nav-header">TEMPLATES</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="admin_project_template.php" class="nav-link <?php echo (in_array(basename($_SERVER['PHP_SELF']), ['admin_project_template.php', 'admin_project_template_details.php']) ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-project-diagram"></i>
|
||||
<p>Project Templates</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_ticket_template.php" class="nav-link <?php echo (in_array(basename($_SERVER['PHP_SELF']), ['admin_ticket_template.php', 'admin_ticket_template_details.php']) ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-life-ring"></i>
|
||||
<p>Ticket Templates</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_vendor_template.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_vendor_template.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-building"></i>
|
||||
<p>Vendor Templates</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_software_template.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_software_template.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-rocket"></i>
|
||||
<p>License Templates</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_document_template.php" class="nav-link <?php echo (in_array(basename($_SERVER['PHP_SELF']), ['admin_document_template.php', 'admin_document_template_details.php']) ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-file"></i>
|
||||
<p>Document Templates</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<li class="nav-header">MAINTENANCE</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="admin_mail_queue.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_mail_queue.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-mail-bulk"></i>
|
||||
<p>Mail Queue</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_audit_log.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_audit_log.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-history"></i>
|
||||
<p>Audit Logs</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_app_log.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_app_log.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-history"></i>
|
||||
<p>App Logs</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_backup.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_backup.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-cloud-upload-alt"></i>
|
||||
<p>Backup</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_debug.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_debug.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-bug"></i>
|
||||
<p>Debug</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_update.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_update.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-download"></i>
|
||||
<p>Update</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- SETTINGS Section -->
|
||||
<li class="nav-item has-treeview mt-2 <?php echo (in_array(basename($_SERVER['PHP_SELF']), ['admin_settings_company.php', 'admin_settings_localization.php', 'admin_settings_theme.php', 'admin_settings_security.php', 'admin_settings_mail.php', 'admin_settings_notification.php', 'admin_settings_default.php', 'admin_settings_invoice.php', 'admin_settings_quote.php', 'admin_settings_online_payment.php', 'admin_settings_online_payment_clients.php', 'admin_settings_project.php', 'admin_settings_ticket.php', 'admin_settings_ai.php', 'admin_identity_provider.php', 'admin_settings_telemetry.php', 'admin_settings_module.php']) ? 'menu-open' : ''); ?>">
|
||||
<a href="#" class="nav-link">
|
||||
<p>
|
||||
SETTINGS
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview">
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_company.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_company.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fa fa-briefcase"></i>
|
||||
<p>Company Details</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_localization.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_localization.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fa fa-globe"></i>
|
||||
<p>Localization</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_theme.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_theme.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fa fa-paint-brush"></i>
|
||||
<p>Theme</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_security.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_security.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-shield-alt"></i>
|
||||
<p>Security</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_mail.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_mail.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon far fa-envelope"></i>
|
||||
<p>Mail</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_notification.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_notification.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon far fa-bell"></i>
|
||||
<p>Notifications</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_default.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_default.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-cogs"></i>
|
||||
<p>Defaults</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php if ($config_module_enable_accounting) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_invoice.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_invoice.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-file-invoice"></i>
|
||||
<p>Invoice</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_quote.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_quote.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-comment-dollar"></i>
|
||||
<p>Quote</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_online_payment.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_online_payment.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon far fa-credit-card"></i>
|
||||
<p>Online Payment</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php if ($config_stripe_enable) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_online_payment_clients.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_online_payment_clients.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon far fa-credit-card"></i>
|
||||
<p>Payment/Stripe Clients</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ($config_module_enable_ticketing) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_project.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_project.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-project-diagram"></i>
|
||||
<p>Project</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_ticket.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_ticket.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-life-ring"></i>
|
||||
<p>Ticket</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_ai.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_ai.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-robot"></i>
|
||||
<p>AI</p>
|
||||
</a>
|
||||
</li>
|
||||
<!-- Currently the only integration is the client portal SSO -->
|
||||
<?php if ($config_client_portal_enable) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="admin_identity_provider.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_identity_provider.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-fingerprint"></i>
|
||||
<p>Identity Provider</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_telemetry.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_telemetry.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-satellite-dish"></i>
|
||||
<p>Telemetry</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="admin_settings_module.php" class="nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'admin_settings_module.php' ? 'active' : ''); ?>">
|
||||
<i class="nav-icon fas fa-cube"></i>
|
||||
<p>Modules</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
<div class="mb-3"></div>
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once "../config.php";
|
||||
require_once "../functions.php";
|
||||
require_once "check_login.php";
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// Check for the 'id' parameter
|
||||
//if (!isset($_GET['id'])) {
|
||||
// echo json_encode(['error' => 'ID missing.']);
|
||||
// exit;
|
||||
//}
|
||||
@@ -5,4 +5,4 @@
|
||||
* Update this file each time we merge develop into master. Format is YY.MM (add a .v if there is more than one release a month.
|
||||
*/
|
||||
|
||||
DEFINE("APP_VERSION", "25.06");
|
||||
DEFINE("APP_VERSION", "25.10.1");
|
||||
|
||||
11
includes/auth_check.php
Normal file
11
includes/auth_check.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
// Check user is logged in with a valid session
|
||||
if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {
|
||||
if ($_SERVER["REQUEST_URI"] == "/") {
|
||||
header("Location: /login.php");
|
||||
} else {
|
||||
header("Location: /login.php?last_visited=" . base64_encode($_SERVER["REQUEST_URI"]) );
|
||||
}
|
||||
exit;
|
||||
}
|
||||
@@ -1,117 +1,10 @@
|
||||
<?php
|
||||
|
||||
if (!isset($_SESSION)) {
|
||||
// HTTP Only cookies
|
||||
ini_set("session.cookie_httponly", true);
|
||||
if ($config_https_only) {
|
||||
// Tell client to only send cookie(s) over HTTPS
|
||||
ini_set("session.cookie_secure", true);
|
||||
}
|
||||
session_start();
|
||||
}
|
||||
|
||||
|
||||
// Check to see if setup is enabled
|
||||
if (!isset($config_enable_setup) || $config_enable_setup == 1) {
|
||||
header("Location: ../setup.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Check user is logged in with a valid session
|
||||
if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {
|
||||
if ($_SERVER["REQUEST_URI"] == "/") {
|
||||
header("Location: ../login.php");
|
||||
} else {
|
||||
header("Location: ../login.php?last_visited=" . base64_encode($_SERVER["REQUEST_URI"]) );
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
// Set Timezone
|
||||
require_once "session_init.php";
|
||||
require_once "redirect_if_setup_enabled.php";
|
||||
require_once "auth_check.php";
|
||||
require_once "inc_set_timezone.php";
|
||||
|
||||
|
||||
// User Vars and User Settings
|
||||
$session_ip = sanitizeInput(getIP());
|
||||
$session_user_agent = sanitizeInput($_SERVER['HTTP_USER_AGENT']);
|
||||
|
||||
$session_user_id = intval($_SESSION['user_id']);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM users
|
||||
LEFT JOIN user_settings ON users.user_id = user_settings.user_id
|
||||
LEFT JOIN user_roles ON user_role_id = role_id
|
||||
WHERE users.user_id = $session_user_id");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$session_name = sanitizeInput($row['user_name']);
|
||||
$session_email = $row['user_email'];
|
||||
$session_avatar = $row['user_avatar'];
|
||||
$session_token = $row['user_token']; // MFA Token
|
||||
$session_user_type = intval($row['user_type']);
|
||||
$session_user_role = intval($row['user_role_id']);
|
||||
$session_user_role_display = sanitizeInput($row['role_name']);
|
||||
if (isset($row['role_is_admin']) && $row['role_is_admin'] == 1) {
|
||||
$session_is_admin = true;
|
||||
} else {
|
||||
$session_is_admin = false;
|
||||
}
|
||||
$session_user_config_force_mfa = intval($row['user_config_force_mfa']);
|
||||
$user_config_records_per_page = intval($row['user_config_records_per_page']);
|
||||
|
||||
// Check user type
|
||||
if ($session_user_type !== 1) {
|
||||
session_unset();
|
||||
session_destroy();
|
||||
header("Location: login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
// Company Vars and Company Settings
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM companies, settings WHERE settings.company_id = companies.company_id AND companies.company_id = 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$session_company_name = $row['company_name'];
|
||||
$session_company_country = $row['company_country'];
|
||||
$session_company_locale = $row['company_locale'];
|
||||
$session_company_currency = $row['company_currency'];
|
||||
|
||||
|
||||
// Set Currency Format
|
||||
$currency_format = numfmt_create($session_company_locale, NumberFormatter::CURRENCY);
|
||||
|
||||
// Get User Client Access Permissions
|
||||
$user_client_access_sql = "SELECT client_id FROM user_client_permissions WHERE user_id = $session_user_id";
|
||||
$user_client_access_result = mysqli_query($mysqli, $user_client_access_sql);
|
||||
|
||||
$client_access_array = [];
|
||||
while ($row = mysqli_fetch_assoc($user_client_access_result)) {
|
||||
$client_access_array[] = $row['client_id'];
|
||||
}
|
||||
|
||||
$client_access_string = implode(',', $client_access_array);
|
||||
|
||||
// Client access permission check
|
||||
// Default allow, if a list of allowed clients is set & the user isn't an admin, restrict them
|
||||
$access_permission_query = "";
|
||||
if ($client_access_string && !$session_is_admin) {
|
||||
$access_permission_query = "AND clients.client_id IN ($client_access_string)";
|
||||
}
|
||||
|
||||
// Include the settings vars
|
||||
require_once "get_settings.php";
|
||||
|
||||
//Detects if using an Apple device and uses Apple Maps instead of google
|
||||
$iPod = stripos($_SERVER['HTTP_USER_AGENT'], "iPod");
|
||||
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'], "iPhone");
|
||||
$iPad = stripos($_SERVER['HTTP_USER_AGENT'], "iPad");
|
||||
|
||||
if ($iPod || $iPhone || $iPad) {
|
||||
$session_map_source = "apple";
|
||||
} else {
|
||||
$session_map_source = "google";
|
||||
}
|
||||
|
||||
// Check if mobile device
|
||||
$session_mobile = isMobile();
|
||||
require_once "load_user_session.php";
|
||||
require_once "load_company_settings.php";
|
||||
require_once "load_global_settings.php";
|
||||
require_once "detect_device_type.php";
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
<?php
|
||||
// Badge Counts
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('contact_id') AS num FROM contacts WHERE contact_archived_at IS NULL"));
|
||||
$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"));
|
||||
$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"));
|
||||
$num_assets = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('service_id') AS num FROM services"));
|
||||
$num_services = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('credential_id') AS num FROM credentials WHERE credential_archived_at IS NULL"));
|
||||
$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"));
|
||||
$num_networks = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('domain_id') AS num FROM domains WHERE domain_archived_at IS NULL"));
|
||||
$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"));
|
||||
$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"));
|
||||
$num_software = $row['num'];
|
||||
|
||||
?>
|
||||
|
||||
<!-- Main Sidebar Container -->
|
||||
<aside class="main-sidebar sidebar-dark-primary d-print-none">
|
||||
|
||||
<a class="pb-1 mt-1 brand-link" href="clients.php">
|
||||
<p class="h6"><i class="nav-icon fas fa-arrow-left ml-3 mr-2"></i>
|
||||
<span class="brand-text ">Back | <strong>Client Overview</strong>
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav>
|
||||
|
||||
<ul class="nav nav-pills nav-sidebar flex-column mt-2" data-widget="treeview" data-accordion="false">
|
||||
|
||||
<?php if (lookupUserPermission("module_support") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="contacts.php" 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" 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>
|
||||
<li class="nav-item">
|
||||
<a href="assets.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "assets.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" 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 text-light"><?php echo $num_software; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="credentials.php" 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>
|
||||
<li class="nav-item">
|
||||
<a href="networks.php" 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="certificates.php" 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 text-light"><?php echo $num_certificates; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="domains.php" 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 text-light"><?php echo $num_domains; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="services.php" 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>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
|
||||
<div class="sidebar-custom mb-3">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
@@ -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 <?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 <?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 <?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 <?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>
|
||||
@@ -5,4 +5,4 @@
|
||||
* It is used in conjunction with database_updates.php
|
||||
*/
|
||||
|
||||
DEFINE("LATEST_DATABASE_VERSION", "2.1.9");
|
||||
DEFINE("LATEST_DATABASE_VERSION", "2.3.6");
|
||||
|
||||
6
includes/db.php
Normal file
6
includes/db.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
// DB Connection
|
||||
|
||||
$mysqli = mysqli_connect($dbhost, $dbusername, $dbpassword, $database) or die('Database Connection Failed');
|
||||
|
||||
8
includes/detect_device_type.php
Normal file
8
includes/detect_device_type.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
$iPod = stripos($_SERVER['HTTP_USER_AGENT'], "iPod");
|
||||
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'], "iPhone");
|
||||
$iPad = stripos($_SERVER['HTTP_USER_AGENT'], "iPad");
|
||||
|
||||
$session_map_source = ($iPod || $iPhone || $iPad) ? "apple" : "google";
|
||||
|
||||
$session_mobile = isMobile();
|
||||
@@ -15,18 +15,21 @@ if ($total_found_rows > 5) {
|
||||
|
||||
?>
|
||||
|
||||
<hr>
|
||||
<div class="card-footer pb-0 pt-3">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm mb-2">
|
||||
<div class="col-sm">
|
||||
<form action="post.php" method="post">
|
||||
<select onchange="this.form.submit()" class="form-control select2 col-12 col-sm-3" name="change_records_per_page">
|
||||
<option <?php if ($user_config_records_per_page == 5) { echo "selected"; } ?> >5</option>
|
||||
<option <?php if ($user_config_records_per_page == 10) { echo "selected"; } ?> >10</option>
|
||||
<option <?php if ($user_config_records_per_page == 20) { echo "selected"; } ?> >20</option>
|
||||
<option <?php if ($user_config_records_per_page == 50) { echo "selected"; } ?> >50</option>
|
||||
<option <?php if ($user_config_records_per_page == 100) { echo "selected"; } ?> >100</option>
|
||||
</select>
|
||||
<div class="form-group">
|
||||
<select onchange="this.form.submit()" class="form-control select2 col-12 col-sm-3" name="change_records_per_page">
|
||||
<option <?php if ($user_config_records_per_page == 5) { echo "selected"; } ?> >5</option>
|
||||
<option <?php if ($user_config_records_per_page == 10) { echo "selected"; } ?> >10</option>
|
||||
<option <?php if ($user_config_records_per_page == 20) { echo "selected"; } ?> >20</option>
|
||||
<option <?php if ($user_config_records_per_page == 50) { echo "selected"; } ?> >50</option>
|
||||
<option <?php if ($user_config_records_per_page == 100) { echo "selected"; } ?> >100</option>
|
||||
<option <?php if ($user_config_records_per_page == 500) { echo "selected"; } ?> >500</option>
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -49,16 +52,13 @@ if ($total_found_rows > 5) {
|
||||
// Now output something like "Showing X to Y of Z records"
|
||||
?>
|
||||
|
||||
<div class="col-sm mb-2">
|
||||
<div class="col-sm">
|
||||
<p class="text-center">
|
||||
Showing <strong><?php echo $start; ?></strong> to <strong><?php echo $end; ?></strong> of <strong><?php echo $total_found_rows; ?></strong> records
|
||||
</p>
|
||||
|
||||
|
||||
<!--<p class="text-center mt-2"><?php echo $total_found_rows; ?></p> -->
|
||||
</div>
|
||||
<div class="col-sm mb-2">
|
||||
|
||||
<div class="col-sm">
|
||||
<ul class="pagination justify-content-sm-end">
|
||||
|
||||
<?php
|
||||
@@ -114,6 +114,7 @@ if ($total_found_rows > 5) {
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -3,10 +3,21 @@ require_once "inc_confirm_modal.php";
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (str_contains(basename($_SERVER["PHP_SELF"]), "admin_")) { ?>
|
||||
if (basename(dirname($_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 } ?>
|
||||
<?php
|
||||
if (basename(dirname($_SERVER['REQUEST_URI'])) === 'guest') { ?>
|
||||
<p class="text-center">
|
||||
<?php
|
||||
echo nullable_htmlentities($session_company_name);
|
||||
if (!$config_whitelabel_enabled) {
|
||||
echo '<br><small class="text-muted">Powered by ITFlow</small>';
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
<?php } ?>
|
||||
|
||||
</div><!-- /.container-fluid -->
|
||||
</div> <!-- /.content -->
|
||||
@@ -19,27 +30,27 @@ if (str_contains(basename($_SERVER["PHP_SELF"]), "admin_")) { ?>
|
||||
<!-- REQUIRED SCRIPTS -->
|
||||
|
||||
<!-- Bootstrap 4 -->
|
||||
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
<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="/plugins/moment/moment.min.js"></script>
|
||||
<script src="/plugins/chart.js/chart.umd.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>
|
||||
<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>
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
// Get Main Side Bar Badge Counts
|
||||
|
||||
// Active Clients Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('client_id') AS num FROM clients WHERE client_archived_at IS NULL $access_permission_query"));
|
||||
$num_active_clients = $row['num'];
|
||||
|
||||
// Active Ticket Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id') AS num FROM tickets LEFT JOIN clients ON client_id = ticket_client_id WHERE ticket_archived_at IS NULL AND ticket_closed_at IS NULL AND ticket_status != 4 $access_permission_query"));
|
||||
$num_active_tickets = $row['num'];
|
||||
|
||||
// Recurring Ticket Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('recurring_ticket_id') AS num FROM recurring_tickets LEFT JOIN clients ON client_id = recurring_ticket_client_id WHERE 1 = 1 $access_permission_query"));
|
||||
$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"));
|
||||
$num_active_projects = $row['num'];
|
||||
|
||||
// Open Invoices Count
|
||||
$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"));
|
||||
$num_open_invoices = $row['num'];
|
||||
|
||||
// Recurring Invoice Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('recurring_invoice_id') AS num FROM recurring_invoices WHERE recurring_invoice_archived_at IS NULL"));
|
||||
$num_recurring_invoices = $row['num'];
|
||||
|
||||
// Open Quotes Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('quote_id') AS num FROM quotes WHERE (quote_status = 'Sent' OR quote_status = 'Viewed') AND quote_archived_at IS NULL"));
|
||||
$num_open_quotes = $row['num'];
|
||||
|
||||
// Recurring Expenses Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('recurring_expense_id') AS num FROM recurring_expenses WHERE recurring_expense_archived_at IS NULL"));
|
||||
$num_recurring_expenses = $row['num'];
|
||||
@@ -16,37 +16,35 @@ header("X-Frame-Options: DENY");
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="robots" content="noindex">
|
||||
|
||||
<title><?php echo $session_company_name; ?></title>
|
||||
<title><?= $session_company_name; ?></title>
|
||||
|
||||
<!--
|
||||
Favicon
|
||||
If Fav Icon exists else use the default one
|
||||
-->
|
||||
<?php if(file_exists('uploads/favicon.ico')) { ?>
|
||||
<!-- Favicon -->
|
||||
<?php if(file_exists($_SERVER['DOCUMENT_ROOT'] . '/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">
|
||||
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="plugins/adminlte/css/adminlte.min.css">
|
||||
<!-- Font Awesome -->
|
||||
<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">
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="plugins/jquery/jquery.min.js"></script>
|
||||
<script src="plugins/toastr/toastr.min.js"></script>
|
||||
<!-- Custom Styles -->
|
||||
<link rel="stylesheet" href="/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css" >
|
||||
<link rel="stylesheet" href="/plugins/select2/css/select2.min.css">
|
||||
<link rel="stylesheet" href="/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="/plugins/daterangepicker/daterangepicker.css">
|
||||
<link rel="stylesheet" href="/plugins/toastr/toastr.min.css">
|
||||
<link rel="stylesheet" href="/plugins/DataTables/datatables.min.css">
|
||||
<link rel="stylesheet" href="/plugins/intl-tel-input/css/intlTelInput.min.css">
|
||||
<link rel="stylesheet" href="/css/itflow_custom.css">
|
||||
<link rel="stylesheet" href="/plugins/adminlte/css/adminlte.min.css">
|
||||
|
||||
<!-- Scripts -->
|
||||
<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); } ?>">
|
||||
<body class="
|
||||
hold-transition sidebar-mini layout-fixed layout-navbar-fixed
|
||||
accent-<?php echo isset($_GET['client_id']) ? 'blue' : nullable_htmlentities($config_theme); ?>
|
||||
<?php if ($user_config_theme_dark) echo 'dark-mode'; ?>
|
||||
">
|
||||
<div class="wrapper text-sm">
|
||||
|
||||
|
||||
@@ -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";
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once "config.php";
|
||||
require_once "functions.php";
|
||||
require_once "check_login.php";
|
||||
require_once "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 "header.php";
|
||||
require_once "top_nav.php";
|
||||
require_once "admin_side_nav.php";
|
||||
require_once "inc_wrapper.php";
|
||||
require_once "inc_alert_feedback.php";
|
||||
require_once "filter_header.php";
|
||||
require_once "app_version.php";
|
||||
@@ -1,310 +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;
|
||||
|
||||
// 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,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once "config.php";
|
||||
require_once "functions.php";
|
||||
require_once "check_login.php";
|
||||
require_once "page_title.php";
|
||||
// Reporting Perms
|
||||
enforceUserPermission('module_reporting');
|
||||
require_once "header.php";
|
||||
require_once "top_nav.php";
|
||||
require_once "reports_side_nav.php";
|
||||
require_once "inc_wrapper.php";
|
||||
require_once "inc_alert_feedback.php";
|
||||
require_once "filter_header.php";
|
||||
|
||||
// Set variable default values
|
||||
$largest_income_month = 0;
|
||||
$largest_invoice_month = 0;
|
||||
$recurring_total = 0;
|
||||
@@ -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,176 +0,0 @@
|
||||
<div class="card d-print-none">
|
||||
<div class="card-body py-2">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a href="#" data-toggle="collapse" data-target="#clientHeader"><h4 class="text-secondary" data-toggle="tooltip" data-placement="right" title="Client ID: <?php echo $client_id; ?>"><strong><?php echo $client_name; ?></strong> <?php if ($client_archived_at) { echo "(archived)"; } ?></h4></a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<?php if (lookupUserPermission("module_client") >= 2) { ?>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-dark btn-sm float-right" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-fw fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_client_edit.php"
|
||||
data-ajax-id="<?php echo $client_id; ?>">
|
||||
<i class="fas fa-fw fa-edit mr-2"></i>Edit Client
|
||||
</a>
|
||||
<?php if (lookupUserPermission("module_client") >= 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#exportClientPDFModal">
|
||||
<i class="fas fa-fw fa-file-pdf mr-2"></i>Export Data
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (empty($client_archived_at)) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_client=<?php echo $client_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>">
|
||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive Client
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-primary confirm-link" href="post.php?undo_archive_client=<?php echo $client_id; ?>">
|
||||
<i class="fas fa-fw fa-archive mr-2"></i>Unarchive Client
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (lookupUserPermission("module_client") >= 3 && $client_archived_at) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold" href="#" data-toggle="modal" data-target="#deleteClientModal<?php echo $client_id; ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete Client
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapse <?php if (basename($_SERVER["PHP_SELF"]) == "client_overview.php") { echo "show"; } ?>" id="clientHeader">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md border-top">
|
||||
<h5 class="text-secondary mt-1">Primary Location</h5>
|
||||
<?php if (!empty($location_address)) { ?>
|
||||
<div>
|
||||
<a href="//maps.<?php echo $session_map_source; ?>.com/?q=<?php echo "$location_address $location_zip"; ?>" target="_blank">
|
||||
<i class="fa fa-fw fa-map-marker-alt text-secondary ml-1 mr-2"></i><?php echo $location_address; ?>
|
||||
<div>
|
||||
<i class="fa fa-fw ml-1 mr-2"></i><?php echo "$location_city $location_state $location_zip"; ?>
|
||||
</div>
|
||||
<div>
|
||||
<i class="fa fa-fw ml-1 mr-2"></i><small><?php echo $location_country; ?></small>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
if (!empty($location_phone)) { ?>
|
||||
<div class="mt-1">
|
||||
<i class="fa fa-fw fa-phone text-secondary ml-1 mr-2"></i><a href="tel:<?php echo $location_phone?>"><?php echo $location_phone; ?></a>
|
||||
</div>
|
||||
<hr class="my-2">
|
||||
<?php }
|
||||
|
||||
if (!empty($client_website)) { ?>
|
||||
<div class="mt-1">
|
||||
<i class="fa fa-fw fa-globe text-secondary ml-1 mr-2"></i><a target="_blank" href="//<?php echo $client_website; ?>"><?php echo $client_website; ?></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md border-left border-top">
|
||||
<h5 class="text-secondary mt-1">Primary Contact</h5>
|
||||
<?php
|
||||
|
||||
if (!empty($contact_name)) { ?>
|
||||
<div>
|
||||
<i class="fa fa-fw fa-user text-secondary ml-1 mr-2"></i><?php echo $contact_name; ?>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
if (!empty($contact_email)) { ?>
|
||||
<div class="mt-1">
|
||||
<i class="fa fa-fw fa-envelope text-secondary ml-1 mr-2"></i><a href="mailto:<?php echo $contact_email; ?>"><?php echo $contact_email; ?></a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!empty($contact_phone)) { ?>
|
||||
<div class="mt-1">
|
||||
<i class="fa fa-fw fa-phone text-secondary ml-1 mr-2"></i><a href="tel:<?php echo $contact_phone; ?>"><?php echo $contact_phone; ?></a>
|
||||
|
||||
<?php
|
||||
if (!empty($contact_extension)) {
|
||||
echo "<small>x$contact_extension</small>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!empty($contact_mobile)) { ?>
|
||||
<div class="mt-1">
|
||||
<i class="fa fa-fw fa-mobile-alt text-secondary ml-1 mr-2"></i><a href="tel:<?php echo $contact_mobile; ?>"><?php echo $contact_mobile; ?></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if (lookupUserPermission("module_financial") >= 1 && $config_module_enable_accounting == 1) { ?>
|
||||
<div class="col-md border-left border-top">
|
||||
<h5 class="text-secondary mt-1">Billing</h5>
|
||||
<div class="ml-1 text-secondary">Hourly Rate
|
||||
<span class="text-dark float-right"> <?php echo numfmt_format_currency($currency_format, $client_rate, $client_currency_code); ?></span>
|
||||
</div>
|
||||
<div class="ml-1 mt-1 text-secondary">Paid
|
||||
<span class="text-dark float-right"> <?php echo numfmt_format_currency($currency_format, $amount_paid, $client_currency_code); ?></span>
|
||||
</div>
|
||||
<div class="ml-1 mt-1 text-secondary">Balance
|
||||
<span class="<?php if ($balance > 0) { echo "text-danger"; }else{ echo "text-dark"; } ?> float-right"> <?php echo numfmt_format_currency($currency_format, $balance, $client_currency_code); ?></span>
|
||||
</div>
|
||||
<div class="ml-1 mt-1 text-secondary">Monthly Recurring
|
||||
<span class="text-dark float-right"> <?php echo numfmt_format_currency($currency_format, $recurring_monthly, $client_currency_code); ?></span>
|
||||
</div>
|
||||
<div class="ml-1 mt-1 text-secondary">Net Terms
|
||||
<span class="text-dark float-right"><?php echo $client_net_terms; ?><small class="text-secondary ml-1">Days</small></span>
|
||||
</div>
|
||||
<?php if(!empty($client_tax_id_number)) { ?>
|
||||
<div class="ml-1 mt-1 text-secondary">Tax ID
|
||||
<span class="text-dark float-right"><?php echo $client_tax_id_number; ?></span>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (lookupUserPermission("module_support") >= 1 && $config_module_enable_ticketing == 1) { ?>
|
||||
<div class="col-md border-left border-top">
|
||||
<h5 class="text-secondary mt-1">Support</h5>
|
||||
<div class="ml-1 text-secondary">Open Tickets
|
||||
<span class="text-dark float-right"><?php echo $num_active_tickets; ?></span>
|
||||
</div>
|
||||
<div class="ml-1 text-secondary mt-1">Closed Tickets
|
||||
<span class="text-dark float-right"><?php echo $num_closed_tickets; ?></span>
|
||||
</div>
|
||||
<?php
|
||||
if (!empty($client_tag_name_display_array)) { ?>
|
||||
<hr>
|
||||
<?php echo $client_tags_display; ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
require_once "modals/client_delete_modal.php";
|
||||
require_once "modals/client_download_pdf_modal.php";
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
10
includes/load_company_settings.php
Normal file
10
includes/load_company_settings.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM companies, settings WHERE settings.company_id = companies.company_id AND companies.company_id = 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$session_company_name = $row['company_name'];
|
||||
$session_company_country = $row['company_country'];
|
||||
$session_company_locale = $row['company_locale'];
|
||||
$session_company_currency = $row['company_currency'];
|
||||
|
||||
$currency_format = numfmt_create($session_company_locale, NumberFormatter::CURRENCY);
|
||||
@@ -12,6 +12,7 @@ $config_azure_client_id = $row['config_azure_client_id'];
|
||||
$config_azure_client_secret = $row['config_azure_client_secret'];
|
||||
|
||||
// Mail - SMTP
|
||||
$config_smtp_provider = $row['config_smtp_provider'];
|
||||
$config_smtp_host = $row['config_smtp_host'];
|
||||
$config_smtp_port = intval($row['config_smtp_port']);
|
||||
$config_smtp_encryption = $row['config_smtp_encryption'];
|
||||
@@ -19,15 +20,25 @@ $config_smtp_username = $row['config_smtp_username'];
|
||||
$config_smtp_password = $row['config_smtp_password'];
|
||||
$config_mail_from_email = $row['config_mail_from_email'];
|
||||
$config_mail_from_name = $row['config_mail_from_name'];
|
||||
|
||||
// Mail - IMAP
|
||||
$config_imap_provider = $row['config_imap_provider'];
|
||||
$config_imap_host = $row['config_imap_host'];
|
||||
$config_imap_port = intval($row['config_imap_port']);
|
||||
$config_imap_encryption = $row['config_imap_encryption'];
|
||||
$config_imap_username = $row['config_imap_username'];
|
||||
$config_imap_password = $row['config_imap_password'];
|
||||
|
||||
// Mail OAUTH2
|
||||
$config_mail_oauth_client_id = $row['config_mail_oauth_client_id'];
|
||||
$config_mail_oauth_client_secret = $row['config_mail_oauth_client_secret'];
|
||||
$config_mail_oauth_tenant_id = $row['config_mail_oauth_tenant_id'];
|
||||
$config_mail_oauth_refresh_token = $row['config_mail_oauth_refresh_token'];
|
||||
$config_mail_oauth_access_token = $row['config_mail_oauth_access_token'];
|
||||
$config_mail_oauth_access_token_expires_at = $row['config_mail_oauth_access_token_expires_at'];
|
||||
|
||||
// Defaults
|
||||
$config_start_page = $row['config_start_page'];
|
||||
$config_start_page = $row['config_start_page'] ?? 'clients.php';
|
||||
$config_default_transfer_from_account = intval($row['config_default_transfer_from_account']);
|
||||
$config_default_transfer_to_account = intval($row['config_default_transfer_to_account']);
|
||||
$config_default_payment_account = intval($row['config_default_payment_account']);
|
||||
@@ -90,23 +101,6 @@ $config_enable_alert_domain_expire = intval($row['config_enable_alert_domain_exp
|
||||
$config_send_invoice_reminders = intval($row['config_send_invoice_reminders']);
|
||||
$config_invoice_overdue_reminders = intval($row['config_invoice_overdue_reminders']);
|
||||
|
||||
// Online Stripe Payment
|
||||
$config_stripe_enable = intval($row['config_stripe_enable']);
|
||||
$config_stripe_publishable = $row['config_stripe_publishable'];
|
||||
$config_stripe_secret = $row['config_stripe_secret'];
|
||||
$config_stripe_account = intval($row['config_stripe_account']);
|
||||
$config_stripe_expense_vendor = intval($row['config_stripe_expense_vendor']);
|
||||
$config_stripe_expense_category = intval($row['config_stripe_expense_category']);
|
||||
$config_stripe_percentage_fee = floatval($row['config_stripe_percentage_fee']);
|
||||
$config_stripe_flat_fee = floatval($row['config_stripe_flat_fee']);
|
||||
|
||||
// AI Provider Details
|
||||
$config_ai_enable = intval($row['config_ai_enable']);
|
||||
$config_ai_provider = $row['config_ai_provider'];
|
||||
$config_ai_model = $row['config_ai_model'];
|
||||
$config_ai_url = $row['config_ai_url'];
|
||||
$config_ai_api_key = $row['config_ai_api_key'];
|
||||
|
||||
// Modules
|
||||
$config_module_enable_itdoc = intval($row['config_module_enable_itdoc']);
|
||||
$config_module_enable_ticketing = intval($row['config_module_enable_ticketing']);
|
||||
@@ -128,7 +122,6 @@ $config_time_format = "H:i";
|
||||
|
||||
// Theme
|
||||
$config_theme = $row['config_theme'];
|
||||
$config_theme_mode = "dark_mode";
|
||||
|
||||
// Telemetry
|
||||
$config_telemetry = intval($row['config_telemetry']);
|
||||
48
includes/load_user_session.php
Normal file
48
includes/load_user_session.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
$session_ip = sanitizeInput(getIP());
|
||||
$session_user_agent = sanitizeInput($_SERVER['HTTP_USER_AGENT']);
|
||||
$session_user_id = intval($_SESSION['user_id']);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM users
|
||||
LEFT JOIN user_settings ON users.user_id = user_settings.user_id
|
||||
LEFT JOIN user_roles ON user_role_id = role_id
|
||||
WHERE users.user_id = $session_user_id"
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$session_name = sanitizeInput($row['user_name']);
|
||||
$session_email = $row['user_email'];
|
||||
$session_avatar = $row['user_avatar'];
|
||||
$session_token = $row['user_token'];
|
||||
$session_user_type = intval($row['user_type']);
|
||||
$session_user_role = intval($row['user_role_id']);
|
||||
$session_user_role_display = sanitizeInput($row['role_name']);
|
||||
$session_is_admin = isset($row['role_is_admin']) && $row['role_is_admin'] == 1;
|
||||
$session_user_config_force_mfa = intval($row['user_config_force_mfa']);
|
||||
$user_config_records_per_page = intval($row['user_config_records_per_page']);
|
||||
$user_config_theme_dark = intval($row['user_config_theme_dark']);
|
||||
|
||||
if ($session_user_type !== 1) {
|
||||
session_unset();
|
||||
session_destroy();
|
||||
redirect("/client/login.php");
|
||||
}
|
||||
|
||||
// Load user client permissions
|
||||
$user_client_access_sql = "SELECT client_id FROM user_client_permissions WHERE user_id = $session_user_id";
|
||||
$user_client_access_result = mysqli_query($mysqli, $user_client_access_sql);
|
||||
|
||||
$client_access_array = [];
|
||||
while ($row = mysqli_fetch_assoc($user_client_access_result)) {
|
||||
$client_access_array[] = $row['client_id'];
|
||||
}
|
||||
|
||||
$client_access_string = implode(',', $client_access_array);
|
||||
$access_permission_query = "";
|
||||
if ($client_access_string && !$session_is_admin) {
|
||||
$access_permission_query = "AND clients.client_id IN ($client_access_string)";
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
<script src="js/app.js"></script>
|
||||
<script src="plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js"></script>
|
||||
<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]);
|
||||
exit();
|
||||
?>
|
||||
13
includes/modal_header.php
Normal file
13
includes/modal_header.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/config.php';
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/functions.php';
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/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;
|
||||
//}
|
||||
@@ -5,18 +5,7 @@
|
||||
// Get the current page name without the .php extension
|
||||
$page_title = basename($_SERVER['PHP_SELF'], '.php');
|
||||
|
||||
// Remove 'client_' from the page name
|
||||
$page_title = str_replace('client_', '', $page_title);
|
||||
|
||||
// Remove 'report_' from the page name
|
||||
$page_title = str_replace('report_', '', $page_title);
|
||||
|
||||
// Remove 'admin_' from the page name
|
||||
$page_title = str_replace('admin_', '', $page_title);
|
||||
|
||||
// Remove 'admin_' from the page name
|
||||
$page_title = str_replace('settings_', '', $page_title);
|
||||
|
||||
// Lets make the Page title look pretty
|
||||
// Replace any underscores with spaces
|
||||
$page_title = str_replace('_', ' ', $page_title);
|
||||
|
||||
|
||||
5
includes/redirect_if_setup_enabled.php
Normal file
5
includes/redirect_if_setup_enabled.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (!isset($config_enable_setup) || $config_enable_setup == 1) {
|
||||
redirect("/setup");
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
<!-- Main Sidebar Container -->
|
||||
<aside class="main-sidebar sidebar-dark-primary d-print-none">
|
||||
|
||||
<a class="pb-1 mt-1 brand-link" 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>Reports</strong>
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav>
|
||||
|
||||
<ul class="nav nav-pills nav-sidebar flex-column mt-2" data-widget="treeview" data-accordion="false">
|
||||
|
||||
<li class="nav-header">FINANCIAL</li>
|
||||
<?php if ($config_module_enable_accounting == 1 && lookupUserPermission("module_financial") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="report_income_summary.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_income_summary.php") { echo "active"; } ?>">
|
||||
<i class="far fa-circle nav-icon"></i>
|
||||
<p>Income</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="report_income_by_client.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_income_by_client.php") { echo "active"; } ?>">
|
||||
<i class="far fa-user nav-icon"></i>
|
||||
<p>Income By Client</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="report_recurring_by_client.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_recurring_by_client.php") { echo "active"; } ?>">
|
||||
<i class="fa fa-sync nav-icon"></i>
|
||||
<p>Recurring Income By Client</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="report_clients_with_balance.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_clients_with_balance.php") { echo "active"; } ?>">
|
||||
<i class="fa fa-exclamation-triangle nav-icon"></i>
|
||||
<p>Clients with a Balance</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="report_expense_summary.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_expense_summary.php") { echo "active"; } ?>">
|
||||
<i class="far fa-credit-card nav-icon"></i>
|
||||
<p>Expense</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="report_expense_by_vendor.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_expense_by_vendor.php") { echo "active"; } ?>">
|
||||
<i class="far fa-building nav-icon"></i>
|
||||
<p>Expense By Vendor</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="report_budget.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_budget.php") { echo "active"; } ?>">
|
||||
<i class="fas fa-list nav-icon"></i>
|
||||
<p>Budget</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="report_tax_summary.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_tax_summary.php") { echo "active"; } ?>">
|
||||
<i class="fas fa-percent nav-icon"></i>
|
||||
<p>Tax Summary</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="report_profit_loss.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_profit_loss.php") { echo "active"; } ?>">
|
||||
<i class="fas fa-file-invoice-dollar nav-icon"></i>
|
||||
<p>Profit & Loss</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="report_tickets_unbilled.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_tickets_unbilled.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-life-ring"></i>
|
||||
<p>Unbilled Tickets</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php } // End financial reports IF statement ?>
|
||||
|
||||
|
||||
<li class="nav-header">TECHNICAL</li>
|
||||
<?php if ($config_module_enable_ticketing && lookupUserPermission("module_support") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="report_ticket_summary.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_ticket_summary.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-life-ring"></i>
|
||||
<p>Tickets</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="report_ticket_by_client.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_ticket_by_client.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-life-ring"></i>
|
||||
<p>Tickets by Client</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="report_time_by_tech.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_time_by_tech.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-life-ring"></i>
|
||||
<p>Time by Technician</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (lookupUserPermission("module_credential") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="report_credential_rotation.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_credential_rotation.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-key"></i>
|
||||
<p>Credential rotation</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
|
||||
<div class="sidebar-custom mb-3">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
14
includes/session_init.php
Normal file
14
includes/session_init.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
if (!isset($_SESSION)) {
|
||||
// HTTP Only cookies
|
||||
ini_set("session.cookie_httponly", true);
|
||||
|
||||
if ($config_https_only) {
|
||||
// Tell client to only send cookie(s) over HTTPS
|
||||
ini_set("session.cookie_secure", true);
|
||||
}
|
||||
|
||||
session_start();
|
||||
|
||||
}
|
||||
@@ -66,6 +66,7 @@ $countries_array = array(
|
||||
"Georgia",
|
||||
"Germany",
|
||||
"Ghana",
|
||||
"Gibraltar",
|
||||
"Greece",
|
||||
"Grenada",
|
||||
"Guatemala",
|
||||
@@ -772,4 +773,3 @@ $locales_array = [
|
||||
'zu_ZA' => 'Zulu (South Africa)',
|
||||
'zu' => 'Zulu',
|
||||
];
|
||||
?>
|
||||
@@ -1,244 +0,0 @@
|
||||
<!-- Main Sidebar Container -->
|
||||
<aside class="main-sidebar sidebar-dark-<?php echo nullable_htmlentities($config_theme); ?> d-print-none">
|
||||
|
||||
<a class="brand-link" href="dashboard.php">
|
||||
<div class="brand-image">
|
||||
<i class="fas fa-building fa-2x"></i>
|
||||
</div>
|
||||
<span class="brand-text h5 ml-2"><?php echo nullable_htmlentities($session_company_name); ?></span>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav>
|
||||
<ul class="nav nav-pills nav-sidebar flex-column mt-3" data-widget="treeview" data-accordion="false">
|
||||
<li class="nav-item">
|
||||
<a href="dashboard.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "dashboard.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-tachometer-alt"></i>
|
||||
<p>Dashboard</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php if (lookupUserPermission("module_client") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="clients.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "clients.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-users"></i>
|
||||
<p>
|
||||
Clients
|
||||
<?php if ($num_active_clients) { ?>
|
||||
<span class="right badge text-light" data-toggle="tooltip" title="Active Clients"><?php echo $num_active_clients; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (lookupUserPermission("module_support") >= 1) { ?>
|
||||
<?php if ($config_module_enable_ticketing == 1) { ?>
|
||||
<li class="nav-header mt-3">SUPPORT</li>
|
||||
<li class="nav-item">
|
||||
<a href="tickets.php" 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) { ?>
|
||||
<span class="right badge text-light" data-toggle="tooltip" title="Open Tickets"><?php echo $num_active_tickets; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="recurring_tickets.php" 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 text-light" data-toggle="tooltip" title="Active Recurring Tickets"><?php echo $num_recurring_tickets; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="projects.php" 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 } ?>
|
||||
<?php } ?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="calendar.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "calendar.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-calendar-alt"></i>
|
||||
<p>Calendar</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php if ($config_module_enable_accounting == 1 && lookupUserPermission("module_sales") >= 1) { ?>
|
||||
<li class="nav-header mt-3">BILLING</li>
|
||||
<li class="nav-item">
|
||||
<a href="quotes.php" 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_open_quotes) { ?>
|
||||
<span class="right badge text-light" data-toggle="tooltip" title="Active Quotes"><?php echo $num_open_quotes; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="invoices.php" 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_open_invoices) { ?>
|
||||
<span class="right badge text-light" data-toggle="tooltip" title="Open Invoices"><?php echo $num_open_invoices; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="recurring_invoices.php" 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 text-light" data-toggle="tooltip" title="Active Recurring Invoices"><?php echo $num_recurring_invoices; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="revenues.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "revenues.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-hand-holding-usd"></i>
|
||||
<p>Revenues</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="products.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "products.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-box-open"></i>
|
||||
<p>Products</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if ($config_module_enable_accounting == 1 && lookupUserPermission("module_financial") >= 1) { ?>
|
||||
<li class="nav-header mt-3">FINANCE</li>
|
||||
<li class="nav-item">
|
||||
<a href="payments.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "payments.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-credit-card"></i>
|
||||
<p>Payments</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="vendors.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "vendors.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-building"></i>
|
||||
<p>Vendors</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="expenses.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "expenses.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-shopping-cart"></i>
|
||||
<p>Expenses</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="recurring_expenses.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "recurring_expenses.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-redo-alt"></i>
|
||||
<p>
|
||||
Recurring Expenses
|
||||
<?php if ($num_recurring_expenses) { ?>
|
||||
<span class="right badge text-light" data-toggle="tooltip" title="Recurring Expenses"><?php echo $num_recurring_expenses; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="accounts.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "accounts.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-piggy-bank"></i>
|
||||
<p>Accounts</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="transfers.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "transfers.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-exchange-alt"></i>
|
||||
<p>Transfers</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="budget.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "budget.php" || basename($_SERVER["PHP_SELF"]) == "budget_edit.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-balance-scale"></i>
|
||||
<p>Budget</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="trips.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "trips.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-route"></i>
|
||||
<p>Trips</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (lookupUserPermission("module_client") >= 1) { ?>
|
||||
<li class="nav-item mt-3">
|
||||
<a href="contacts.php" class="nav-link">
|
||||
<i class="fas fa-users nav-icon"></i>
|
||||
<p>Client Overview</p>
|
||||
<i class="fas fa-angle-right nav-icon float-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (lookupUserPermission("module_reporting") >= 1) { ?>
|
||||
<li class="nav-item mt-3">
|
||||
<a href="report_overview.php" class="nav-link">
|
||||
<i class="fas fa-chart-line nav-icon"></i>
|
||||
<p>Reports</p>
|
||||
<i class="fas fa-angle-right nav-icon float-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
$sql_custom_links = mysqli_query($mysqli, "SELECT * FROM custom_links WHERE custom_link_location = 1 AND custom_link_archived_at IS NULL
|
||||
ORDER BY custom_link_order ASC, custom_link_name ASC"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_custom_links)) {
|
||||
$custom_link_name = nullable_htmlentities($row['custom_link_name']);
|
||||
$custom_link_uri = sanitize_url($row['custom_link_uri']);
|
||||
$custom_link_icon = nullable_htmlentities($row['custom_link_icon']);
|
||||
$custom_link_new_tab = intval($row['custom_link_new_tab']);
|
||||
if ($custom_link_new_tab == 1) {
|
||||
$target = "target='_blank' rel='noopener noreferrer'";
|
||||
} else {
|
||||
$target = "";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="<?php echo $custom_link_uri; ?>" <?php echo $target; ?> class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == basename($custom_link_uri)) { echo "active"; } ?>">
|
||||
<i class="fas fa-<?php echo $custom_link_icon; ?> nav-icon"></i>
|
||||
<p><?php echo $custom_link_name; ?></p>
|
||||
<i class="fas fa-angle-right nav-icon float-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
|
||||
<div class="mb-3"></div>
|
||||
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
|
||||
</aside>
|
||||
@@ -50,7 +50,7 @@ $placeholder = array(
|
||||
shuffle($placeholder);
|
||||
?>
|
||||
<!-- SEARCH FORM -->
|
||||
<form class="form-inline" action="global_search.php">
|
||||
<form class="form-inline" action="/agent/global_search.php">
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control form-control-navbar" type="search" placeholder="<?php echo $placeholder[0]?>" name="query"
|
||||
value="<?php if (isset($_GET['query'])) { echo nullable_htmlentities($_GET['query']); } ?>">
|
||||
@@ -102,10 +102,7 @@ shuffle($placeholder);
|
||||
?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_notifications.php"
|
||||
>
|
||||
<a class="nav-link ajax-modal" href="#" data-modal-url="/modals/notifications.php">
|
||||
<i class="fas fa-bell"></i>
|
||||
<?php if ($num_notifications) { ?>
|
||||
<span class="badge badge-light badge-pill navbar-badge position-absolute" style="top: 1px; right: 3px;">
|
||||
@@ -120,7 +117,7 @@ shuffle($placeholder);
|
||||
<?php if (empty($session_avatar)) { ?>
|
||||
<i class="fas fa-user-circle mr-1"></i>
|
||||
<?php }else{ ?>
|
||||
<img src="<?php echo "uploads/users/$session_user_id/$session_avatar"; ?>"
|
||||
<img src="<?php echo "/uploads/users/$session_user_id/$session_avatar"; ?>"
|
||||
class="user-image img-circle">
|
||||
<?php } ?>
|
||||
<span
|
||||
@@ -133,7 +130,7 @@ shuffle($placeholder);
|
||||
<i class="fas fa-user-circle fa-6x"></i>
|
||||
<?php }else{ ?>
|
||||
|
||||
<img src="<?php echo "uploads/users/$session_user_id/$session_avatar"; ?>" class="img-circle">
|
||||
<img src="<?php echo "/uploads/users/$session_user_id/$session_avatar"; ?>" class="img-circle">
|
||||
<?php } ?>
|
||||
<p>
|
||||
<?php echo stripslashes(nullable_htmlentities($session_name)); ?>
|
||||
@@ -143,18 +140,14 @@ shuffle($placeholder);
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
<?php if ($session_is_admin) { ?>
|
||||
<a href="admin_user.php" class="btn btn-default btn-block btn-flat mb-2"><i class="fas fa-user-shield mr-2"></i>Administration</a>
|
||||
<a href="/admin" class="btn btn-default btn-block btn-flat mb-2"><i class="fas fa-user-shield mr-2"></i>Administration</a>
|
||||
<?php } ?>
|
||||
<a href="user_details.php" class="btn btn-default btn-flat"><i class="fas fa-user-cog mr-2"></i>Account</a>
|
||||
<a href="post.php?logout" class="btn btn-default btn-flat float-right"><i class="fas fa-sign-out-alt mr-2"></i>Logout</a>
|
||||
<a href="/agent/user/user_details.php" class="btn btn-default btn-flat"><i class="fas fa-user-cog mr-2"></i>Account</a>
|
||||
<a href="/agent/post.php?logout" class="btn btn-default btn-flat float-right"><i class="fas fa-sign-out-alt mr-2"></i>Logout</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<?php if ($config_module_enable_ticketing == 1) {
|
||||
include_once __DIR__ . "/../modals/top_nav_tickets_modal.php";
|
||||
} ?>
|
||||
<!-- /.navbar -->
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
<!-- Main Sidebar Container -->
|
||||
<aside class="main-sidebar sidebar-dark-<?php 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>Account</strong>
|
||||
</span>
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav>
|
||||
|
||||
<ul class="nav nav-pills nav-sidebar flex-column mt-2" data-widget="treeview" role="menu" data-accordion="false">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="user_details.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "user_details.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-user"></i>
|
||||
<p>Details</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item mt-2">
|
||||
<a href="user_security.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "user_security.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-shield-alt"></i>
|
||||
<p>Security</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item mt-2">
|
||||
<a href="user_preferences.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "user_preferences.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-cogs"></i>
|
||||
<p>Preferences</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item mt-2">
|
||||
<a href="user_activity.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "user_activity.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-clock"></i>
|
||||
<p>Activity</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
|
||||
<div class="mb-3"></div>
|
||||
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
Reference in New Issue
Block a user