indexController.php 863 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. class indexController extends Staple_Controller
  3. {
  4. private $authLevel;
  5. private $userId;
  6. public function _start()
  7. {
  8. $user = new userModel();
  9. $this->authLevel = $user->getAuthLevel();
  10. $this->userId = $user->getId();
  11. }
  12. public function index()
  13. {
  14. $this->view->authLevel = $this->authLevel;
  15. $messages = array("The library will be closed on Monday for whatever reason. Just remember to not come in!");
  16. //$this->view->messages = $messages;
  17. $timesheet = new timesheetModel(date('Y'),date('m'));
  18. $this->view->timesheet = $timesheet;
  19. $date = new DateTime();
  20. $week = $date->format('W');
  21. $year = $date->format('Y');
  22. $report = new weeklyReportModel();
  23. $this->view->week = $report->getWeekWorked($this->userId, $week, $year);
  24. $unlock = new unlockModel();
  25. $this->view->unlockedTimes = count($unlock->load($this->userId));
  26. }
  27. }
  28. ?>