Skip to content

Commit

Permalink
Merge pull request #955 from ssteeltm/master
Browse files Browse the repository at this point in the history
num active clients on menu
  • Loading branch information
johnnyq authored May 10, 2024
2 parents de7d68b + 4779e8f commit 2f3263c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client_file_upload_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<div class="modal-body bg-white">


<div class="form-group">
<label>Description</label>
<div class="input-group">
Expand Down Expand Up @@ -47,7 +47,7 @@
</div>

<div class="form-group">
<input type="file" class="form-control-file" name="file[]" multiple id="fileInput" accept=".jpg, .jpeg, .gif, .png, .webp, .pdf, .txt, .md, .doc, .docx, .odt, .csv, .xls, .xlsx, .ods, .pptx, .odp, .zip, .tar, .gz, .xml, .msg, .json, .wav, .mp3, .ogg, .mov, .mp4, .av1, .ovpn, .cfg, .ps1, .vsdx, .drawio, .pfx">
<input type="file" class="form-control-file" name="file[]" multiple id="fileInput" accept=".jpg, .jpeg, .gif, .png, .webp, .pdf, .txt, .md, .doc, .docx, .odt, .csv, .xls, .xlsx, .ods, .pptx, .odp, .zip, .tar, .gz, .xml, .msg, .json, .wav, .mp3, .ogg, .mov, .mp4, .av1, .ovpn, .cfg, .ps1, .vsdx, .drawio, .pfx, .unf">
</div>
<small class="text-secondary">Up to 20 files can be uploaded at once by holding down CTRL and selecting files</small>

Expand Down
4 changes: 4 additions & 0 deletions inc_all.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

// 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'];
Expand Down
2 changes: 1 addition & 1 deletion post/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'size' => $_FILES['file']['size'][$i]
];

if ($file_reference_name = checkFileUpload($single_file, array('jpg', 'jpeg', 'gif', 'png', 'webp', 'pdf', 'txt', 'md', 'doc', 'docx', 'odt', 'csv', 'xls', 'xlsx', 'ods', 'pptx', 'odp', 'zip', 'tar', 'gz', 'xml', 'msg', 'json', 'wav', 'mp3', 'ogg', 'mov', 'mp4', 'av1', 'ovpn', 'cfg', 'ps1', 'vsdx', 'drawio', 'pfx', 'pages', 'numbers'))) {
if ($file_reference_name = checkFileUpload($single_file, array('jpg', 'jpeg', 'gif', 'png', 'webp', 'pdf', 'txt', 'md', 'doc', 'docx', 'odt', 'csv', 'xls', 'xlsx', 'ods', 'pptx', 'odp', 'zip', 'tar', 'gz', 'xml', 'msg', 'json', 'wav', 'mp3', 'ogg', 'mov', 'mp4', 'av1', 'ovpn', 'cfg', 'ps1', 'vsdx', 'drawio', 'pfx', 'pages', 'numbers', 'unf'))) {

$file_tmp_path = $_FILES['file']['tmp_name'][$i];

Expand Down
7 changes: 6 additions & 1 deletion side_nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
<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-user-friends"></i>
<p>Clients</p>
<p>
Clients
<?php if ($num_active_clients) { ?>
<span class="right badge text-light"><?php echo $num_active_clients; ?></span>
<?php } ?>
</p>
</a>
</li>
<?php if ($session_user_role >= 2 && $config_module_enable_ticketing == 1) { ?>
Expand Down

0 comments on commit 2f3263c

Please sign in to comment.