mirror of https://github.com/itflow-org/itflow
Updated Client Overview Entities to not show Archived client's Entities even though the entity may not be archived, also added Archive Searching to network and certificates also added unarchive capabilities to them as well
This commit is contained in:
parent
350697869b
commit
55a31865d0
20
assets.php
20
assets.php
|
|
@ -9,10 +9,26 @@ if (isset($_GET['client_id'])) {
|
|||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND asset_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "asset_archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "asset_archived_at IS NULL";
|
||||
}
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "(client_archived_at IS NOT NULL OR asset_archived_at IS NOT NULL)";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "(client_archived_at IS NULL AND asset_archived_at IS NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
// Perms
|
||||
|
|
@ -71,7 +87,7 @@ $row = mysqli_fetch_assoc(mysqli_query($mysqli, "
|
|||
LEFT JOIN contacts ON asset_contact_id = contact_id
|
||||
LEFT JOIN locations ON asset_location_id = location_id
|
||||
LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
|
||||
WHERE asset_$archive_query
|
||||
WHERE $archive_query
|
||||
$access_permission_query
|
||||
$client_query
|
||||
) AS filtered_assets;
|
||||
|
|
@ -105,7 +121,7 @@ $sql = mysqli_query(
|
|||
LEFT JOIN contacts ON asset_contact_id = contact_id
|
||||
LEFT JOIN locations ON asset_location_id = location_id
|
||||
LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
|
||||
WHERE asset_$archive_query
|
||||
WHERE $archive_query
|
||||
AND (asset_name LIKE '%$q%' OR asset_description LIKE '%$q%' OR asset_type LIKE '%$q%' OR interface_ip LIKE '%$q%' OR interface_ipv6 LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial LIKE '%$q%' OR asset_os LIKE '%$q%' OR contact_name LIKE '%$q%' OR location_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
AND ($type_query)
|
||||
$access_permission_query
|
||||
|
|
|
|||
|
|
@ -9,10 +9,26 @@ if (isset($_GET['client_id'])) {
|
|||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND certificate_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "certificate_archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "certificate_archived_at IS NULL";
|
||||
}
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "(client_archived_at IS NOT NULL OR certificate_archived_at IS NOT NULL)";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "(client_archived_at IS NULL AND certificate_archived_at IS NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
// Perms
|
||||
|
|
@ -32,7 +48,7 @@ if (!$client_url) {
|
|||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM certificates
|
||||
LEFT JOIN clients ON client_id = certificate_client_id
|
||||
WHERE certificate_archived_at IS NULL
|
||||
WHERE $archive_query
|
||||
AND (certificate_name LIKE '%$q%' OR certificate_domain LIKE '%$q%' OR certificate_issued_by LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$access_permission_query
|
||||
$client_query
|
||||
|
|
@ -65,6 +81,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php if ($client_url) { ?>
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } ?>
|
||||
<input type="hidden" name="archived" value="<?php echo $archived; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
|
|
@ -109,6 +126,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="col-md-6">
|
||||
<div class="btn-group float-right">
|
||||
<a href="?<?php echo $client_url; ?>archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
|
||||
class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"; } ?>">
|
||||
<i class="fa fa-fw fa-archive mr-2"></i>Archived
|
||||
</a>
|
||||
<div class="dropdown ml-2" id="bulkActionButton" hidden>
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-fw fa-layer-group mr-2"></i>Bulk Action (<span id="selectedCount">0</span>)
|
||||
|
|
@ -182,6 +203,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$certificate_issued_by = nullable_htmlentities($row['certificate_issued_by']);
|
||||
$certificate_expire = nullable_htmlentities($row['certificate_expire']);
|
||||
$certificate_created_at = nullable_htmlentities($row['certificate_created_at']);
|
||||
$certificate_archived_at = nullable_htmlentities($row['certificate_archived_at']);
|
||||
|
||||
$certificate_expire_ago = timeAgo($certificate_expire);
|
||||
// Convert the expiry date to a timestamp
|
||||
|
|
@ -250,14 +272,22 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<?php if ($certificate_archived_at) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_certificate=<?php echo $certificate_id; ?>">
|
||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
||||
<a class="dropdown-item text-info confirm-link" href="post.php?unarchive_certificate=<?php echo $certificate_id; ?>">
|
||||
<i class="fas fa-fw fa-redo mr-2"></i>Restore
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_certificate=<?php echo $certificate_id; ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_certificate=<?php echo $certificate_id; ?>">
|
||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
18
contacts.php
18
contacts.php
|
|
@ -9,10 +9,26 @@ if (isset($_GET['client_id'])) {
|
|||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND contact_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "contact_archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "contact_archived_at IS NULL";
|
||||
}
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "(client_archived_at IS NOT NULL OR contact_archived_at IS NOT NULL)";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "(client_archived_at IS NULL AND contact_archived_at IS NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
// Tags Filter
|
||||
|
|
@ -55,7 +71,7 @@ $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS contacts.*, clients.*,
|
|||
LEFT JOIN users ON user_id = contact_user_id
|
||||
LEFT JOIN contact_tags ON contact_tags.contact_id = contacts.contact_id
|
||||
LEFT JOIN tags ON tags.tag_id = contact_tags.tag_id
|
||||
WHERE contact_$archive_query
|
||||
WHERE $archive_query
|
||||
$tag_query
|
||||
AND (contact_name LIKE '%$q%' OR contact_title LIKE '%$q%' OR location_name LIKE '%$q%' OR contact_email LIKE '%$q%' OR contact_department LIKE '%$q%' OR contact_phone LIKE '%$phone_query%' OR contact_extension LIKE '%$q%' OR contact_mobile LIKE '%$phone_query%' OR tag_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$access_permission_query
|
||||
|
|
|
|||
|
|
@ -9,12 +9,30 @@ if (isset($_GET['client_id'])) {
|
|||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND credential_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "c.credential_archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "c.credential_archived_at IS NULL";
|
||||
}
|
||||
|
||||
// Log when users load the Credentials page
|
||||
logAction("Credential", "View", "$session_name viewed the Credentials page for client", $client_id);
|
||||
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "(client_archived_at IS NOT NULL OR c.credential_archived_at IS NOT NULL)";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "(client_archived_at IS NULL AND c.credential_archived_at IS NULL)";
|
||||
}
|
||||
// Log when users load the Credentials page
|
||||
logAction("Credential", "View", "$session_name viewed the All Credentials page");
|
||||
}
|
||||
|
|
@ -68,7 +86,7 @@ $sql = mysqli_query(
|
|||
LEFT JOIN contacts ON contact_id = credential_contact_id
|
||||
LEFT JOIN assets ON asset_id = credential_asset_id
|
||||
$location_query_innerjoin
|
||||
WHERE c.credential_$archive_query
|
||||
WHERE $archive_query
|
||||
$tag_query
|
||||
AND (c.credential_name LIKE '%$q%' OR c.credential_description LIKE '%$q%' OR c.credential_uri LIKE '%$q%' OR tag_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$location_query
|
||||
|
|
|
|||
|
|
@ -9,6 +9,14 @@ if (isset($_GET['client_id'])) {
|
|||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND location_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "location_archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "location_archived_at IS NULL";
|
||||
}
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
|
|
@ -25,6 +33,14 @@ if (!$client_url) {
|
|||
$client_query = '';
|
||||
$client = '';
|
||||
}
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "(client_archived_at IS NOT NULL OR location_archived_at IS NOT NULL)";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "(client_archived_at IS NULL AND location_archived_at IS NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
// Tags Filter
|
||||
|
|
@ -45,7 +61,7 @@ $sql = mysqli_query(
|
|||
LEFT JOIN clients ON client_id = location_client_id
|
||||
LEFT JOIN location_tags ON location_tags.location_id = locations.location_id
|
||||
LEFT JOIN tags ON tags.tag_id = location_tags.tag_id
|
||||
WHERE location_$archive_query
|
||||
WHERE $archive_query
|
||||
$tag_query
|
||||
AND (location_name LIKE '%$q%' OR location_description LIKE '%$q%' OR location_address LIKE '%$q%' OR location_city LIKE '%$q%' OR location_state LIKE '%$q%' OR location_zip LIKE '%$q%' OR location_country LIKE '%$q%' OR location_phone LIKE '%$phone_query%' OR tag_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$access_permission_query
|
||||
|
|
|
|||
35
networks.php
35
networks.php
|
|
@ -9,10 +9,26 @@ if (isset($_GET['client_id'])) {
|
|||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND network_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "network_archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "network_archived_at IS NULL";
|
||||
}
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "(client_archived_at IS NOT NULL OR network_archived_at IS NOT NULL)";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "(client_archived_at IS NULL AND network_archived_at IS NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
// Perms
|
||||
|
|
@ -45,7 +61,7 @@ $sql = mysqli_query(
|
|||
"SELECT SQL_CALC_FOUND_ROWS * FROM networks
|
||||
LEFT JOIN clients ON client_id = network_client_id
|
||||
LEFT JOIN locations ON location_id = network_location_id
|
||||
WHERE network_$archive_query
|
||||
WHERE $archive_query
|
||||
AND (network_name LIKE '%$q%' OR network_description LIKE '%$q%' OR network_vlan LIKE '%$q%' OR network LIKE '%$q%' OR network_gateway LIKE '%$q%' OR network_subnet LIKE '%$q%' OR network_primary_dns LIKE '%$q%' OR network_secondary_dns LIKE '%$q%' OR network_dhcp_range LIKE '%$q%' OR location_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$access_permission_query
|
||||
$location_query
|
||||
|
|
@ -80,6 +96,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php if ($client_url) { ?>
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } ?>
|
||||
<input type="hidden" name="archived" value="<?php echo $archived; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
|
|
@ -150,6 +167,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="col-md-6">
|
||||
<div class="btn-group float-right">
|
||||
<a href="?<?php echo $client_url; ?>archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
|
||||
class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"; } ?>">
|
||||
<i class="fa fa-fw fa-archive mr-2"></i>Archived
|
||||
</a>
|
||||
<div class="dropdown ml-2" id="bulkActionButton" hidden>
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-fw fa-layer-group mr-2"></i>Bulk Action (<span id="selectedCount">0</span>)
|
||||
|
|
@ -263,6 +284,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
} else {
|
||||
$location_name_display = $location_name;
|
||||
}
|
||||
$network_archived_at = nullable_htmlentities($row['network_archived_at']);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
|
|
@ -312,14 +334,21 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<?php if ($network_archived_at) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_network=<?php echo $network_id; ?>">
|
||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
||||
<a class="dropdown-item text-info confirm-link" href="post.php?unarchive_network=<?php echo $network_id; ?>">
|
||||
<i class="fas fa-fw fa-redo mr-2"></i>Restore
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_network=<?php echo $network_id; ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_network=<?php echo $network_id; ?>">
|
||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -132,6 +132,29 @@ if (isset($_GET['archive_certificate'])) {
|
|||
|
||||
}
|
||||
|
||||
if (isset($_GET['unarchive_certificate'])) {
|
||||
|
||||
enforceUserPermission('module_support', 2);
|
||||
|
||||
$certificate_id = intval($_GET['unarchive_certificate']);
|
||||
|
||||
// Get Certificate Name and Client ID for logging and alert message
|
||||
$sql = mysqli_query($mysqli,"SELECT certificate_name, certificate_client_id FROM certificates WHERE certificate_id = $certificate_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$certificate_name = sanitizeInput($row['certificate_name']);
|
||||
$client_id = intval($row['certificate_client_id']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE certificates SET certificate_archived_at = NULL WHERE certificate_id = $certificate_id");
|
||||
|
||||
// logging
|
||||
logAction("Certificate", "Unarchive", "$session_name restored certificate $certificate_name", $client_id, $certificate_id);
|
||||
|
||||
$_SESSION['alert_message'] = "Certificate <strong>$certificate_name</strong> restored";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if (isset($_GET['delete_certificate'])) {
|
||||
|
||||
enforceUserPermission('module_support', 3);
|
||||
|
|
|
|||
|
|
@ -67,6 +67,29 @@ if (isset($_GET['archive_network'])) {
|
|||
|
||||
}
|
||||
|
||||
if (isset($_GET['unarchive_network'])) {
|
||||
|
||||
enforceUserPermission('module_support', 2);
|
||||
|
||||
$network_id = intval($_GET['unarchive_network']);
|
||||
|
||||
// Get Network Name and Client ID for logging and alert message
|
||||
$sql = mysqli_query($mysqli,"SELECT network_name, network_client_id FROM networks WHERE network_id = $network_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$network_name = sanitizeInput($row['network_name']);
|
||||
$client_id = intval($row['network_client_id']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE networks SET network_archived_at = NULL WHERE network_id = $network_id");
|
||||
|
||||
// logging
|
||||
logAction("Network", "Unarchive", "$session_name restored contact $contact_name", $client_id, $network_id);
|
||||
|
||||
$_SESSION['alert_message'] = "Network <strong>$network_name</strong> restored";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if (isset($_GET['delete_network'])) {
|
||||
enforceUserPermission('module_support', 3);
|
||||
|
||||
|
|
|
|||
18
software.php
18
software.php
|
|
@ -9,10 +9,26 @@ if (isset($_GET['client_id'])) {
|
|||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND software_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "software_archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "software_archived_at IS NULL";
|
||||
}
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "(client_archived_at IS NOT NULL OR software_archived_at IS NOT NULL)";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "(client_archived_at IS NULL AND software_archived_at IS NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
// Perms
|
||||
|
|
@ -36,7 +52,7 @@ $sql = mysqli_query(
|
|||
LEFT JOIN clients ON client_id = software_client_id
|
||||
LEFT JOIN vendors ON vendor_id = software_vendor_id
|
||||
WHERE software_template = 0
|
||||
AND software_$archive_query
|
||||
AND $archive_query
|
||||
AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_key LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$access_permission_query
|
||||
$client_query
|
||||
|
|
|
|||
Loading…
Reference in New Issue