diff --git a/public/assets/css/front/listing.css b/public/assets/css/front/listing.css index 9539106..5c6b7bc 100644 --- a/public/assets/css/front/listing.css +++ b/public/assets/css/front/listing.css @@ -12,7 +12,6 @@ section[role="listings"] a { font-size: 2em; font-weight: bold; border: 0; - display: block; } section[role="listings"] a label { @@ -25,3 +24,13 @@ section[role="listings"] a label { section[role="listings"] a:hover { color: var(--white); } + +section[role="listings"] div[role="paginate"] { + padding: 5px; +} + +section[role="listings"] div[role="paginate"] span { + vertical-align: super; + font-weight: bold; + font-size: 1.5em; +} diff --git a/src/Service/HandleLocations.php b/src/Service/HandleLocations.php index f0dd5f1..f0e51d3 100644 --- a/src/Service/HandleLocations.php +++ b/src/Service/HandleLocations.php @@ -45,11 +45,18 @@ class HandleLocations $response = null; //$utils = new StringTools(); //$term = $utils->removeCommonWords($terms); - $terms = str_replace(",", "", $terms); - $terms = str_replace(" ", "|", $terms); + $rawSearch = $terms; + $terms = str_replace(",", "", $terms); + $terms = str_replace(" ", "|", $terms); try { $search = $this->connection->fetchAllAssociative("SELECT * FROM searchlocations('$terms')"); + $active = []; + foreach ($search as $item) { + if ($item["active"] == true) { + array_push($active, $item); + } + } } catch (PDOException $error) { $errorMessage = $error->getMessage(); } catch (DBALException $error) { @@ -71,8 +78,8 @@ class HandleLocations $response = [ "status" => true, "message" => "Good Reqeust", - "items" => $search, - "terms" => $terms, + "items" => $active, + "terms" => $rawSearch, ]; } diff --git a/templates/front/listing.twig b/templates/front/listing.twig index c31e129..ef86703 100644 --- a/templates/front/listing.twig +++ b/templates/front/listing.twig @@ -6,10 +6,20 @@ {% block main %}

The Bad Space Listings

-

Page - {{ options.currentPage }} - of - {{ options.list.total }}

+
+ + + + + Page + {{ options.currentPage }} + of + {{ options.list.total }} + + + + +
{% for location in options.list.locations %} @@ -17,7 +27,21 @@ {{ location.name }}
{% endfor %} - Previous - Next + +
+ + + + + Page + {{ options.currentPage }} + of + {{ options.list.total }} + + + + +
+
{% endblock %}