Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class StaffsPage extends Page
- {
- public function __construct($template,$modelFactory)
- {
- parent::__construct($template,$modelFactory);
- $this->checkRank(0);
- $this->getTemplate()->MetaDesc = "Die Mitarbeiter kümmern sich um den reibungslosen Ablauf im Hotel.";
- }
- public function Main()
- {
- $this->loadNavigation(2,8);
- $userFactory = $this->getModelFactory()->getModel('UserFactory');
- $staffs = $userFactory->getStaffs();
- $this->getTemplate()->PageTitle = 'Mitarbeiter';
- $this->getTemplate()->staffs = $staffs;
- $this->getTemplate()->userFactory = $userFactory;
- $this->getTemplate()->display('staffs/New');
- }
- public function staffInfo($id) {
- $userFactory = $this->getModelFactory()->getModel('UserFactory');
- if(!is_null($userFactory->getUserById($id[0]))) {
- $user = $userFactory->getUserById($id[0]);
- if($user->rank > 2) {
- $this->getTemplate()->staff = $user;
- $this->getTemplate()->display('staffs/Ajax/Info');
- } else {
- $this->getTemplate()->display('staffs/Ajax/Error');
- }
- } else {
- $this->getTemplate()->display('staffs/Ajax/Error');
- }
- }
- public function staffStory($id) {
- $userFactory = $this->getModelFactory()->getModel('UserFactory');
- if(!is_null($userFactory->getUserById($id[0]))) {
- $user = $userFactory->getUserById($id[0]);
- if($user->rank > 2) {
- $this->getTemplate()->staff = $user;
- $this->getTemplate()->display('staffs/Ajax/Story');
- } else {
- $this->getTemplate()->display('staffs/Ajax/Error');
- }
- } else {
- $this->getTemplate()->display('staffs/Ajax/Error');
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement