getUser($this->user); echo "
ERROR: User! ".$id." does not exist!
\n"; return false; } return true; } */ public function show($starttime, $endtime) { foreach($this->events as $event) { if($event->starttime > $starttime && $event->starttime < $endtime) $event->show(); } } public function getEvent($eid) { $event = $this->events[$eid]; return $event; } private function read() { $dom = new DomDocument; $dom->preserveWhiteSpace = FALSE; $dom->load($this->file); $events = $dom->getElementsByTagName('event'); foreach ($events as $e) { $event = new Event($e->getAttribute('eid'), $e->getAttribute('title'), $e->getAttribute('starttime'), $e->getAttribute('duration'), $e->getAttribute('description'), $e->getAttribute('user')); $this->add($event); } } public function Events($file) { $this->file = $file; if(file_exists($file)) $this->read(); } } ?>