element('user_worker_cv',array('toPDF'=>true,'profil'=>array('User'=>$application['WorkerUser']
,'AppUser'=>$application['AppUserWorker'],'DreamjobWorker'=>$application['DreamjobWorker'],'DreamjobListGraducation'=>$application['WorkerGraducation'],'DreamjobListCity'=>$application['DreamjobWorkerListCity'])));
$cvinhalt .= '';
$dev = 0;
$tcpdf = new XTCPDF();
$tcpdf->SetMargins(25,35,25,20);
$tcpdf->SetAuthor("Miconware");
$tcpdf->SetAutoPageBreak( false );
$tcpdf->mail=$application['WorkerUser']['mail'];
$tcpdf->AddPage();
// Deckblatt
$tcpdf->SetY(35);
$tcpdf->SetTextColor(0, 0, 0);
$tcpdf->SetFont($tcpdf->font);
$url=WWW_ROOT.DS.'img'.DS.'icon_user.png';
if($application['AppUserWorker']['take_systemwide']){
if($application['WorkerUser']['avatar'])
$url = WWW_ROOT.DS.'uploads'.DS.$application['WorkerUser']['avatar'];
}else
if($profil['AppUserWorker']['avatar'])
$url = WWW_ROOT.DS.'uploads'.DS.$application['AppUserWorker']['avatar'];
$tcpdf->Image($url,0,40,0,140,'','','','',300,'L');
$tcpdf->SetY(185);
$tcpdf->SetFont($tcpdf->font,'B',$tcpdf->fontsize+4);
$tcpdf->Cell(0,0, __('dreamjob.application'), 0,1,'L');
$tcpdf->SetFont($tcpdf->font,'',$tcpdf->fontsize);
$tcpdf->writeHTML(__('dreamjob.application.for').' '.$application['DreamjobJobOpening']['title']);
$tcpdf->SetY(255);
$tcpdf->Cell(0,0, $application['Mannerofaddress']['name'].' '.$application['AppUserWorker']['first_name'].' '.$application['AppUserWorker']['last_name'], 0,1,'R');
$tcpdf->Cell(0,0, $application['DreamjobUserWorker']['street'], 0,1,'R');
$tcpdf->Cell(0,0, $application['DreamjobUserWorker']['postcode'].' '.$application['DreamjobWorkerListCity']['name'], 0,1,'R');
//Anschreiben
$tcpdf->SetAutoPageBreak( true, 20);
$tcpdf->title=__('dreamjob.application.why');
$tcpdf->AddPage();
$tcpdf->SetY(35);
$tcpdf->SetTextColor(0, 0, 0);
$tcpdf->SetFont($tcpdf->font);
$tcpdf->Cell(0,0, $application['AppUserWorker']['first_name'].' '.$application['AppUserWorker']['last_name'], 0,1,'L');
$tcpdf->Cell(0,0, $application['DreamjobUserWorker']['street'], 0,1,'L');
$tcpdf->Cell(0,0, $application['DreamjobUserWorker']['postcode'].' '.$application['DreamjobWorkerListCity']['name'], 0,1,'L');
$tcpdf->SetY(60);
$tcpdf->Cell(0,0, $application['AppUser']['nickname'], 0,1,'L');
$tcpdf->Cell(0,0, $application['DreamjobUser']['street'], 0,1,'L');
$tcpdf->Cell(0,0, $application['DreamjobUser']['postcode'].' '.$application['DreamjobListCity']['name'], 0,1,'L');
$tcpdf->writeHTML('