indexController.php 793 B

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