Application/Api/Education/Certificate/Generator/Repository/MsAbgGeistigeEntwicklung.php
<?php
/**
* Created by PhpStorm.
* User: Kauschke
* Date: 24.01.2019
* Time: 11:18
*/
namespace SPHERE\Application\Api\Education\Certificate\Generator\Repository;
use SPHERE\Application\Api\Education\Certificate\Generator\Certificate;
use SPHERE\Application\Education\Certificate\Generator\Repository\Element;
use SPHERE\Application\Education\Certificate\Generator\Repository\Page;
use SPHERE\Application\Education\Certificate\Generator\Repository\Section;
use SPHERE\Application\Education\Certificate\Generator\Repository\Slice;
use SPHERE\Application\People\Person\Service\Entity\TblPerson;
use SPHERE\Common\Frontend\Layout\Repository\Container;
/**
* Class MsAbgGeistigeEntwicklung
*
* @package SPHERE\Application\Api\Education\Certificate\Certificate\Repository
*/
class MsAbgGeistigeEntwicklung extends Certificate
{
/**
* @param TblPerson|null $tblPerson
*
* @return Page[]
*/
public function buildPages(TblPerson $tblPerson = null)
{
$personId = $tblPerson ? $tblPerson->getId() : 0;
$Header = $this->getHead($this->isSample(), true, 'auto', '50px');
$pageList[] = (new Page())
->addSlice($Header)
->addSlice((new Slice())
->addElement((new Element())
->setContent('ZEUGNIS')
->styleTextSize('27px')
->styleAlignCenter()
->styleMarginTop('20%')
->styleTextBold()
)
->addElement((new Element())
->setContent('der Oberschule' . new Container('zur Schulentlassung'))
->styleTextSize('22px')
->styleAlignCenter()
->styleMarginTop('15px')
)
);
$pageList[] = (new Page())
->addSlice((new Slice())
->addSection((new Section())
->addElementColumn((new Element())
->setContent('Vorname und Name:')
, '22%')
->addElementColumn((new Element())
->setContent('
{{ Content.P' . $personId . '.Person.Data.Name.First }}
{{ Content.P' . $personId . '.Person.Data.Name.Last }}
')
->styleBorderBottom()
)
)->styleMarginTop('50px')
)
->addSlice((new Slice())
->addSection((new Section())
->addElementColumn((new Element())
->setContent('geboren am')
, '22%')
->addElementColumn((new Element())
->setContent('{% if(Content.P' . $personId . '.Person.Common.BirthDates.Birthday is not empty) %}
{{ Content.P' . $personId . '.Person.Common.BirthDates.Birthday|date("d.m.Y") }}
{% else %}
{% endif %}')
->styleBorderBottom()
, '20%')
->addElementColumn((new Element())
->setContent('in')
->styleAlignCenter()
, '5%')
->addElementColumn((new Element())
->setContent('{% if(Content.P' . $personId . '.Person.Common.BirthDates.Birthplace is not empty) %}
{{ Content.P' . $personId . '.Person.Common.BirthDates.Birthplace }}
{% else %}
{% endif %}')
->styleBorderBottom()
)
)->styleMarginTop('10px')
)
->addSlice((new Slice())
->addSection((new Section())
->addElementColumn((new Element())
->setContent('wohnhaft in')
, '22%')
->addElementColumn((new Element())
->setContent('{% if(Content.P' . $personId . '.Person.Address.City.Name) %}
{{ Content.P' . $personId . '.Person.Address.Street.Name }}
{{ Content.P' . $personId . '.Person.Address.Street.Number }},
{{ Content.P' . $personId . '.Person.Address.City.Code }}
{{ Content.P' . $personId . '.Person.Address.City.Name }}
{% else %}
{% endif %}')
->styleBorderBottom()
)
)->styleMarginTop('10px')
)
->addSliceArray(MsAbsRs::getSchoolPart($personId))
->addSlice((new Slice())
->addElement((new Element())
->setContent(
new Container('und verlässt nach Erfüllung der Vollzeitschulpflicht gemäß')
. new Container('§ 28 Absatz 1 Nummer 1 des Sächsischen Schulgesetzes und')
. new Container('§ 63 der Schulordnung Ober- und Abendoberschulen')
. new Container('die Oberschule.')
)
->styleMarginTop('8px')
->styleAlignCenter()
)->styleMarginTop('60px')
)
->addSlice((new Slice())
->addElement((new Element())
->setContent('Inklusive Unterrichtung¹:
{% if(Content.P' . $personId . '.Input.Support is not empty) %}
{{ Content.P' . $personId . '.Input.Support|nl2br }}
{% else %}
{% endif %}')
->styleHeight('200px')
->styleMarginTop('55px')
))
->addSlice($this->getDateLine($personId))
->addSlice($this->getSignPart($personId, true, '30px'))
->addSlice($this->getInfo('190px',
'¹ gemäß § 27 Absatz 6 der Schulordnung Ober- und Abendoberschulen'
));
return $pageList;
}
}