Example #1
0
 public function viewSelectTimesheet()
 {
     if ($_SESSION['isAdmin'] == 'No' && !$_SESSION['isSupervisor']) {
         die('You are not authorized to view this page');
     }
     $path = "/templates/time/selectTimesheets.php";
     $dataArr = null;
     $employmentStatusObj = new EmploymentStatus();
     $dataArr[0] = $employmentStatusObj->getListofEmpStat(0, '', -1);
     if ($_SESSION['isSupervisor']) {
         $repObj = new EmpRepTo();
         $dataArr[1] = $repObj->getEmpSubDetails($_SESSION['empID']);
     }
     $template = new TemplateMerger($dataArr, $path);
     $template->display();
 }
 public function viewSelectTimesheet()
 {
     if ($_SESSION['isAdmin'] == 'No' && !$_SESSION['isSupervisor']) {
         die('You are not authorized to view this page');
     }
     $path = "/templates/time/selectTimesheets.php";
     $dataArr = null;
     $employmentStatusObj = new EmploymentStatus();
     $dataArr[0] = $employmentStatusObj->getListofEmpStat(0, '', -1, 1);
     if ($_SESSION['isSupervisor']) {
         $repObj = new EmpRepTo();
         $dataArr[1] = $repObj->getEmpSubDetails($_SESSION['empID']);
     }
     $dataArr['empList'] = array();
     /* Setting employee list for Auto-Complete */
     if ($this->authorizeObj->isAdmin()) {
         $dataArr['empList'] = EmpInfo::getEmployeeMainDetails();
     } elseif ($this->authorizeObj->isSupervisor()) {
         $dataArr['empList'] = $this->_getSubsForAutoComplete($_SESSION['empID']);
     }
     $template = new TemplateMerger($dataArr, $path);
     $template->display();
 }