application send

This commit is contained in:
Martin Müller 2014-03-05 22:01:30 +01:00
parent 8f1f4f4220
commit 10a7114fed
7 changed files with 59 additions and 48 deletions

View File

@ -24,7 +24,6 @@ class HomeController extends AppController {
public function home() {
$this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this);
$this->MiconwareSession->setFlash('In Entwicklung','flash',array('alert'=>'info'));
$openings = $this->DreamjobJobOpening->find('all',$this->home_opening_condition);
$this->set('openings',$openings);
$this->set('title', 'dreamjob.startpage');

View File

@ -116,7 +116,7 @@ class JobController extends AppController {
if(!empty($this->request->params['id'])){
if(!empty($this->request->params['favorite']) or count($this->request->params['favorite'])>0){
if(!empty($this->request->params['favorite']) and count($this->request->params['favorite'])>0){
$WORKER = $this->MiconwareSession->getWorker();
$fav=false;
foreach($WORKER['Favority'] as $val){
@ -300,6 +300,41 @@ class JobController extends AppController {
}
}
public function applicationSend() {
$this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this);
$w = $this->MiconwareSession->getWorker();
if(!empty($w)){
$opening = null;
if(!empty($this->request->params['id'])){
$opening = $this->DreamjobJobOpening->find('first',array('conditions' => array('DreamjobJobOpening.id' => $this->request->params['id'])));
}
if(!is_array($opening) or count($opening) <= 0 ){
$this->set('error', 'dreamjob.error.opening.notFound');
$this->render('/Home/error');
}else{
if ($this->request->is('post')) {
echo var_dump($this->request->data);
/*$this->DreamjobJobApplication->create($this->request->data);
$this->DreamjobJobOpening->worker_id = $w['AppUser']['id'];
$this->DreamjobJobOpening->opening_id = $this->request->params['id'];*/
if ($this->DreamjobJobOpening->saveAssociated($this->request->data)) {
$this->DreamjobJobOpening->worker_id = $w['AppUser']['id'];
$this->DreamjobJobOpening->opening_id = $this->request->params['id'];
if($this->DreamjobJobOpening->save()){
$this->MiconwareSession->setFlash('dreamjob.opening.save.add','flash',array('alert'=>'success'));
}else{
$this->MiconwareSession->setFlash('dreamjob.opening.save.error','flash',array('alert'=>'danger'));
}
}
}
$this->set('pages', $w['DreamjobPageInh']);
$this->set('opening', $opening);
$this->render('/Job/application_send');
}
}else{
$this->set('error', 'dreamjob.error.noCompany');
$this->render('/Home/error');
}
}
}
?>

View File

@ -17,10 +17,7 @@
</span>
</div>
<div class="box">
<div class="box-title">
<h3><?=$application['AppUser']['nickname']." ".$application['DreamjobCompany']['corporateform'];?></h3>
<h1><?=$application['DreamjobJobOpening']['title'];?></h1>
</div>
<?=$this->element('job_opening_head');?>
</div>
@ -114,18 +111,18 @@
}
?>
<?php
if($msg and !$application['DreamjobJobApplication']['closed']){
?>
<div class="box">
<?php echo $this->Form->create('DreamjobJobMsg',$default_Form); ?>
<fieldset>
<legend><?=__("dreamjob.message");?></legend>
<?=$this->Form->textarea('DreamjobJobMsg.text',array("class"=>'form-control',"rows"=>10)); ?>
<div style="text-align:right;margin-top:25px;">
<?=$this->Form->button(__('dreamjob.save'),array('div' => false,'class'=>"btn btn-default",'type' => 'submit'));?>
</div>
</fieldset>
<?php echo $this->Form->end(); ?>
if($msg and !$application['DreamjobJobApplication']['closed']){
?>
<div class="box">
<?php echo $this->Form->create('DreamjobJobMsg',$default_Form); ?>
<fieldset>
<legend><?=__("dreamjob.message");?></legend>
<?=$this->Form->textarea('DreamjobJobMsg.text',array("class"=>'form-control',"rows"=>10)); ?>
<div class="buttonrow">
<?=$this->Form->button(__('dreamjob.save'),array('div' => false,'class'=>"btn btn-default",'type' => 'submit'));?>
</div>
</fieldset>
<?php echo $this->Form->end(); ?>
</div>
<?php } ?>
<!-- /tab -->

View File

@ -4,10 +4,7 @@
*/
?>
<div class="box">
<div class="box-title">
<h3><?=$opening['AppUser']['nickname']." ".$opening['DreamjobCompany']['corporateform'];?></h3>
<h1><?=$opening['DreamjobJobOpening']['title'];?></h1>
</div>
<?=$this->element('job_opening_head');?>
</div>
<div id="tab" class="box">
<!-- tab -->

View File

@ -38,34 +38,13 @@
<?php } ?>
</div>
<div class="box">
<div class="box-title">
<h3><?=$opening['AppUser']['nickname']." ".$opening['DreamjobCompany']['corporateform'];?></h3>
<h1><?=$opening['DreamjobJobOpening']['title'];?></h1>
</div>
<p>
<h4><?=__("dreamjob.opening.titleinfo");?></h4>
<?=__("dreamjob.graducation.company");?>: <?=$opening['DreamjobListGraducation']['name'];?><br/>
<?=__("dreamjob.branch");?>: <?=$opening['DreamjobJobOpening']['branch'];?><br/>
<?=__("dreamjob.kindofjob");?>: <?=$opening['DreamjobListKindofjob']['name'];?><br/>
<span<?php if( time() > strtotime($opening['DreamjobJobOpening']['enddate'])){ ?> class="opening_outdate"<?php } ?>><?=__("dreamjob.opening.enddate");?>: <?=$this->Time->format('d.m.Y', $opening['DreamjobJobOpening']['enddate']);?></span>
</p>
<br/>
<p>
<h4><?=__("dreamjob.company.titleinfo");?></h4>
<?=__("dreamjob.company");?>: <?=$opening['AppUser']['nickname']." ".$opening['DreamjobCompany']['corporateform'];?><br/>
<?=__("dreamjob.headcount");?>: <?=$opening['DreamjobCompany']['headcount'];?><br/>
<?=__("dreamjob.owner");?>: <?=$opening['DreamjobCompany']['owner'];?>
</p>
<p>
<?=__("dreamjob.address");?>: <br/>
<?=$opening['DreamjobUser']['street'];?><br/>
<?=$opening['DreamjobUser']['postcode']." ".$opening['DreamjobUser']['city'];?>
</p>
<?=$this->element('job_opening_head');?>
<?=$this->element('job_opening_head_extra');?>
<br/>
<div>
<?=$opening['DreamjobJobOpening']['text'];?>
</div>
<div style="text-align:right;">
<div class="buttonrow">
<?php
echo $this->Html->link(__('dreamjob.applicate'),array('controller'=>'job', 'action'=>'openingGet', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => "btn btn-default"));
?>

View File

@ -45,7 +45,7 @@ echo $this->Form->create('DreamjobJobOpening',$default_Form);
echo $this->Form->input('DreamjobJobOpening.city',array("label" => array('text'=>__("dreamjob.city"),"class"=>$default_Form['inputDefaults']['label']['class']))); ?>
<legend><?=__("dreamjob.text");?></legend>
<?php echo $this->Form->textarea('DreamjobJobOpening.text',array("class"=>'form-control',"rows"=>10)); ?>
<div style="text-align:right;margin-top:25px;">
<div class="buttonrow">
<?=$this->Form->button(__('dreamjob.save'),array('div' => false,'class'=>"btn btn-default",'type' => 'submit'));?>
</div>
</fieldset>

View File

@ -245,6 +245,10 @@ body.loading #container{
font-weight: bold;
margin-top: 20px;
}
.buttonrow{
text-align:right;
margin-top:25px;
}
/*
* Opening
*/