From 714348877071d13e70ba503bd93a3bf661db198e Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 22 Nov 2021 02:38:34 +0100 Subject: [PATCH] update classes --- classen/RegionManager.php | 19 ++++++++++++++++++- classen/utils.php | 4 ++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/classen/RegionManager.php b/classen/RegionManager.php index 5db63f2..8b453c7 100644 --- a/classen/RegionManager.php +++ b/classen/RegionManager.php @@ -18,7 +18,24 @@ function getNextRegion() { - return array_shift($this->allRegions); + global $RUNTIME; + + $region = array_shift($this->allRegions); + + if($region != null) + { + if(count($region) != 0) + { + $regionDescStatement = $RUNTIME['PDO']->prepare("SELECT ParcelDescription AS Description FROM parcels WHERE ParcelRegionUUID = ? LIMIT 1"); + $regionDescStatement->execute(array($region['UUID'])); + + if($row = $regionDescStatement->fetch()) + $region['Description'] = $row['Description']; + } + } + + + return $region; } public static function setOnlineTime($uuid) diff --git a/classen/utils.php b/classen/utils.php index 6354014..51f0b7e 100644 --- a/classen/utils.php +++ b/classen/utils.php @@ -119,7 +119,7 @@ function getTopRegionHTML($row) if(!file_exists("./data/RegionImages/".$row['Image'].".jpg")) $row['Image'] = "notFound"; - if(!isset($row['Description'])) + if(!isset($row['Description']) || trim($row['Description']) == "") $row['Description'] = "(Es wurde noch keine Beschreibung hinterlegt.)"; return '