diff --git a/app/Controller/PdfController.php b/app/Controller/PdfController.php index 072f067..cb67553 100644 --- a/app/Controller/PdfController.php +++ b/app/Controller/PdfController.php @@ -10,7 +10,7 @@ class PdfController extends AppController { $this->MiconwareSession->init($this); $this->MiconwareSession->initWeb($this); - $this->response->type('application/pdf'); + $WORKER = $this->MiconwareSession->getWorker(); $COMPANY = $self = $this->MiconwareSession->getCompany(); $application = null; @@ -25,6 +25,7 @@ class PdfController extends AppController { $this->set('error', 'dreamjob.error.noPermision'); $this->render('/Home/error'); }else{ + $this->response->type('application/pdf'); $this->set('application',$application); $cv = $this->DreamjobCvEntry->find('all',array('conditions' => array('worker_id'=> $application['DreamjobJobApplication']['worker_id']))); $this->set("cv",$cv); @@ -39,13 +40,13 @@ class PdfController extends AppController { $this->MiconwareSession->init($this); $this->MiconwareSession->initWeb($this); - $this->response->type('application/pdf'); $WORKER = $this->MiconwareSession->getWorker(); if(!is_array($WORKER) or count($WORKER) <= 0){ $this->set('error', 'dreamjob.error.noPermision'); $this->render('/Home/error'); }else{ + $this->response->type('application/pdf'); $cv = $this->DreamjobCvEntry->find('all',array('conditions' => array('worker_id'=> $WORKER['AppUser']['id']))); $this->set("cv",$cv); $cvp0 = $this->DreamjobListCvCategory->find('first',array('conditions' => array('DreamjobListCvCategory.position' => 0))); diff --git a/app/View/Layouts/pdf.ctp b/app/View/Layouts/pdf.ctp index 9e6e842..9c4e246 100644 --- a/app/View/Layouts/pdf.ctp +++ b/app/View/Layouts/pdf.ctp @@ -1,4 +1,4 @@