indexController.php 897 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. $overRide = new unlockModel();
  25. $test = $overRide->rangeDates($this->userId);
  26. echo "<pre>";
  27. print_r($test);
  28. echo "</pre>";
  29. }
  30. }
  31. ?>