protected function initProject()
 {
     $projectDAO = new ProjectDAO();
     $siteDAO = new SiteDAO();
     $wellDAO = new WellDAO();
     foreach ($this->company as $company) {
         $this->project[$company['id']] = $projectDAO->getProjectByCompanyIdAndUserId($company['id'], $this->currentUser['id']);
         foreach ($this->project[$company['id']] as $project) {
             $this->site[$project['id']] = $siteDAO->getSiteByProjectIdAndUserId($project['id'], $this->currentUser['id']);
             foreach ($this->site[$project['id']] as $site) {
                 $this->well[$site['id']] = $wellDAO->getWellBySiteIdAndUserId($site['id'], $this->currentUser['id']);
             }
         }
     }
     //print_r($this->project);
     //print_r($this->site);
 }
 protected function getMenuData()
 {
     if (!empty($this->record['id'])) {
         $this->pagePath = $this->dao->getRecordPath($this->record['id']);
     } else {
         $daoClass = $this->getDAOClass();
         if ($daoClass == 'CompanyDAO') {
             $this->pagePath['companyName'] = 'New Comapny';
             $this->pagePath['comanyId'] = 0;
         } elseif ($daoClass == 'ProjectDAO') {
             $comapanyId = CoreServices2::getRequest()->getFromGet('comp');
             if (!empty($comapanyId)) {
                 $companyDAO = new CompanyDAO();
                 $this->pagePath = $companyDAO->getRecordPath($comapanyId);
             }
             $this->pagePath['projectName'] = 'New Project';
             $this->pagePath['projectId'] = 0;
         } elseif ($daoClass == 'SiteDAO') {
             $projectId = CoreServices2::getRequest()->getFromGet('proj');
             if (!empty($projectId)) {
                 $projectDAO = new ProjectDAO();
                 $this->pagePath = $projectDAO->getRecordPath($projectId);
             }
             $this->pagePath['siteName'] = 'New Site';
             $this->pagePath['siteId'] = 0;
         } elseif ($daoClass == 'WellDAO') {
             $siteId = CoreServices2::getRequest()->getFromGet('site');
             if (!empty($siteId)) {
                 $siteDAO = new SiteDAO();
                 $this->pagePath = $siteDAO->getRecordPath($siteId);
             }
             $this->pagePath['wellName'] = 'New Well';
             $this->pagePath['wellId'] = 0;
         }
     }
 }