Realschule

This commit is contained in:
2018-04-03 17:22:43 +02:00
parent ad9bd84844
commit 1e9a4e65c5
5 changed files with 35 additions and 3 deletions

View File

@@ -43,6 +43,12 @@ class AppController extends Controller
$this->loadComponent('RequestHandler');
$this->loadComponent('Flash');
$session = $this->request->session();
if(!($session->check('SchoolType'))) {
$session->write('SchoolType','02');
}
/*
* Enable the following components for recommended CakePHP security settings.

View File

@@ -13,7 +13,20 @@ use AsdCurl\AsdUp;
*/
class BudgetController extends AppController
{
public function changeSchool()
{
$session = $this->request->session();
if ($session->read('SchoolType') == '02') {
$session->write('SchoolType','04');
}
else {
$session->write('SchoolType','02');
}
$this->redirect($this->referer());
}
public function listBudgets() {
$wlBudgets = $this->Budget->wlBudgets->find('all', [
'conditions' => array('schulart' => 'GY')
]);

View File

@@ -28,6 +28,7 @@ $cakeDescription = 'CakePHP: the rapid development php framework';
<?= $this->Html->css('base.css') ?>
<?= $this->Html->css('cake.css') ?>
<?= $this->Html->css('budget-costum.css') ?>
<?= $this->Html->css('handsontable.min.css') ?>
<?= $this->Html->css('handsontable.costum.css') ?>
@@ -42,13 +43,22 @@ $cakeDescription = 'CakePHP: the rapid development php framework';
<nav class="top-bar expanded" data-topbar role="navigation">
<ul class="title-area large-3 medium-4 columns">
<li class="name">
<h1><a href=""><?= $this->fetch('title') ?></a></h1>
<?php
$session = $this->request->session();
if ($session->read('SchoolType') == '02') {
echo '<h1>Realschule</h1>';
}
else {
echo '<h1>Gymnasium</h1>';
}
?>
</li>
</ul>
<div class="top-bar-section">
<ul class="right">
<li><a target="_blank" href="https://book.cakephp.org/3.0/">Documentation</a></li>
<li><a target="_blank" href="https://api.cakephp.org/3.0/">API</a></li>
<li><?php echo $this->Html->link('Overview',array('controller' => 'budget', 'action' => 'overview')); ?></li>
<li><?php echo $this->Html->link('Budgetart wählen',array('controller' => 'budget', 'action' => 'list_budgets')); ?></li>
<li><?php echo $this->Html->link('Schulart ändern',array('controller' => 'budget', 'action' => 'change_school')); ?></li>
</ul>
</div>
</nav>

View File

@@ -0,0 +1,3 @@
h1 {
color: aliceblue;
}

Binary file not shown.