<?php /* * Copyright vms1-Scripte * $au = Autentifikation (Admin oder User) * $sicht = Standartmäßig auf 1 somit wird alles angezeigt * $sicht = 2 = nur für Gäste (nicht eingeloggt) * * function lkt_rally() muss nichts geändert werden * */ class MENUE{ private $db; private $num = 1; function __construct(){ global $datenbank; $this->db = $datenbank; } function menue_box($au,$sicht = 1){ if($au == 'Admin'){ $box = B_AD;}elseif($au == 'User'){ $box = B_US;}else{$box = '';} $bo = $this->db->get_results("SELECT id,name FROM ".PREFIX . $box ." WHERE sichtbar = '$sicht' ORDER BY ordnung ASC",true); foreach($bo AS $b){ head($b->name); $this->menue_punkt($b->id,$au); foot(); } } private function unterpunkte($id,$me){ $result = $this->db->get_results("SELECT link,name,id FROM ". PREFIX . $me ." WHERE uid = '$id' "); $aus = ''; foreach($result AS $res){ for($i = 0; $i <= $this->num; $i++){ $aus .= ' '; } $aus .= '<a href="?page=/'. $res->link .'">'. nl2br($res->name) .'</a><br>'; if($this->db->num_rows("SELECT id FROM ". PREFIX . $me ." WHERE uid = $res->id") != 0){$this->num++; $aus .= $this->unterpunkte($res->id,$me);} } return $aus; } public function menue_punkt($box,$au){ if($au == 'Admin'){ $me = M_AD;}elseif($au == 'User'){ $me = M_US;}else{ $au = '';} $men = $this->db->get_results("SELECT link,name,id FROM ".PREFIX . $me ." WHERE box = '$box' AND uid = '0' ORDER BY ordnung ASC",true); foreach($men AS $m){ echo '<a href="?page=/'. $m->link .'">'. nl2br($m->name) .'</a><br>'; if($this->db->num_rows("SELECT id FROM ". PREFIX . $me ." WHERE uid = $m->id") != 0){ $this->num = 1; echo $this->unterpunkte($m->id,$me);} } } function lkt_rally(){ head('LKT-Rallysystem'); echo '» <a href="?page=/LKT_Rallysystem"><strong>Rally / Positionen</strong></a><br>'; $rally = $this->db->get_results("SELECT id,name FROM ".PREFIX . RALLY ."",true); foreach($rally AS $r){ echo ' ↳ <a href="?page=/LKT_Rallysystem&rally= '. $r->id .'">'. $r->name .'></a><br>'; } foot(); } } ?>