From ffe56a3576cdf9b30cb5581679b382afcc03a49c Mon Sep 17 00:00:00 2001 From: cp6 Date: Sun, 31 Jan 2021 00:31:11 +1100 Subject: [PATCH] Updated search to include tags and labels Updated search to include tags and labels --- class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/class.php b/class.php index 054dd22..36e1aa3 100644 --- a/class.php +++ b/class.php @@ -2108,11 +2108,11 @@ class idlers extends helperFunctions public function searchResults(string $search_term) { if (!empty($search_term)) { - $select = $this->dbConnect()->prepare("SELECT `id`, `hostname`,`ipv4`, `virt`, p.price, p.currency, p.term FROM `servers` INNER JOIN pricing p on servers.id = p.server_id WHERE `hostname` LIKE ? OR `ipv4` LIKE ? LIMIT 30;"); - $select->execute(["%$search_term%", "%$search_term%"]); + $select = $this->dbConnect()->prepare("SELECT `id`, `hostname`,`ipv4`, `virt`, `tags`, `label`, p.price, p.currency, p.term FROM `servers` INNER JOIN pricing p on servers.id = p.server_id WHERE `hostname` LIKE ? OR `ipv4` LIKE ? OR `tags` LIKE ? OR `label` LIKE ? LIMIT 30;"); + $select->execute(["%$search_term%", "%$search_term%", "%$search_term%", "%$search_term%"]); while ($row = $select->fetch(PDO::FETCH_ASSOC)) { $this->rowColOpen('row search-result', 'col-6'); - $this->outputString("

{$row['hostname']} {$row['ipv4']} {$row['virt']} {$row['price']} {$row['currency']} " . $this->paymentTerm($row['term']) . "

"); + $this->outputString("

{$row['hostname']} {$row['ipv4']} {$row['virt']} {$row['price']} {$row['currency']} " . $this->paymentTerm($row['term']) . " {$row['label']}

"); $this->tagClose('div'); $this->colOpen('col-3'); $this->outputString('View');