MiconwareSession->init($this); $this->MiconwareSession->initWeb($this); $con = $this->MiconwareSession->getOpeningCondition(); $openings = $this->DreamjobJobOpening->find('all',array('conditions' => $con)); $this->set("branches",$this->DreamjobListBranch->find('list')); $this->set("cities",$this->DreamjobListCity->find('list')); $this->set("graducations",$this->DreamjobListGraducation->find('list')); $this->set("kindofjobs",$this->DreamjobListKindofjob->find('list')); $this->set("openings",$openings); $this->render('/Search/searchopenings'); } public function listopening() { $this->MiconwareSession->init($this); $this->MiconwareSession->initWeb($this); $profil = $this->MiconwareSession->getCompany(); if(!empty($profil) and count($profil) > 0){ $workers = $this->DreamjobWorker->find('all',array('conditions' => array('DreamjobWorker.searchhidden'=>false))); $this->set("workers",$workers); $this->render('/Search/listworkers'); }else{ $con = $this->MiconwareSession->getOpeningCondition(); $openings = $this->DreamjobJobOpening->find('all',array('conditions' => $con)); $this->set("openings",$openings); $this->render('/Search/listopenings'); } } }