Application/Api/Document/Standard/Repository/KamenzReportGym/E05.php
<?php
/**
* Created by PhpStorm.
* User: lehmann
* Date: 27.06.2017
* Time: 10:06
*/
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 E05
{
public static function getContent()
{
$sliceList = array();
$sliceList[] = (new Slice())
->styleTextBold()
->styleMarginTop('20px')
->styleMarginBottom('5px')
->addElement((new Element())
->setContent('E05. Schüler im Ethik- bzw. Religionsunterricht im Schuljahr {{Content.SchoolYear.Current}} nach Klassenstufen')
);
$sliceList[] = (new Slice())
->styleBackgroundColor('lightgrey')
->styleAlignCenter()
->styleBorderTop()
->styleBorderBottom()
->styleBorderLeft()
->styleBorderRight()
->addSection((new Section())
->addElementColumn((new Element())
->setContent('Teilnahme am Unterricht im Fach')
->styleBorderRight()
->stylePaddingTop('8.6px')
->stylePaddingBottom('8.5px'), '30%'
)
->addSliceColumn((new Slice())
->addSection((new Section())
->addElementColumn((new Element())
->setContent('Klassenstufe')
->styleBorderRight()
)
)
->addSection((new Section())
->addElementColumn((new Element())
->setContent('5')
->styleBorderRight(), '10%'
)
->addElementColumn((new Element())
->setContent('6')
->styleBorderRight(), '10%'
)
->addElementColumn((new Element())
->setContent('7')
->styleBorderRight(), '10%'
)
->addElementColumn((new Element())
->setContent('8')
->styleBorderRight(), '10%'
)
->addElementColumn((new Element())
->setContent('9')
->styleBorderRight(), '10%'
)
->addElementColumn((new Element())
->setContent('10')
->styleBorderRight(), '10%'
)
), '60%'
)
->addElementColumn((new Element())
->setContent('Insgesamt')
->styleTextBold()
->stylePaddingTop('8.6px')
->stylePaddingBottom('8.5px'), '10%'
)
);
for ($i = 0; $i < 4; $i++) {
$section = new Section();
$section
->addElementColumn((new Element())
->setContent('
{% if (Content.E05.S' . $i . '.SubjectName is not empty) %}
{{ Content.E05.S' . $i . '.SubjectName }}
{% else %}
{% endif %}
')
->styleBackgroundColor('lightgrey')
->styleBorderRight(), '30%'
);
for ($level = 5; $level <= 10; $level++) {
$section
->addElementColumn((new Element())
->setContent('
{% if (Content.E05.S' . $i . '.L' . $level . ' is not empty) %}
{{ Content.E05.S' . $i . '.L' . $level . ' }}
{% else %}
{% endif %}
')
->styleBorderRight(), '10%'
);
}
$section
->addElementColumn((new Element())
->setContent('
{% if (Content.E05.S' . $i . '.TotalCount is not empty) %}
{{ Content.E05.S' . $i . '.TotalCount }}
{% else %}
{% endif %}
')
->styleBackgroundColor('lightgrey')
->styleTextBold(), '10%'
);
$sliceList[] = (new Slice())
->styleAlignCenter()
->styleBorderBottom()
->styleBorderLeft()
->styleBorderRight()
->addSection($section);
}
/**
* Total
*/
$section = new Section();
$section
->addElementColumn((new Element())
->setContent('Insgesamt')
->styleBackgroundColor('lightgrey')
->styleBorderRight(), '30%'
);
for ($level = 5; $level <= 10; $level++) {
$section
->addElementColumn((new Element())
->setContent('
{% if (Content.E05.TotalCount.L' . $level . ' is not empty) %}
{{ Content.E05.TotalCount.L' . $level . ' }}
{% else %}
{% endif %}
')
->styleBorderRight(), '10%'
);
}
$section
->addElementColumn((new Element())
->setContent(' ')
->styleBackgroundColor('lightgrey'), '10%'
);
$sliceList[] = (new Slice())
->styleBackgroundColor('lightgrey')
->styleTextBold()
->styleAlignCenter()
->styleBorderBottom()
->styleBorderLeft()
->styleBorderRight()
->addSection($section);
return $sliceList;
}
}