dreamjob/app/Controller/PdfController.php

38 lines
1.6 KiB
PHP
Raw Normal View History

2014-04-22 20:50:23 +02:00
<?php
App::uses('AppController', 'Controller');
class PdfController extends AppController {
2014-04-23 10:34:50 +02:00
public $uses = array('DreamjobJobApplication','DreamjobCvEntry','DreamjobListCvCategory');
2014-04-22 22:17:01 +02:00
2014-04-22 20:50:23 +02:00
public function applicationGetPdf(){
2014-04-22 22:17:01 +02:00
$this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this);
$WORKER = $this->MiconwareSession->getWorker();
$COMPANY = $self = $this->MiconwareSession->getCompany();
$application = null;
if(isset($this->request->params['id'])){
if(is_array($WORKER) and count($WORKER) > 0)
$application = $this->DreamjobJobApplication->find('first',array('conditions' => array('DreamjobJobApplication.worker_id' => $WORKER['AppUser']['id'],'DreamjobJobApplication.id'=> $this->request->params['id'] )));
if(is_array($COMPANY) and count($COMPANY) > 0)
$application = $this->DreamjobJobApplication->find('first',array('conditions' => array('DreamjobJobOpening.company_id' => $COMPANY['AppUser']['id'],'DreamjobJobApplication.id'=> $this->request->params['id'] )));
}
if(!is_array($application) or count($application) <= 0){
$this->set('error', 'dreamjob.error.noPermision');
$this->render('/Home/error');
}else{
$this->set('application',$application);
2014-04-23 10:34:50 +02:00
//$cv = $this->DreamjobCvEntry->find('all',array('conditions' => array('worker_id'=> $application['DreamjobJobApplication']['worker_id'])));
//$this->set("cv",$cv);
//$cvp0 = $this->DreamjobListCvCategory->find('first',array('conditions' => array('DreamjobListCvCategory.position' => 0)));
//$this->set('cvp0', $cvp0);
2014-04-22 22:17:01 +02:00
$this->layout = 'pdf';
$this->render('/Pdf/opening');
}
2014-04-22 20:50:23 +02:00
}
}
?>