Simplified Client URL Handling in global client header logic

This commit is contained in:
johnnyq
2025-02-19 15:58:43 -05:00
parent a2c77cf0c2
commit 2fe8adcfca
11 changed files with 69 additions and 45 deletions

View File

@@ -8,9 +8,11 @@ $order = "ASC";
if (isset($_GET['client_id'])) {
require_once "includes/inc_all_client.php";
$client_query = "AND vendor_client_id = $client_id";
$client_url = "client_id=$client_id&";
} else {
require_once "includes/inc_all.php";
$client_query = "AND vendor_client_id = 0";
$client_url = '';
}
$sql = mysqli_query(
@@ -54,7 +56,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
</div>
<div class="card-body">
<form autocomplete="off">
<?php if(isset($_GET['client_id'])) { ?>
<?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; ?>">
@@ -71,7 +73,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
<div class="col-md-8">
<div class="btn-group float-right">
<a href="?<?php if(isset($_GET['client_id'])) { echo "client_id=$client_id&"; } ?>archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
<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>