version 1.1, 2010/04/24 21:45:50
|
version 1.2, 2010/05/23 09:31:39
|
Line 14 class DbEditor {
|
Line 14 class DbEditor {
|
$this->loadFromDatabase(); |
$this->loadFromDatabase(); |
} |
} |
} |
} |
public function getHtmlPage() { |
|
|
private function loadTours() { |
$res = $this->db->editorToursRes($this->id); |
$res = $this->db->editorToursRes($this->id); |
$this->tours = array(); |
$this->tours = array(); |
while ( $tourRow = db_fetch_object($res) ) { |
while ( $tourRow = db_fetch_object($res) ) { |
$this->tours[] =DbPackage::newFromRow($tourRow); |
$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 = ''; |
$output .= '<ul>'; |
foreach ($this->years as $year=>$tours) { |
foreach ($this->tours as $t) { |
$output .= "<h3>".$year."</h3>\n"; |
$output.="<li>".l($t->getFullTitle(),$t->getLink())."</li>\n"; |
$output .= '<ul>'; |
|
foreach ($tours as $t) { |
|
$output.="<li>".l($t->getFullTitle(),$t->getLink())."</li>\n"; |
|
} |
|
$output .= '</ul>'; |
} |
} |
$output .= '</ul>'; |
|
|
|
return $output; |
return $output; |
} |
} |