Application/Api/Document/Standard/Repository/KamenzReportGym/E03.php
<?php
/**
* Created by PhpStorm.
* User: lehmann
* Date: 27.06.2017
* Time: 09:34
*/
namespace SPHERE\Application\Api\Document\Standard\Repository\KamenzReportGym;
use SPHERE\Application\Document\Generator\Repository\Element;
use SPHERE\Application\Document\Generator\Repository\Section;
use SPHERE\Application\Document\Generator\Repository\Slice;
class E03
{
public static function getContent()
{
$sliceList = array();
$sliceList[] = (new Slice())
->styleTextBold()
->styleMarginTop('20px')
->styleMarginBottom('5px')
->addElement((new Element())
->setContent('E03. <u>Schüler, deren Herkunftssprache nicht oder nicht ausschließlich Deutsch ist,</u> im
Schuljahr {{ Content.SchoolYear.Current }} </br>
nach dem Land der Staatsangehörigkeit und Klassen- bzw. Jahrgangsstufen')
);
$sliceList[] = (new Slice())
->styleBackgroundColor('lightgrey')
->styleAlignCenter()
->styleBorderTop()
->styleBorderBottom()
->styleBorderLeft()
->styleBorderRight()
->addSection((new Section())
->addElementColumn((new Element())
->setContent('Land der<br/>Staatsan-<br/>gehörigkeit')
->styleBorderRight()
->stylePaddingTop('1px'), '28%'
)
->addSliceColumn((new Slice())
->addSection((new Section())
->addElementColumn((new Element())
->setContent('Klassen- bzw. Jahrgangsstufe')
->styleBorderRight()
)
)
->addSection((new Section())
->addElementColumn((new Element())
->setContent('5')
->styleBorderBottom()
->styleBorderRight(), '8%'
)
->addElementColumn((new Element())
->setContent('6')
->styleBorderBottom()
->styleBorderRight(), '8%'
)
->addElementColumn((new Element())
->setContent('7')
->styleBorderBottom()
->styleBorderRight(), '8%'
)
->addElementColumn((new Element())
->setContent('8')
->styleBorderBottom()
->styleBorderRight(), '8%'
)
->addElementColumn((new Element())
->setContent('9')
->styleBorderBottom()
->styleBorderRight(), '8%'
)
->addElementColumn((new Element())
->setContent('10')
->styleBorderBottom()
->styleBorderRight(), '8%'
)
->addElementColumn((new Element())
->setContent('11')
->styleBorderBottom()
->styleBorderRight(), '8%'
)
->addElementColumn((new Element())
->setContent('12')
->styleBorderBottom()
->styleBorderRight(), '8%'
)
)
->addSection((new Section())
->addElementColumn((new Element())
->setContent('m')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('w')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('m')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('w')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('m')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('w')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('m')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('w')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('m')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('w')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('m')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('w')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('m')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('w')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('m')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('w')
->styleBorderRight(), '4%'
)
)
)
->addSliceColumn((new Slice())
->styleTextBold()
->addSection((new Section())
->addElementColumn((new Element())
->setContent('Insges.')
->styleBorderBottom()
->stylePaddingTop('8.6px')
->stylePaddingBottom('8.5px')
)
)
->addSection((new Section())
->addElementColumn((new Element())
->setContent('m')
->styleBorderRight(), '50%'
)
->addElementColumn((new Element())
->setContent('w'), '50%'
)
), '8%'
)
);
for ($i = 0; $i < 7; $i++) {
$section = new Section();
$section
->addElementColumn((new Element())
->setContent('
{% if (Content.E03.N' . $i . '.NationalityName is not empty) %}
{{ Content.E03.N' . $i . '.NationalityName }}
{% else %}
{% endif %}
')
->styleBorderRight(), '28%'
);
for ($level = 5; $level < 13; $level++) {
$section
->addElementColumn((new Element())
->setContent('
{% if (Content.E03.N' . $i . '.L' . $level . '.m is not empty) %}
{{ Content.E03.N' . $i . '.L' . $level . '.m }}
{% else %}
{% endif %}
')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('
{% if (Content.E03.N' . $i . '.L' . $level . '.w is not empty) %}
{{ Content.E03.N' . $i . '.L' . $level . '.w }}
{% else %}
{% endif %}
')
->styleBorderRight(), '4%'
);
}
$section
->addElementColumn((new Element())
->setContent('
{% if (Content.E03.N' . $i . '.m is not empty) %}
{{ Content.E03.N' . $i . '.m }}
{% else %}
{% endif %}
')
->styleBackgroundColor('lightgrey')
->styleTextBold()
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('
{% if (Content.E03.N' . $i . '.w is not empty) %}
{{ Content.E03.N' . $i . '.w }}
{% else %}
{% endif %}
')
->styleBackgroundColor('lightgrey')
->styleTextBold(), '4%'
);
$sliceList[] = (new Slice())
->styleAlignCenter()
->styleBorderBottom()
->styleBorderLeft()
->styleBorderRight()
->addSection($section);
}
/**
* TotalCount
*/
$section = new Section();
$section
->addElementColumn((new Element())
->setContent('Insgesamt')
->styleBorderRight()
->styleAlignCenter(), '28%'
);
for ($level = 5; $level < 13; $level++) {
$section
->addElementColumn((new Element())
->setContent('
{% if (Content.E03.TotalCount.L' . $level . '.m is not empty) %}
{{ Content.E03.TotalCount.L' . $level . '.m }}
{% else %}
{% endif %}
')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('
{% if (Content.E03.TotalCount.L' . $level . '.w is not empty) %}
{{ Content.E03.TotalCount.L' . $level . '.w }}
{% else %}
{% endif %}
')
->styleBorderRight(), '4%'
);
}
$section
->addElementColumn((new Element())
->setContent('
{% if (Content.E03.TotalCount.m is not empty) %}
{{ Content.E03.TotalCount.m }}
{% else %}
{% endif %}
')
->styleBorderRight(), '4%'
)
->addElementColumn((new Element())
->setContent('
{% if (Content.E03.TotalCount.w is not empty) %}
{{ Content.E03.TotalCount.w }}
{% else %}
{% endif %}
')
, '4%'
);
$sliceList[] = (new Slice())
->styleAlignCenter()
->styleBorderBottom()
->styleBorderLeft()
->styleBorderRight()
->styleTextBold()
->styleBackgroundColor('lightgrey')
->addSection($section);
return $sliceList;
}
}