startseite + cv anzeigen
This commit is contained in:
parent
f5147a3564
commit
9c49823792
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
App::uses('AppModel', 'Model');
|
||||
/**
|
||||
* MicDjCvCategory Model
|
||||
*
|
||||
* @property Worker $Worker
|
||||
* @property Category $Category
|
||||
*/
|
||||
class DreamjobCvCategory extends AppModel {
|
||||
|
||||
/**
|
||||
* Use database config
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $useDbConfig = 'dreamjobMain';
|
||||
|
||||
/**
|
||||
* Use table
|
||||
*
|
||||
* @var mixed False or table name
|
||||
*/
|
||||
public $useTable = 'mic_dj_cv_category';
|
||||
|
||||
/**
|
||||
* Display field
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $displayField = 'id';
|
||||
|
||||
/**
|
||||
* Validation rules
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $validate = array(
|
||||
'worker_id' => array(
|
||||
'numeric' => array(
|
||||
'rule' => array('numeric'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'category_id' => array(
|
||||
'numeric' => array(
|
||||
'rule' => array('numeric'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||
|
||||
/**
|
||||
* belongsTo associations
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $hasMany = array(
|
||||
'DreamjobCvEntry' => array(
|
||||
'className' => 'DreamjobCvEntry',
|
||||
'foreignKey' => 'category_id'
|
||||
),
|
||||
);
|
||||
|
||||
public $belongsTo = array(
|
||||
'DreamjobWorker' => array(
|
||||
'className' => 'DreamjobWorker',
|
||||
'foreignKey' => 'worker_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
),
|
||||
'DreamjobListCvCategory' => array(
|
||||
'className' => 'DreamjobListCvCategory',
|
||||
'foreignKey' => 'category_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
)
|
||||
);
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
App::uses('AppModel', 'Model');
|
||||
/**
|
||||
* MicDjCvEntry Model
|
||||
*
|
||||
* @property Category $Category
|
||||
*/
|
||||
class DreamjobCvEntry extends AppModel {
|
||||
|
||||
/**
|
||||
* Use database config
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $useDbConfig = 'dreamjobMain';
|
||||
|
||||
/**
|
||||
* Use table
|
||||
*
|
||||
* @var mixed False or table name
|
||||
*/
|
||||
public $useTable = 'mic_dj_cv_entry';
|
||||
|
||||
/**
|
||||
* Display field
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $displayField = 'title';
|
||||
|
||||
/**
|
||||
* Validation rules
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $validate = array(
|
||||
'category_id' => array(
|
||||
'numeric' => array(
|
||||
'rule' => array('numeric'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'startdate' => array(
|
||||
'date' => array(
|
||||
'rule' => array('date'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'enddate' => array(
|
||||
'date' => array(
|
||||
'rule' => array('date'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'title' => array(
|
||||
'notEmpty' => array(
|
||||
'rule' => array('notEmpty'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'place' => array(
|
||||
'notEmpty' => array(
|
||||
'rule' => array('notEmpty'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||
|
||||
/**
|
||||
* belongsTo associations
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $belongsTo = array(
|
||||
'DreamjobCvCategory' => array(
|
||||
'className' => 'DreamjobCvCategory',
|
||||
'foreignKey' => 'category_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
)
|
||||
);
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
App::uses('AppModel', 'Model');
|
||||
/**
|
||||
* MicDjListCv-category Model
|
||||
*
|
||||
*/
|
||||
class DreamjobListCvCategory extends AppModel {
|
||||
|
||||
/**
|
||||
* Use database config
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $useDbConfig = 'dreamjobMain';
|
||||
|
||||
/**
|
||||
* Use table
|
||||
*
|
||||
* @var mixed False or table name
|
||||
*/
|
||||
public $useTable = 'mic_dj_list_cv-category';
|
||||
|
||||
/**
|
||||
* Display field
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $displayField = 'name';
|
||||
|
||||
/**
|
||||
* Validation rules
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $validate = array(
|
||||
'name' => array(
|
||||
'notEmpty' => array(
|
||||
'rule' => array('notEmpty'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'enddate' => array(
|
||||
'boolean' => array(
|
||||
'rule' => array('boolean'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'startdate' => array(
|
||||
'boolean' => array(
|
||||
'rule' => array('boolean'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'place' => array(
|
||||
'boolean' => array(
|
||||
'rule' => array('boolean'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'place_str' => array(
|
||||
'notEmpty' => array(
|
||||
'rule' => array('notEmpty'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
'title_str' => array(
|
||||
'notEmpty' => array(
|
||||
'rule' => array('notEmpty'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
/*
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<h3><?=__("dreamjob.cv");?></h3>
|
||||
|
||||
<?php
|
||||
foreach($cv as $cvc){
|
||||
?>
|
||||
<h4><?=$cvc['DreamjobListCvCategory']['name'];?></h4>
|
||||
<table class="cv">
|
||||
<?php
|
||||
foreach($cvc['DreamjobCvEntry'] as $cve){
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] and $cvc['DreamjobListCvCategory']['enddate'] and $cvc['DreamjobListCvCategory']['place']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?> - <?=$cve['enddate'];?></td>
|
||||
<td><?=$cve['title'];?><br/><span><?=$cve['place'];?></span></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['place']){
|
||||
if($cvc['DreamjobListCvCategory']['startdate']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['enddate'];?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<td><?=$cve['title'];?></td>
|
||||
<td><?=$cve['place'];?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] or $cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['title'];?><br/><span><?=$cve['place'];?></span></td>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
if($cvc['DreamjobListCvCategory']['startdate'] and $cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?> - <?=$cve['enddate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['startdate']){
|
||||
?>
|
||||
<td><?=$cve['startdate'];?></td>
|
||||
<?php
|
||||
}else if($cvc['DreamjobListCvCategory']['enddate']){
|
||||
?>
|
||||
<td><?=$cve['enddate'];?></td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
ERROR
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td><?=$cve['title'];?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue