Beispiel #1
0
 public function reportsAction()
 {
     $locationsModel = new Locations();
     $this->view->locations = $locationsModel->getAll();
     $employeesModel = new Employees();
     if ($this->_me->admin == 1) {
         $this->view->employees = $employeesModel->getAll();
     } else {
         $this->view->employees = $employeesModel->getAllByLocation($this->_me->location);
     }
     $recordsModel = new Records();
     $cols = $recordsModel->info(Zend_Db_Table_Abstract::COLS);
     $this->view->columns = $cols;
     $columnValues = array();
     foreach ($cols as $col) {
         if ($col != 'id' && $col != 'date') {
             $columnValues[$col] = $recordsModel->getValuesForColumns($col);
         }
     }
     $this->view->columnValues = $columnValues;
     /**
      * Added by Anatoly
      */
     $this->view->isAdmin = $this->_me->admin == 1;
 }