2014-04-23 19:23:23 +02:00
|
|
|
<?php
|
|
|
|
App::import('Vendor','tcpdf/xtcpdf');
|
2014-04-24 10:53:29 +02:00
|
|
|
|
|
|
|
ob_end_clean();
|
|
|
|
header("Content-type: application/pdf");
|
|
|
|
|
|
|
|
|
2014-04-23 19:23:23 +02:00
|
|
|
$cvinhalt = $this->element('user_worker_cv',array('toPDF'=>true,'profil'=>$WORKER));
|
2014-04-23 22:41:44 +02:00
|
|
|
$cvinhalt .= '<style>span{font-style:italic;font-size:10px;}h1,h2,h3,h4,h5{
|
2014-04-28 22:49:00 +02:00
|
|
|
border-bottom:1px solid grey;
|
2014-04-29 23:51:16 +02:00
|
|
|
padding:0px;
|
2014-04-23 22:41:44 +02:00
|
|
|
width:100%;
|
2014-04-29 23:51:16 +02:00
|
|
|
}
|
|
|
|
</style>';
|
2014-04-23 19:23:23 +02:00
|
|
|
|
|
|
|
$dev = 0;
|
|
|
|
$tcpdf = new XTCPDF();
|
2014-04-30 00:50:43 +02:00
|
|
|
$tcpdf->SetMargins(25,35,25,20);
|
2014-04-30 00:46:45 +02:00
|
|
|
|
2014-04-23 19:23:23 +02:00
|
|
|
$tcpdf->SetAuthor("Miconware");
|
|
|
|
$tcpdf->SetAutoPageBreak( false );
|
|
|
|
|
|
|
|
$tcpdf->mail=$WORKER['User']['mail'];
|
|
|
|
|
|
|
|
$tcpdf->AddPage();
|
|
|
|
|
|
|
|
// Deckblatt
|
|
|
|
$tcpdf->SetY(35);
|
|
|
|
$tcpdf->SetTextColor(0, 0, 0);
|
|
|
|
$tcpdf->SetFont($tcpdf->font);
|
2014-04-28 22:49:00 +02:00
|
|
|
$tcpdf->Image(WWW_ROOT.DS.'uploads'.DS.$WORKER['AppUser']['avatar'],0,40,0,140,'','','','',300,'L');
|
|
|
|
$tcpdf->SetY(185);
|
2014-04-29 23:51:16 +02:00
|
|
|
$tcpdf->SetFont($tcpdf->font,'B',$tcpdf->fontsize+4);
|
2014-04-23 19:23:23 +02:00
|
|
|
$tcpdf->Cell(0,0, __('dreamjob.application.mappe'), 0,1,'L');
|
2014-04-29 23:51:16 +02:00
|
|
|
$tcpdf->SetFont($tcpdf->font,'',$tcpdf->fontsize);
|
2014-04-23 19:23:23 +02:00
|
|
|
|
|
|
|
$tcpdf->SetY(255);
|
|
|
|
$tcpdf->Cell(0,0, $WORKER['Mannerofaddress']['name'].' '.$WORKER['AppUser']['first_name'].' '.$WORKER['AppUser']['last_name'], 0,1,'R');
|
|
|
|
$tcpdf->Cell(0,0, $WORKER['DreamjobUser']['street'], 0,1,'R');
|
|
|
|
$tcpdf->Cell(0,0, $WORKER['DreamjobUser']['postcode'].' '.$WORKER['DreamjobListCity']['name'], 0,1,'R');
|
|
|
|
|
|
|
|
//Lebenslauf
|
2014-04-30 00:51:26 +02:00
|
|
|
$tcpdf->SetAutoPageBreak( true,20);
|
2014-04-23 19:23:23 +02:00
|
|
|
$tcpdf->title=__('dreamjob.cv');
|
|
|
|
$tcpdf->AddPage();
|
|
|
|
$tcpdf->SetY(35);
|
|
|
|
$tcpdf->SetTextColor(0, 0, 0);
|
|
|
|
$tcpdf->SetFont($tcpdf->font);
|
|
|
|
|
|
|
|
//$tcpdf->writeHTML(0,235,10,35, $cvinhalt, $dev,0,false,true,'L');
|
2014-04-28 15:12:51 +02:00
|
|
|
$tcpdf->writeHTML($cvinhalt);
|
2014-04-23 19:23:23 +02:00
|
|
|
$tcpdf->SetAutoPageBreak( false );
|
|
|
|
|
|
|
|
//Anhang
|
|
|
|
foreach($WORKER['DreamjobPageInh'] as $page){
|
|
|
|
$tcpdf->title=$page['title'];
|
|
|
|
$tcpdf->AddPage();
|
|
|
|
$tcpdf->SetY(35);
|
|
|
|
$tcpdf->SetTextColor(0, 0, 0);
|
|
|
|
$tcpdf->SetFont($tcpdf->font);
|
|
|
|
|
|
|
|
$pageType = null;
|
|
|
|
foreach($pageImage as $pg){
|
|
|
|
if($page['id'] == $pg['DreamjobPageInh']['id'])
|
|
|
|
$pageType=$pg;
|
|
|
|
}
|
|
|
|
if($pageType==null){
|
|
|
|
foreach($pageText as $pg){
|
|
|
|
if($page['id'] == $pg['DreamjobPageInh']['id'])
|
|
|
|
$pageType=$pg;
|
|
|
|
}
|
|
|
|
$tcpdf->writeHTMLCell(0,235,10,35, $pageType['DreamjobPageText']['text'], $dev,0,false,true,'L');
|
|
|
|
}else{
|
|
|
|
$tcpdf->Image(WWW_ROOT.DS.'uploads'.DS.$pageType['DreamjobPageImage']['image'],0,35,0,235,'','','','',300,'C');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ...
|
|
|
|
// etc.
|
|
|
|
// see the TCPDF examples
|
|
|
|
|
2014-04-24 10:31:59 +02:00
|
|
|
//$tcpdf->Output('profil.pdf','I');
|
2014-04-23 19:23:23 +02:00
|
|
|
// TO Download
|
2014-04-30 00:40:44 +02:00
|
|
|
$tcpdf->Output('profil.pdf','D');
|
2014-04-24 10:48:55 +02:00
|
|
|
return null;
|
2014-04-23 19:23:23 +02:00
|
|
|
?>
|