self = $self; $this->setVars(); } public function setVars() { $fileName = "inc/navigationVars.txt"; $fileStream = fopen($fileName,"r+"); $fileString = fread($fileStream, filesize($fileName)); fclose($fileStream); $fileStringArray = explode( "\n", $fileString ); for ( $i = 0; $i < sizeof($fileStringArray); $i++ ) { $this->vars[$i] = $fileStringArray[$i]; } } public function setCurrentVar($var, $value) { $this->currentVars[$var] = $value; } public function getUrlWith($var, $value) { for ( $i = 0; $i < sizeof($this->vars); $i++ ) { if ( isset($this->currentVars[$i])) { $parameters[$i] = $this->currentVars[$i]; } } if ( !is_array($value) ) { $valueArray = $value; unset($value); $value[0] = $valueArray; } if ( !is_array($var) ) { $varArray = $var; unset($var); $var[0] = $varArray; } for ( $i = 0; $i < sizeof($var); $i++ ) { $parameters[$var[$i]] = $value[$i]; } $url2 = ""; for ( $i = 0; $i <= sizeof($parameters); $i++ ) { if ( isset($parameters[$i]) ) { if ( $i == 0 ) { $url2 .= $parameters[$i]; } else if ( $i == 1 ) { $url2 .= "?".$this->vars[$i]."=".$parameters[$i]; } else { $url2 .= "&".$this->vars[$i]."=".$parameters[$i]; } } } return $url2; } public function setCurrentUrl($url) { $this->currentUrl = $url; } public function setCurrentSelf($self) { $this->currentSelf = $self; } public function setCurrentPageId($pageId) { $this->currentPageId = $pageId; } public function setCurrentLang($lang) { $this->currentLang = $lang; } public function getUrl() { $url = $this->self."?pageId=".$this->pageId."&lang=".$this->lang; return $url; } public function setPageId($pageId) { $this->pageId = $pageId; } public function setLang($lang) { $this->lang = $lang; } public function getCurrentUrl() { return $this->currentUrl; } public function getBackLink($pageId) { return "Zurück
"; } public function getRedirectWith($timeout,$variable,$value) { return "Refresh: $timeout; url=".$this->getUrlWith($variable,$value); } } ?>database = $database; $this->dataManager = new DataManager($database); } public function setId($id) { $this->id = $id; } public function getId() { return $this->id; } public function get($state=10) { /*$bla = 0; $rsUser = $this->database->select("user","name, email, status, gender, birthdate, realName, description, avatar, games, location, homepage, lastUpdated","id = $this->id" ); if ( $this->database->numRows($rsUser) > 0 ) { $rowUser = $this->database->fetchAssoc($rsUser); $bla = $rowUser['name']; } return $bla;*/ $userSelect = $this->database->select("user","name, email, status, gender, birthdate, realName, description, avatar, games, location, homepage, lastUpdated","id = $this->id"); $userNumRows = $this->database->numRows($userSelect); if ( $userNumRows != 1 ) { echo "Der gesuchte User wurde nicht gefunden. Möglicherweise hat sich dieser löschen lassen/wurde gelöscht."; } else { $userRow = $this->database->fetchAssoc($userSelect); $this->name = $userRow['name']; $this->lastUpdated = $userRow['lastUpdated']; $this->email = $userRow['email']; $this->homepage = $userRow['homepage']; $this->location = $userRow['location']; $this->games = $userRow['games']; $this->birthdate = $userRow['birthdate']; $this->realName = $userRow['realName']; $this->description = $userRow['description']; $this->gender = $userRow['gender']; $this->avatar = $userRow['avatar']; } } public function getEdit($id = 0) { /*$edit = ''; if ( $newsId > 0 ) { $rsNews = $this->database->select("news","state, header, text, id","id='$newsId'"); if ( $this->database->numRows($rsNews) > 0 ) { $rowNews = $this->database->fetchRow($rsNews); } } $edit .= $this->dataManager->getCodeCheckbox("delete","delete")."Löschen"; $edit .= ""; $edit .= ""; $edit .= ""; $edit .= ""; $edit .= "
Status:".$this->dataManager->getCodeSelect("state",$this->state,$rowNews[0])."
Titel:".$this->dataManager->getCodeTextfield("header",$rowNews[1],"size=50")."
Text:".$this->dataManager->getCodeTextarea("text",$rowNews[2],"cols=100 rows=20")."
"; return $edit;*/ } public function load() { $userSelect = $this->database->select("user", "name, lastUpdated, email", "id = $this->id"); $userNumRows = $this->database->numRows($userSelect); if ( $userNumRows != 1 ) { echo "Der gesuchte User wurde nicht gefunden. Möglicherweise hat sich dieser löschen lassen/wurde gelöscht."; } else { $user = $this->database->fetchRow($userSelect); $this->name = $user[0]; $this->lastUpdated = $user[1]; $this->email = $user[2]; } } public function create() { $this->key = random_string("32"); $this->database->insert("user", "name, password, email, status, key", "$this->userName, $this->password, $this->email, $this->status, $this->key"); } public function save() { echo "save"; } public function setOnline($flag) { if($flag == 1) { $this->database->insert("userOnline","userId","$this->id"); } else { $this->database->delete("userOnline", "userId = $this->id"); } } public function getMessagesReceived() { $messages = $this->database->select("userMessage", "userMessage.id, userMessage.userIdWriter, userMessage.subject, userMessage.sendDate, user.name", "userIdReceiver = $this->id INNER JOIN ON userMessage.userIdWriter = user.id"); return $messages; } public function getMessagesSent() { $messages = $this->database->select("userMessage", "userMessage.id, userMessage.userIdReceiver, userMessage.subject, userMessage.sendDate, user.name", "userIdReceiver = $this->id INNER JOIN ON userMessage.userIdReceiver = user.id"); return $messages; } public function getName() { return $this->name; } public function setName($name) { $this->name = $name; } public function setPassword($password) { $this->password = $password; } public function setStatus($status) { $this->status = $status; } public function getStatus() { return $this->status; } public function getEmail() { return $this->email; } public function setEmail($email) { $this->email = $email; } public function getGender() { return $this->gender; } public function setGender($gender) { $this->gender = $gender; } public function getBirthdate() { return $this->birthdate; } public function setBirthdate($birthdate) { $this->birthdate = $birthdate; } public function getGames() { return $this->games; } public function getRealName() { return $this->realName; } public function setRealName($realName) { $this->realName = $realName; } public function getDescription() { return $this->description; } public function setDescription($description) { $this->description = $description; } public function getLastUpdated() { return $this->lastUpdated; } public function getKey() { return $this->key; } public function getLocation() { return $this->location; } public function getHomepage() { return $this->homepage; } public function getAvatar() { return "img/User/".$this->avatar.".jpg"; } public function setAvatar($avatar) { $this->avatar = $avatar; } private function random_string($length,$characters='abcdefghijklmnopqrstuvwxyz0123456789') { $random_string = ''; $characters_length = strlen($characters); for($i=0;$i<$length;$i++) { $random_string .= $characters[mt_rand(0, $characters_length - 1)]; } return $random_string; } } ?>database = $database; } public function setVariables($variables, $type=0) { if ( !is_array($varibles) ) { $varArray = $variables; unset($variables); $variables[0] = $varArray; } if ( !is_array($type) ) { $typeArray = $type; unset($type); $type[0] = $typeArray; } for ( $i = 0; $i < sizeof($variables); $i++ ) { $this->variables[$i][0] = $type[$i]; $this->variables[$i][1] = $variables[$i]; } } public function getValues() { return "values"; } public function setTable($table) { $this->table = $table; } public function createSql($variables) { } public function getEditForm($variable) { } public function getCodeSelect($name,$options,$selected="",$size=1,$arguments="") { $select = ""; return $select; } public function getCodeTextfield($name, $value="",$arguments="") { $textfield = ""; return $textfield; } public function getCodeTextarea($name,$value="",$arguments="") { $textarea = ""; return $textarea; } public function getCodeCheckbox( $name, $value="", $arguments="" ) { $checkbox = ""; return $checkbox; } public function update( $table, $variables, $values, $where=1 ) { $updateString = ""; if ( !is_array($variables) ) { $variableshelp = $variables; unset($variables); $variables[0] = $variableshelp; $valueshelp = $values; unset($values); $values[0] = $valueshelp; } for ( $i = 0; $i < sizeof($variables) ; $i++ ) { $updateString .= $variables[$i]."='".$values[$i]."',"; } $updateString = substr( $updateString, 0 , strlen($updateString)-1); $this->database->update($table,$updateString,$where); } public function insert ( $table, $variables, $values ) { $variablesString = ""; $valuesString = ""; if ( !is_array($variables) ) { $variableshelp = $variables; unset($variables); $variables[0] = $variableshelp; $valueshelp = $values; unset($values); $values[0] = $valueshelp; } for ( $i = 0; $i < sizeof($variables) ; $i++ ) { $variablesString .= $variables[$i].","; $valuesString .= $values[$i].","; } $variablesString = substr( $variablesString, 0 , strlen($variablesString)-1); $valuesString = substr( $valuesString, 0 , strlen($valuesString)-1); return $this->database->insert($table, $variablesString, $valuesString); } public function delete ( $table, $where ) { return $this->database->delete($table,$where); } } ?> database = $database; } public function getUserName($id) { $rsUsername = $this->database->select("user","name"); $username = $this->database->fetchRow($rsUsername); return $username[0]; } }
Fatal error: Class 'Navigation' not found in /urlrpfek/www.urlaubsservice.at/request.php on line 21