Added Search
This commit is contained in:
+54
-38
@@ -25,8 +25,8 @@ if (isset($_GET['account_type'])) {
|
|||||||
$account_type_id_max = "39";
|
$account_type_id_max = "39";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$account_type_id_min = "10";
|
$account_type_id_min = "10";
|
||||||
$account_type_id_max = "39";
|
$account_type_id_max = "39";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -37,6 +37,7 @@ $sql = mysqli_query(
|
|||||||
WHERE account_type_$archive_query
|
WHERE account_type_$archive_query
|
||||||
AND account_type_id >= $account_type_id_min
|
AND account_type_id >= $account_type_id_min
|
||||||
AND account_type_id <= $account_type_id_max
|
AND account_type_id <= $account_type_id_max
|
||||||
|
AND (account_type_name LIKE '%$q%' OR account_type_description LIKE '%$q%' OR account_type_id LIKE '%$q%')
|
||||||
ORDER BY $sort $order"
|
ORDER BY $sort $order"
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -53,35 +54,50 @@ $num_rows = mysqli_num_rows($sql);
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="col-sm-8">
|
<form autocomplete="off">
|
||||||
<div class="btn-group float-right">
|
<div class="row">
|
||||||
<a href="settings_account_types.php" class="btn <?php if (!isset($_GET['account_type']) && !isset($_GET['archived'])) {
|
<div class="col-sm-4 mb-2">
|
||||||
echo 'btn-primary';
|
<div class="input-group">
|
||||||
} else {
|
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) {
|
||||||
echo 'btn-default';
|
echo stripslashes(nullable_htmlentities($q));
|
||||||
} ?>">All</a>
|
} ?>" placeholder="Search Categories">
|
||||||
<a href="?account_type=Assets" class="btn <?php if ($account_type == 'Assets') {
|
<div class="input-group-append">
|
||||||
echo 'btn-primary';
|
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||||
} else {
|
</div>
|
||||||
echo 'btn-default';
|
</div>
|
||||||
} ?>">Assets</a>
|
</div>
|
||||||
<a href="?account_type=Liabilities" class="btn <?php if ($account_type == 'Liabilities') {
|
<div class="col-sm-8">
|
||||||
echo 'btn-primary';
|
<div class="btn-group float-right">
|
||||||
} else {
|
<a href="settings_account_types.php" class="btn <?php if (!isset($_GET['account_type']) && !isset($_GET['archived'])) {
|
||||||
echo 'btn-default';
|
echo 'btn-primary';
|
||||||
} ?>">Liabilities</a>
|
} else {
|
||||||
<a href="?account_type=Equity" class="btn <?php if ($account_type == 'Equity') {
|
echo 'btn-default';
|
||||||
echo 'btn-primary';
|
} ?>">All</a>
|
||||||
} else {
|
<a href="?account_type=Assets" class="btn <?php if ($account_type == 'Assets') {
|
||||||
echo 'btn-default';
|
echo 'btn-primary';
|
||||||
} ?>">Equity</a>
|
} else {
|
||||||
<a href="?archived=1" class="btn <?php if ($_GET['archived']) {
|
echo 'btn-default';
|
||||||
echo 'btn-primary';
|
} ?>">Assets</a>
|
||||||
} else {
|
<a href="?account_type=Liabilities" class="btn <?php if ($account_type == 'Liabilities') {
|
||||||
echo 'btn-default';
|
echo 'btn-primary';
|
||||||
} ?>"><i class="fas fa-fw fa-archive mr-2"></i>Archived</a>
|
} else {
|
||||||
|
echo 'btn-default';
|
||||||
|
} ?>">Liabilities</a>
|
||||||
|
<a href="?account_type=Equity" class="btn <?php if ($account_type == 'Equity') {
|
||||||
|
echo 'btn-primary';
|
||||||
|
} else {
|
||||||
|
echo 'btn-default';
|
||||||
|
} ?>">Equity</a>
|
||||||
|
<a href="?archived=1" class="btn <?php if ($_GET['archived']) {
|
||||||
|
echo 'btn-primary';
|
||||||
|
} else {
|
||||||
|
echo 'btn-default';
|
||||||
|
} ?>"><i class="fas fa-fw fa-archive mr-2"></i>Archived</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
<table class="table table-striped table-borderless table-hover">
|
<table class="table table-striped table-borderless table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -123,15 +139,15 @@ $num_rows = mysqli_num_rows($sql);
|
|||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<?php if ($archived == NULL) { ?>
|
<?php if ($archived == NULL) { ?>
|
||||||
<a class="dropdown-item text-danger confirm-link"
|
<a class="dropdown-item text-danger confirm-link"
|
||||||
href="post.php?archive_account_type=<?php echo $account_type_id; ?>">
|
href="post.php?archive_account_type=<?php echo $account_type_id; ?>">
|
||||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
||||||
</a>
|
</a>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<a class="dropdown-item text-success confirm-link"
|
<a class="dropdown-item text-success confirm-link"
|
||||||
href="post.php?unarchive_account_type=<?php echo $account_type_id; ?>">
|
href="post.php?unarchive_account_type=<?php echo $account_type_id; ?>">
|
||||||
<i class="fas fa-fw fa-archive mr-2"></i>Unarchive
|
<i class="fas fa-fw fa-archive mr-2"></i>Unarchive
|
||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user