--- db/prgsrc/drupal/modules/chgk_db/classes/DbEditor.class.php 2010/04/24 21:45:50 1.1 +++ db/prgsrc/drupal/modules/chgk_db/classes/DbEditor.class.php 2010/05/23 09:31:39 1.2 @@ -14,18 +14,33 @@ class DbEditor { $this->loadFromDatabase(); } } - public function getHtmlPage() { + + private function loadTours() { $res = $this->db->editorToursRes($this->id); $this->tours = array(); while ( $tourRow = db_fetch_object($res) ) { $this->tours[] =DbPackage::newFromRow($tourRow); } + } + + private function sortByYear() { + foreach ($this->tours as $tour) { + $this->years[$tour->getYear()][] = $tour; + } + } + + public function getHtmlPage() { + $this->loadTours(); + $this->sortByYear(); $output = ''; - $output .= ''; return $output; }