application fertig (send) + startseite

This commit is contained in:
Martin Müller 2014-03-10 23:53:06 +01:00
parent 5782499cb6
commit f138ce8a22
7 changed files with 63 additions and 19 deletions

View File

@ -313,19 +313,24 @@ class JobController extends AppController {
$this->render('/Home/error'); $this->render('/Home/error');
}else{ }else{
if ($this->request->is('post')){ if ($this->request->is('post')){
if($this->request->data['DreamjobJobApplication']['agb']) {
unset($this->request->data['DreamjobJobApplication']['agb']);
$this->request->data['DreamjobJobApplication']['worker_id'] = $w['AppUser']['id'];
$this->request->data['DreamjobJobApplication']['opening_id'] = $this->request->params['id'];
$pages = $this->request->data['DreamjobJobApplicationPage']['page_id'];
unset($this->request->data['DreamjobJobApplicationPage']['page_id']);
foreach($pages as $id)
$this->request->data['DreamjobJobApplicationPage'][]=array('page_id'=> $id);
echo var_dump($this->request->data); echo var_dump($this->request->data);
//$this->DreamjobJobApplication->create($this->request->data); $result = $this->DreamjobJobApplication->saveAssociated($this->request->data);
$this->request->data['DreamjobJobOpening']['worker_id'] = $w['AppUser']['id']; if ($result) {
$this->request->data['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')); $this->MiconwareSession->setFlash('dreamjob.opening.save.add','flash',array('alert'=>'success'));
}else{ }else{
$this->MiconwareSession->setFlash('dreamjob.opening.save.error','flash',array('alert'=>'danger')); $this->MiconwareSession->setFlash('dreamjob.opening.save.error','flash',array('alert'=>'danger'));
} }
}else{
$this->MiconwareSession->setFlash('dreamjob.agb.error.notAccept','flash',array('alert'=>'danger'));
} }
} }
$this->set('pages', $w['DreamjobPageInh']); $this->set('pages', $w['DreamjobPageInh']);

View File

@ -43,7 +43,7 @@ class DreamjobJobApplication extends AppModel {
//'required' => false, //'required' => false,
//'last' => false, // Stop validation after this rule //'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations //'on' => 'create', // Limit validation to 'create' or 'update' operations
), )
), ),
'stars' => array( 'stars' => array(
'numeric' => array( 'numeric' => array(
@ -225,5 +225,9 @@ class DreamjobJobApplication extends AppModel {
'className' => 'DreamjobJobMsg', 'className' => 'DreamjobJobMsg',
'foreignKey' => 'application_id' 'foreignKey' => 'application_id'
), ),
'DreamjobJobApplicationPage' => array(
'className' => 'DreamjobJobApplicationPage',
'foreignKey' => 'application_id'
),
); );
} }

View File

@ -31,5 +31,22 @@ if($isLoggedin){
<li<?php if(isset($MENU_SETTINGS)){?> class="active"<?php } ?>><a href=""><img src="<c:url value="${STATIC_URL}img/bar-settings.png"/>"/></a></li> <li<?php if(isset($MENU_SETTINGS)){?> class="active"<?php } ?>><a href=""><img src="<c:url value="${STATIC_URL}img/bar-settings.png"/>"/></a></li>
</ul> </ul>
<?php <?php
}elseif($MENU_START){
?>
<style type="text/css">
<!--
.bar #barleft {
width:128px;
position:relative;
right:-130px;
}
.column-center{
padding-left:130px;
width:1090px;
}
-->
</style>
<?php
echo $this->Html->link(__('dreamjob.company.to'),array('controller'=>'home', 'action'=>'home'),array("class" => "btn btn-primary"));
} }
?> ?>

View File

@ -8,14 +8,23 @@
<div class="box"> <div class="box">
<h1><?=__('dreamjob.search');?></h1> <h1><?=__('dreamjob.search');?></h1>
<div class="searchform"> <div class="searchform">
<?php echo $this->Form->create(null,array('inputDefaults'=> array('div' => false,'label'=>false,'class' => 'form-control'))); ?> <?php echo $this->Form->create(null,array('inputDefaults'=> array('div' => false,'label'=>false,'class' => 'form-control'),'url'=>array('controller'=>'home', 'action'=>'home'))); ?>
<div class="input-group"> <div class="input-group">
<?php echo $this->Form->input('textsearch');?> <?php echo $this->Form->input('textsearch');?>
<span class="input-group-btn"> <span class="input-group-btn">
<?php echo $this->Form->button('<span class="glyphicon glyphicon-search"></span>',array('div' => false,'class'=>"btn btn-default",'type' => 'submit')); ?> <?php echo $this->Form->button('<span class="glyphicon glyphicon-search"></span>',array('div' => false,'class'=>"btn btn-default",'type' => 'submit')); ?>
</span> </span>
</div> </div>
<?php echo $this->Form->end(); ?> <?php
echo $this->Form->end();
echo "<br/>";
if(!$isLoggedin){
echo $this->Html->link(__('dreamjob.registration.to'),array('controller'=>'home', 'action'=>'home'),array("class" => "btn btn-primary"));
echo "<br/>";
echo "<br/>";
}
echo $this->Html->link(__('dreamjob.search.to'),array('controller'=>'home', 'action'=>'home'),array("class" => "btn btn-primary"));
?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -17,7 +17,7 @@
</span> </span>
</div> </div>
<div class="box"> <div class="box">
<?=$this->element('job_opening_head');?> <?=$this->element('job_opening_head',array("opening"=>$application));?>
</div> </div>

View File

@ -12,7 +12,9 @@
<fieldset> <fieldset>
<legend><?=__("dreamjob.application.form");?></legend> <legend><?=__("dreamjob.application.form");?></legend>
<?php <?php
echo //echo $this->Form->hidden('DreamjobJobApplication.id');
echo $this->Form->hidden('DreamjobJobApplication.opening_id');
echo $this->Form->hidden('DreamjobJobApplication.worker_id');
echo $this->Form->textarea('DreamjobJobApplication.text',array("class"=>'form-control',"rows"=>10)); echo $this->Form->textarea('DreamjobJobApplication.text',array("class"=>'form-control',"rows"=>10));
?> ?>
@ -24,11 +26,10 @@
} }
echo $this->Form->select('DreamjobJobApplicationPage.page_id', $page_options, array( echo $this->Form->select('DreamjobJobApplicationPage.page_id', $page_options, array(
'multiple' => 'checkbox')); 'multiple' => 'checkbox'));
echo $this->element('sql_dump');
?> ?>
<div class="buttonrow"> <div class="buttonrow">
<div class="checkbox" style="width:20%;display:inline-block;"> <div class="checkbox" style="width:20%;display:inline-block;">
<input type="checkbox" name="agb"/><?=__("dreamjob.agb.accept");?> <?=$this->Form->checkbox('agb').__("dreamjob.agb.accept");?>
</div> </div>
<br/> <br/>
<?=$this->Form->button(__('dreamjob.application.send'),array('div' => false,'class'=>"btn btn-default ",'type' => 'submit'));?> <?=$this->Form->button(__('dreamjob.application.send'),array('div' => false,'class'=>"btn btn-default ",'type' => 'submit'));?>

View File

@ -341,7 +341,7 @@ body.loading #container{
width:465px; width:465px;
height:282px; height:282px;
background-color:#9d1c16; background-color:#9d1c16;
padding-top:40px; padding-top:20px;
} }
.start-search-box .box h1{ .start-search-box .box h1{
color:white; color:white;
@ -363,6 +363,10 @@ body.loading #container{
line-height:1.42857; line-height:1.42857;
color:white; color:white;
} }
.start-search-box .box .searchform .btn.btn-primary{
background-color:red;
border-color:red;
}
/* /*
* Messages * Messages
*/ */
@ -377,3 +381,7 @@ body.loading #container{
.infofield{ .infofield{
color:black; color:black;
} }
.btn.btn-primary{
background-color:red;
border-color:orange;
}