shorted show_archive to just archived

This commit is contained in:
johnnyq 2023-09-26 15:28:26 -04:00
parent 35055489e5
commit 7848043a40
2 changed files with 9 additions and 9 deletions

View File

@ -47,7 +47,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="show_archived" value="<?php echo $show_archived; ?>">
<input type="hidden" name="archived" value="<?php echo $archived; ?>">
<div class="row">
<div class="col-md-4">
@ -61,10 +61,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
<div class="col-md-8">
<div class="float-right">
<?php if($show_archived == 1){ ?>
<a href="?client_id=<?php echo $client_id; ?>&show_archived=0" class="btn btn-primary"><i class="fa fa-fw fa-archive mr-2"></i>Show Archived</a>
<?php if($archived == 1){ ?>
<a href="?client_id=<?php echo $client_id; ?>&archived=0" class="btn btn-primary"><i class="fa fa-fw fa-archive mr-2"></i>Show Archived</a>
<?php } else { ?>
<a href="?client_id=<?php echo $client_id; ?>&show_archived=1" class="btn btn-default"><i class="fa fa-fw fa-archive mr-2"></i>
<a href="?client_id=<?php echo $client_id; ?>&archived=1" class="btn btn-default"><i class="fa fa-fw fa-archive mr-2"></i>
Show Archived</a>
<?php } ?>
</div>

View File

@ -99,15 +99,15 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
$dtt = date('Y-m-d');
}
// Archived
$show_archived = 0;
if (isset($_GET['show_archived'])) {
$show_archived = intval($_GET['show_archived']);
$archived = 0;
if (isset($_GET['archived'])) {
$archived = intval($_GET['archived']);
}
if($show_archived == 1){
if($archived == 1){
$archive_query = "archived_at IS NOT NULL";
} else {
$archive_query = "archived_at IS NULL";