This repository has been archived on 2023-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
dogstats/web/pages/demo/controller.php

78 lines
3.0 KiB
PHP
Raw Normal View History

2023-10-23 13:59:26 +02:00
<?php
class Demo extends Page{
function setMenu()
{
$this->menu_text = 'Demo';
$this->menu_image = 'fas fa-do';
$this->menu_priority = 5;
}
function setSubmenu()
{
//$this->addSubmenuItem('Hunde anzeigen','/dogs','far fa-list-alt');
//$this->addSubmenuItem('Hund hinzufügen','/dogs/add','fas fa-plus-circle');
}
function test()
{
2023-11-29 13:53:05 +01:00
$graph1 = partial('graph.html.php', [
'id' => 'graph1',
'title' => 'Graph 1',
'legend' => ['Geschwindigkeit', 'Fehler', 'Verweigerungen', 'Zeit', 'Geschwindigkeit', 'Punkte', 'Platz'],
'xaxis' => ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
'seriesdata' => [
['name' => 'Geschwindigkeit', 'type'=>'line','stack'=>'Total', 'data' => [120, 132, 101, 134, 90, 230, 210]],
['name' => 'Fehler', 'type'=>'line','stack'=>'Total', 'data' => [220, 182, 191, 234, 290, 330, 310]],
['name' => 'Verweigerungen', 'type'=>'line','stack'=>'Total', 'data' => [150, 232, 201, 154, 190, 330, 410]],
['name' => 'Zeit', 'type'=>'line','stack'=>'Total', 'data' => [320, 332, 301, 334, 390, 330, 320]],
['name' => 'Punkte', 'type'=>'line','stack'=>'Total', 'data' => [820, 932, 901, 934, 1290, 1330, 1320]],
['name' => 'Platz', 'type'=>'line','stack'=>'Total', 'data' => [820, 932, 901, 934, 1290, 1330, 1320]]
],
]);
$graph2 = partial('graph.html.php', [
'id' => 'graph2',
'title' => 'Punkte',
'xaxis' => ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
'seriesdata' => [
['name' => 'Punkte', 'type'=>'line','stack'=>'Total', 'data' => [820, 932, 901, 934, 1290, 1330, 1320]],
],
]);
$graph3 = partial('graph.html.php', [
'id' => 'graph3',
'title' => 'Graph 3',
'legend' => ['Punkte'],
'xaxis' => ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
'seriesdata' => [
['name' => 'Punkte', 'type'=>'line','stack'=>'Total', 'data' => [820, 932, 901, 934, 1290, 1330, 1320]],
],
]);
return '<div class="container text-center">
<div class="row">
<div class="col">
'.$graph1.'
</div>
<div class="col">
'.$graph2.'
</div>
<div class="col">
'.$graph3.'
</div>
</div>
</div>';
}
2023-10-23 13:59:26 +02:00
function index()
{
$this->set('successTitle','Erfolgreich');
$this->set('successMessage','Text davon');
$this->set('errorMessage','Fehler ohne Titel');
$this->set('template','demo.html');
}
}