mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 10:54:52 +00:00
Merge branch 'develop' into quote-upload
This commit is contained in:
@@ -115,7 +115,7 @@
|
||||
<li class="nav-header">MAINTENANCE</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="admin_mail_queue.php" class="nav-link <?php echo (in_array(basename($_SERVER['PHP_SELF']), ['admin_mail_queue.php', 'admin_mail_queue_message_view.php']) ? 'active' : ''); ?>">
|
||||
<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>
|
||||
|
||||
9
includes/ajax_footer.php
Normal file
9
includes/ajax_footer.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<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]);
|
||||
?>
|
||||
13
includes/ajax_header.php
Normal file
13
includes/ajax_header.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?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;
|
||||
//}
|
||||
@@ -18,9 +18,9 @@ if ($total_found_rows > 5) {
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm mb-3">
|
||||
<div class="col-sm mb-2">
|
||||
<form action="post.php" method="post">
|
||||
<select onchange="this.form.submit()" class="form-control select2 col-sm-2" name="change_records_per_page">
|
||||
<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>
|
||||
@@ -29,10 +29,35 @@ if ($total_found_rows > 5) {
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-sm mb-3">
|
||||
<p class="text-center mt-2"><?php echo $total_found_rows; ?></p>
|
||||
|
||||
<?php
|
||||
// Number of records per page
|
||||
$per_page = $user_config_records_per_page;
|
||||
|
||||
// Current page (make sure $page is set; default to 1)
|
||||
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
|
||||
|
||||
// Calculate start and end item indexes
|
||||
$start = ($page - 1) * $per_page + 1;
|
||||
$end = $page * $per_page;
|
||||
|
||||
// Prevent $end from exceeding total found rows
|
||||
if ($end > $total_found_rows) {
|
||||
$end = $total_found_rows;
|
||||
}
|
||||
|
||||
// Now output something like "Showing X to Y of Z records"
|
||||
?>
|
||||
|
||||
<div class="col-sm mb-2">
|
||||
<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-3">
|
||||
<div class="col-sm mb-2">
|
||||
|
||||
<ul class="pagination justify-content-sm-end">
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ $get_copy = $_GET; // create a copy of the $_GET array
|
||||
//unset($get_copy['page']);
|
||||
unset($get_copy['sort']);
|
||||
unset($get_copy['order']);
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
// Paging
|
||||
if (isset($_GET['page'])) {
|
||||
|
||||
@@ -38,7 +38,9 @@ if (str_contains(basename($_SERVER["PHP_SELF"]), "admin_")) { ?>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="plugins/adminlte/js/adminlte.min.js"></script>
|
||||
<script src="js/app.js"></script>
|
||||
<script src="js/ajax_modal.js"></script>
|
||||
<script src="js/confirm_modal.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
34
includes/get_side_nav_counts.php
Normal file
34
includes/get_side_nav_counts.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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 WHERE ticket_archived_at IS NULL AND ticket_closed_at IS NULL AND ticket_status != 4"));
|
||||
$num_active_tickets = $row['num'];
|
||||
|
||||
// Recurring Ticket Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('scheduled_ticket_id') AS num FROM scheduled_tickets"));
|
||||
$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_id') AS num FROM recurring WHERE recurring_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'];
|
||||
@@ -40,29 +40,7 @@ header("X-Frame-Options: DENY");
|
||||
<link href="plugins/toastr/toastr.min.css" rel="stylesheet">
|
||||
<link href="plugins/DataTables/datatables.min.css" rel="stylesheet">
|
||||
<!-- CSS to allow regular button to show as block button in mobile response view using the class btn-responsive -->
|
||||
<style>
|
||||
/*
|
||||
For screens below 576px (xs):
|
||||
- Make the button full-width, display:block
|
||||
*/
|
||||
@media (max-width: 575.98px) {
|
||||
.btn-responsive {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
For screens 576px (sm) and above:
|
||||
- Revert to an inline style
|
||||
*/
|
||||
@media (min-width: 576px) {
|
||||
.btn-responsive {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link href="css/itflow_custom.css" rel="stylesheet">
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="plugins/jquery/jquery.min.js"></script>
|
||||
|
||||
@@ -6,47 +6,8 @@ require_once "check_login.php";
|
||||
require_once "page_title.php";
|
||||
require_once "header.php";
|
||||
require_once "top_nav.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"));
|
||||
$num_active_clients = $row['num'];
|
||||
|
||||
// Active Ticket Count
|
||||
$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"));
|
||||
$num_active_tickets = $row['num'];
|
||||
|
||||
// Recurring Ticket Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('scheduled_ticket_id') AS num FROM scheduled_tickets"));
|
||||
$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_id') AS num FROM recurring WHERE recurring_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'];
|
||||
|
||||
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";
|
||||
|
||||
?>
|
||||
|
||||
@@ -11,7 +11,10 @@
|
||||
<i class="fas fa-fw fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientModal<?php echo $client_id; ?>">
|
||||
<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) { ?>
|
||||
@@ -167,8 +170,5 @@
|
||||
|
||||
<?php
|
||||
|
||||
require_once "modals/client_edit_modal.php";
|
||||
|
||||
require_once "modals/client_delete_modal.php";
|
||||
|
||||
require_once "modals/client_download_pdf_modal.php";
|
||||
|
||||
@@ -15,81 +15,74 @@
|
||||
|
||||
<ul class="nav nav-pills nav-sidebar flex-column mt-2" data-widget="treeview" data-accordion="false">
|
||||
|
||||
<?php if ($config_module_enable_accounting == 1) { ?>
|
||||
<li class="nav-header">FINANCIAL</li>
|
||||
<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 if (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>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if (lookupUserPermission("module_sales") >= 1) { ?>
|
||||
<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 } ?>
|
||||
<?php } // End financial reports IF statement ?>
|
||||
|
||||
|
||||
<li class="nav-header">TECHNICAL</li>
|
||||
<?php if ($config_module_enable_ticketing) { ?>
|
||||
<?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>
|
||||
@@ -106,27 +99,29 @@
|
||||
<?php } ?>
|
||||
<?php if (lookupUserPermission("module_credential") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="report_password_rotation.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_password_rotation.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-life-ring"></i>
|
||||
<p>Password rotation</p>
|
||||
<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 } ?>
|
||||
|
||||
<li class="nav-header">OVERVIEWS</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="report_assets.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_assets.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-desktop"></i>
|
||||
<p>All Assets</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="report_domains.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_domains.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-globe"></i>
|
||||
<p>All Domains</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php if (lookupUserPermission("module_support") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="report_assets.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_assets.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-desktop"></i>
|
||||
<p>All Assets</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="report_domains.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_domains.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-globe"></i>
|
||||
<p>All Domains</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
|
||||
<?php if (lookupUserPermission("module_reporting") >= 1) { ?>
|
||||
<li class="nav-item mt-3">
|
||||
<a href="report_income_summary.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_income_summary.php") { echo "active"; } ?>">
|
||||
<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>
|
||||
|
||||
@@ -62,78 +62,25 @@
|
||||
|
||||
<!-- New Notifications Dropdown -->
|
||||
<?php
|
||||
$sql_notifications = mysqli_query($mysqli, "SELECT * FROM notifications
|
||||
LEFT JOIN clients ON notification_client_id = client_id
|
||||
WHERE notification_dismissed_at IS NULL
|
||||
AND notification_user_id = $session_user_id
|
||||
ORDER BY notification_id DESC LIMIT 8"
|
||||
);
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('notification_id') AS num FROM notifications WHERE notification_user_id = $session_user_id AND notification_dismissed_at IS NULL"));
|
||||
$num_notifications = $row['num'];
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($num_notifications > 0) { ?>
|
||||
<li class="nav-item dropdown" title="Notifications">
|
||||
<a class="nav-link" data-toggle="dropdown" href="#">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_notifications.php"
|
||||
>
|
||||
<i class="fas fa-bell"></i>
|
||||
<span class="badge badge-light badge-pill navbar-badge position-absolute" style="top: 1px; right: 3px;"><?php echo $num_notifications; ?></span>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-xlg dropdown-menu-right">
|
||||
<a href="notifications.php" class="dropdown-item dropdown-header">
|
||||
<i class="fas fa-bell mr-2"></i>
|
||||
<strong><?php echo $num_notifications; ?></strong>
|
||||
Notifications
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($sql_notifications)) {
|
||||
$notification_id = intval($row['notification_id']);
|
||||
$notification_type = nullable_htmlentities($row['notification_type']);
|
||||
$notification = nullable_htmlentities($row['notification']);
|
||||
$notification_action = nullable_htmlentities($row['notification_action']);
|
||||
$notification_timestamp = date('M d g:ia',strtotime($row['notification_timestamp']));
|
||||
$notification_client_id = intval($row['notification_client_id']);
|
||||
if(empty($notification_action)) { $notification_action = "#"; }
|
||||
?>
|
||||
<div class="dropdown-item">
|
||||
<a class="text-dark" href="<?php echo $notification_action; ?>">
|
||||
<p class="mb-1">
|
||||
<span class="text-bold"><i
|
||||
class="fas fa-bullhorn mr-2"></i><?php echo $notification_type; ?></span>
|
||||
<small class="text-muted mt-1 float-right"><?php echo $notification_timestamp; ?></small>
|
||||
</p>
|
||||
<small class="text-secondary"><?php echo $notification; ?></small>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php if ($num_notifications) { ?>
|
||||
<span class="badge badge-light badge-pill navbar-badge position-absolute" style="top: 1px; right: 3px;">
|
||||
<?php echo $num_notifications; ?>
|
||||
</span>
|
||||
<?php } ?>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="post.php?dismiss_all_notifications"
|
||||
class="dropdown-item dropdown-footer text-secondary text-bold"><i
|
||||
class="fas fa-check-double mr-2"></i>Dismiss all Notifications</a>
|
||||
</div>
|
||||
</li>
|
||||
<?php } else { ?>
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link" data-toggle="dropdown" href="#" aria-expanded="false">
|
||||
<i class="fas fa-bell"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu dropdown-menu-right" style="left: inherit; right: 0px;">
|
||||
<span class="dropdown-item dropdown-header">No Notifications</span>
|
||||
<div class="dropdown-divider"></div>
|
||||
<div class="text-center text-secondary p-3">
|
||||
<i class='far fa-4x fa-bell-slash'></i>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="notifications_dismissed.php" class="dropdown-item dropdown-footer">See Dismissed
|
||||
Notifications</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
<!-- End New Notifications Dropdown -->
|
||||
|
||||
|
||||
<li class="nav-item dropdown user-menu">
|
||||
<a href="#" class="nav-link" data-toggle="dropdown">
|
||||
<?php if (empty($session_avatar)) { ?>
|
||||
|
||||
Reference in New Issue
Block a user