DbFunction::$projektid]
);
$_projekt = DbFunction::select(
'tx_gutachten_projekte',
['auftraggeber_id', 'gutachter_id', 'intname', 'name', 'beschreibung', 'erstellung', 'onoff', 'upload', 'allgemeinupload', 'recalculate', 'zuabTitel', 'nwbTitel', 'zustTitel', 'allgemTitel', 'loggia_title', 'nwbStartSeite', 'm1pP', 'm5pP', 'timestamp', 'status', 'erstelldatum'],
['id' => DbFunction::$projektid]
);
$_auftraggeber = DbFunction::select(
'tx_gutachten_auftraggeber',
'*',
['id' => $_projekt[0]['auftraggeber_id']]
);
$_gutachter = DbFunction::select(
'tx_gutachten_gutachter',
'*',
['id' => $_projekt[0]['gutachter_id']]
);
// print_r($_projekt);
// print_r($_auftraggeber);
// print_r($_gutachter);
// exit;
self::$Mpdf = new \Mpdf\Mpdf([
'mode' => 'utf-8',
'format' => 'A4-P',
'margin_left' => 10,
'margin_right' => 10,
'margin_top' => 10,
'margin_bottom' => 10,
'margin_header' => 0,
'margin_footer' => 0,
]);
$stylesheet = file_get_contents(__DIR__.'/style.css');
self::$Mpdf->WriteHTML($stylesheet, \Mpdf\HTMLParserMode::HEADER_CSS);
// 1 tabelle
// 2 inhaltsverzeichnis
// 3 textblock
// 4 deckblatt
// 5 nur Überschrift
// 6 auftraggeber
// 7 tabelle § 6/2
// 8 allgemeinflächen
$_standards = DbFunction::select('tx_gutachten_projektestandards', '*', ['AND' => ['pid' => DbFunction::$projektid, 'kennung' => ['Deckblatt', '2.30 § 6 Teil 1', 'Tabelle § 6', '2.30 § 6 Teil 2']], 'ORDER' => 'pos']);
foreach ($_standards as $key => $value) {
$textartid = (int)$value['textart_id'];
switch ($textartid) {
case '4':
// DECKBLATT
$value['paragraph6'] = 1;
$html = Deckblatt::create($value, $_projekt, $_platzhalter, $_gutachter, $_auftraggeber);
self::$Mpdf->WriteHTML($html, \Mpdf\HTMLParserMode::HTML_BODY);
break;
case '3':
if (1 == $value['neueseite']) {
self::$Mpdf->AddPageByArray(['mgt' => 22, 'mgb' => 22, 'mgl' => 10, 'mgr' => 10]);
self::$Mpdf->SetHTMLFooter('
Seite {PAGENO}
');
}
// if ('' != $value['titel']) {
// $html = '';
// } elseif ('' != $value['kennung']) {
// $html = '';
// }
$textblock = Helper::replacePlatzhalter($_platzhalter, $value['txt']);
$html = '' . $textblock . '
';
self::$Mpdf->WriteHTML($html, \Mpdf\HTMLParserMode::HTML_BODY);
break;
case '7':
// 7 tabelle § 6/2
if (1 == $value['neueseite']) {
self::$Mpdf->AddPage();
self::$Mpdf->SetHTMLFooter('Seite {PAGENO}
');
}
$_paragraph_62 = Paragraph62::select(DbFunction::$projektid);
$html = '';
$html .= '';
// $html = '';
// $html .= Helper::table_header_row(['Top', 'Geschoß', 'Orientierung', 'Typ']);
foreach ($_paragraph_62 as $key => $value) {
$html .= Helper::table_row($value, 1);
}
$html .= '
';
self::$Mpdf->WriteHTML($html, \Mpdf\HTMLParserMode::HTML_BODY);
break;
}
}
// 5 DIGITALE SIGNATUR
$image = Environment::getProjectPath()."/public/typo3conf/ext/gutachten/Resources/Public/Images/avf_stempel.png";
$html = '';
$html .= '';
$html .= '
';
$html .= '| '.$_projekt[0]['erstellung'].' | ';
$html .= ' | ';
$html .= '
';
$html .= '
';
self::$Mpdf->WriteHTML($html, \Mpdf\HTMLParserMode::HTML_BODY);
self::$Mpdf->Output('GutachtenParagraph6.pdf', Mpdf\Output\Destination::INLINE);
exit;
}
}