dreamjob/app/Controller/PdfController.php

38 lines
1.6 KiB
PHP

<?php
App::uses('AppController', 'Controller');
class PdfController extends AppController {
public $uses = array('DreamjobJobApplication','DreamjobCvEntry','DreamjobListCvCategory');
public function applicationGetPdf(){
$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);
//$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);
$this->layout = 'pdf';
$this->render('/Pdf/opening');
}
}
}
?>