diff --git a/App/Models/Kategoria.php b/App/Models/Kategoria.php index 5ab83ed..d6d073a 100644 --- a/App/Models/Kategoria.php +++ b/App/Models/Kategoria.php @@ -35,21 +35,41 @@ public function getTrasa(): string return $this->trasa; } + private function getKmSpolu() :float + { + return $this->getKmVPlane() + $this->getKmVoVystavbe() + $this->getKmDokoncene(); + } + public function getKmDokoncene(): float { return $this->kmDokoncene; } + public function getKmPerDokoncene(): float + { + return $this->kmDokoncene / $this->getKmSpolu() * 100; + } + public function getKmVoVystavbe(): float { return $this->kmVoVystavbe; } + public function getKmPerVoVystavbe(): float + { + return $this->kmVoVystavbe / $this->getKmSpolu() * 100; + } + public function getKmVPlane(): float { return $this->kmVPlane; } + public function getKmPerVPlane(): float + { + return $this->kmVPlane / $this->getKmSpolu() * 100; + } + public function setNazov(string $nazov): void { $this->nazov = $nazov; diff --git a/App/Views/Home/dialnice.view.php b/App/Views/Home/dialnice.view.php index 65de7c6..ae1405f 100644 --- a/App/Views/Home/dialnice.view.php +++ b/App/Views/Home/dialnice.view.php @@ -5,166 +5,81 @@ use App\Models\Kategoria; ?> -
= $dialnica->getTrasa() ?>
+Bratislava - Košice - Vyšné Nemecké [SK-UA]
-Jarovce [AT-SK] - Devínska Nová Ves [SK-AT]
-