suche erste schritte

This commit is contained in:
Martin Müller 2014-03-29 21:39:56 +01:00
parent 73c6f7d87a
commit 2922ca2c55
3 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,42 @@
<?php
App::uses('AppController', 'Controller');
class SearchController extends AppController {
/**
* This controller use User Model
*
* @var array
*/
public $uses = array('DreamjobWorker','DreamjobJobOpening');
public $components = array('MiconwareSession');
/**
* Displays a view
*
* @param mixed What page to display
* @return void
* @throws NotFoundException When the view file could not be found
* or MissingViewException in debug mode.
*/
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');
}
}
}

View File

@ -0,0 +1,15 @@
<?php
/*
*
*/
?>
<div class="box">
<h1>Tempor&auml;re Suche</h1>
<div class="openinggroup">
<?php
foreach($openings as $opening){
echo $this->element('job_opening_item',array('opening' => $opening));
}
?>
</div>
</div>

View File

@ -0,0 +1,15 @@
<?php
/*
*
*/
?>
<div class="box">
<h1>Tempor&auml;re Suche</h1>
<div class="openinggroup">
<?php
foreach($workers as $worker){
echo $this->element('user_worker_item',array('profil' => $worker));
}
?>
</div>
</div>