graph for dog
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s

This commit is contained in:
Chris 2023-10-31 22:16:41 +00:00
parent a68d94f482
commit faacf4ec2d
4 changed files with 219 additions and 53 deletions

45
web/js/echarts.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -6,15 +6,35 @@
<div class="card"> <div class="card">
<img src="<?= $dogdata['photo']?:'https://pictshare.net/1ch3e5.png' ?>/300x200/forcesize" class="card-img-top" alt="<?= escape($dogdata['name']); ?>'s profile Picture"> <img src="<?= $dogdata['photo']?:'https://pictshare.net/1ch3e5.png' ?>/300x200/forcesize" class="card-img-top" alt="<?= escape($dogdata['name']); ?>'s profile Picture">
<div class="card-body"> <div class="card-body">
<h5 class="card-title"><?= escape($dogdata['name']); ?></h5> <h5 class="card-title">
<?= escape($dogdata['name']); ?>
</h5>
<p class="card-text"> <p class="card-text">
<ul> <ul>
<li>Alter: <?= date_diff(date_create($dogdata['birthday']), date_create('now'))->y ?></li> <li>Alter:
<?= date_diff(date_create($dogdata['birthday']), date_create('now'))->y ?>
</li>
<?php if($dogdata['breed']): ?><li>Rasse: <?= escape($dogdata['breed']); ?></li> <?php endif; ?> <?php if($dogdata['breed']): ?>
<?php if($dogdata['kennel_name']): ?><li>Zuchtname: <?= escape($dogdata['kennel_name']); ?></li> <?php endif; ?> <li>Rasse:
<?php if($dogdata['size']): ?><li>Größe: <?= escape($dogdata['size']); ?> cm</li> <?php endif; ?> <?= escape($dogdata['breed']); ?>
<?php if($dogdata['agility_size']): ?><li>Agility Größe: <?= escape($dogdata['agility_size']); ?></li> <?php endif; ?> </li>
<?php endif; ?>
<?php if($dogdata['kennel_name']): ?>
<li>Zuchtname:
<?= escape($dogdata['kennel_name']); ?>
</li>
<?php endif; ?>
<?php if($dogdata['size']): ?>
<li>Größe:
<?= escape($dogdata['size']); ?> cm
</li>
<?php endif; ?>
<?php if($dogdata['agility_size']): ?>
<li>Agility Größe:
<?= escape($dogdata['agility_size']); ?>
</li>
<?php endif; ?>
</ul> </ul>
<div class="d-flex justify-content-end"> <div class="d-flex justify-content-end">
@ -58,18 +78,42 @@
?> ?>
<tr> <tr>
<td><a href="/tournaments/event/<?= $result['tournament']; ?>"><?= $tname; ?></a></td> <td><a href="/tournaments/event/<?= $result['tournament']; ?>">
<td><a href="/runs/overview/<?= $result['run']; ?>"><?= $rname; ?></a></td> <?= $tname; ?>
<td><?= escape($result['ranking']); ?></td> </a></td>
<td><?= $result['disqualified']?'Ja':'Nein'; ?></td> <td><a href="/runs/overview/<?= $result['run']; ?>">
<td><?= escape($result['refusals']); ?></td> <?= $rname; ?>
<td><?= escape($result['errors']); ?></td> </a></td>
<td><?= escape($result['timefaults']); ?></td> <td>
<td><?= escape($result['runtime']); ?></td> <?= escape($result['ranking']); ?>
<td><?= escape($result['penalties']); ?></td> </td>
<td><?= escape($result['speed']); ?></td> <td>
<td><?= escape($result['rating']); ?></td> <?= $result['disqualified']?'Ja':'Nein'; ?>
<td><a href="/dogs/overview/<?= $result['dog'] ?>"><?= escape( (new Dog())->getField('name',$result['dog']) ); ?></a></td> </td>
<td>
<?= escape($result['refusals']); ?>
</td>
<td>
<?= escape($result['errors']); ?>
</td>
<td>
<?= escape($result['timefaults']); ?>
</td>
<td>
<?= escape($result['runtime']); ?>
</td>
<td>
<?= escape($result['penalties']); ?>
</td>
<td>
<?= escape($result['speed']); ?>
</td>
<td>
<?= escape($result['rating']); ?>
</td>
<td><a href="/dogs/overview/<?= $result['dog'] ?>">
<?= escape( (new Dog())->getField('name',$result['dog']) ); ?>
</a></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
@ -77,6 +121,81 @@
</div> </div>
</div> </div>
</div> <div class="col">
</div> <div id="graph" data-bs-theme="light" class="card bg-light text-black" style="min-height: 500px;"></div>
<script type="text/javascript">
// Initialize the echarts instance based on the prepared dom
var myChart = echarts.init(document.getElementById('graph'));
// Specify the configuration items and data for the chart
var option = {
title: {
text: 'Stacked Line'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
name: 'Email',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: 'Union Ads',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: 'Video Ads',
type: 'line',
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: 'Direct',
type: 'line',
stack: 'Total',
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: 'Search Engine',
type: 'line',
stack: 'Total',
data: [820, 932, 901, 934, 1290, 1330, 1320]
}
]
};
// Display the chart using the configuration items and data just specified.
myChart.setOption(option);
</script>
</div>
</div>
</div>

View File

@ -52,7 +52,7 @@
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="col-6" id="sitemain"> <div class="col-8" id="sitemain">
<?php if($tdata['text']): ?> <?php if($tdata['text']): ?>
<div class="card p-2 mb-4"> <div class="card p-2 mb-4">
<h4>Beschreibungstext</h4> <h4>Beschreibungstext</h4>

View File

@ -9,6 +9,8 @@
<link href="/css/fontawesome.min.css" rel="stylesheet"> <link href="/css/fontawesome.min.css" rel="stylesheet">
<link href="/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/dogstats.css" rel="stylesheet"> <link href="/css/dogstats.css" rel="stylesheet">
<script src="/js/echarts.min.js"></script>
</head> </head>
<body class="d-flex flex-column h-100"> <body class="d-flex flex-column h-100">