Advertisement
Guest User

HDhdajdf

a guest
Jul 29th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <?php
  2. class StaffsPage extends Page
  3. {
  4. public function __construct($template,$modelFactory)
  5. {
  6. parent::__construct($template,$modelFactory);
  7. $this->checkRank(0);
  8. $this->getTemplate()->MetaDesc = "Die Mitarbeiter k&uuml;mmern sich um den reibungslosen Ablauf im Hotel.";
  9. }
  10.  
  11. public function Main()
  12. {
  13.  
  14. $this->loadNavigation(2,8);
  15.  
  16. $userFactory = $this->getModelFactory()->getModel('UserFactory');
  17. $staffs = $userFactory->getStaffs();
  18.  
  19. $this->getTemplate()->PageTitle = 'Mitarbeiter';
  20. $this->getTemplate()->staffs = $staffs;
  21. $this->getTemplate()->userFactory = $userFactory;
  22. $this->getTemplate()->display('staffs/New');
  23. }
  24.  
  25. public function staffInfo($id) {
  26. $userFactory = $this->getModelFactory()->getModel('UserFactory');
  27. if(!is_null($userFactory->getUserById($id[0]))) {
  28. $user = $userFactory->getUserById($id[0]);
  29. if($user->rank > 2) {
  30. $this->getTemplate()->staff = $user;
  31. $this->getTemplate()->display('staffs/Ajax/Info');
  32. } else {
  33. $this->getTemplate()->display('staffs/Ajax/Error');
  34. }
  35. } else {
  36. $this->getTemplate()->display('staffs/Ajax/Error');
  37. }
  38. }
  39.  
  40. public function staffStory($id) {
  41. $userFactory = $this->getModelFactory()->getModel('UserFactory');
  42. if(!is_null($userFactory->getUserById($id[0]))) {
  43. $user = $userFactory->getUserById($id[0]);
  44. if($user->rank > 2) {
  45. $this->getTemplate()->staff = $user;
  46. $this->getTemplate()->display('staffs/Ajax/Story');
  47. } else {
  48. $this->getTemplate()->display('staffs/Ajax/Error');
  49. }
  50. } else {
  51. $this->getTemplate()->display('staffs/Ajax/Error');
  52. }
  53. }
  54.  
  55. }
  56. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement