000c964317
All checks were successful
Build and push / Pulling repo on server (push) Successful in 2s
266 lines
13 KiB
PHP
266 lines
13 KiB
PHP
<!-- FILEPATH: /home/chris/git/dogstats/web/pages/dogs/dog.html -->
|
|
|
|
<div class="container">
|
|
<div class="">
|
|
<div class="row">
|
|
|
|
<div id="dog-data" class="col-sm-6 offset-sm-3 position-relative rounded-2 shadow mb-3 mb-md-5">
|
|
<img src="<?= $dogdata['photo']?:'https://pictshare.net/1ch3e5.png' ?>/120x160/forcesize" width="120" height="160" class="rounded-5 rounded-top-0 dog-image shadow" alt="<?= escape($dogdata['name']); ?>'s profile Picture">
|
|
|
|
<h1 class="mb-3">
|
|
<?= escape($dogdata['name']); ?>
|
|
</h1>
|
|
<div class="table-responsive">
|
|
<table class="table">
|
|
<tbody>
|
|
<tr>
|
|
<td>Alter:</td>
|
|
<td><?= date_diff(date_create($dogdata['birthday']), date_create('now'))->y ?></td>
|
|
</tr>
|
|
|
|
<?php if($dogdata['breed']): ?>
|
|
<tr>
|
|
<td>Rasse:</td>
|
|
<td><?= escape($dogdata['breed']); ?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
|
|
<?php if($dogdata['kennel_name']): ?>
|
|
<tr>
|
|
<td>Zuchtname:</td>
|
|
<td><?= escape($dogdata['kennel_name']); ?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
|
|
<?php if($dogdata['size']): ?>
|
|
<tr>
|
|
<td>Größe:</td>
|
|
<td><?= escape($dogdata['size']); ?> cm</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
|
|
<?php if($dogdata['agility_size']): ?>
|
|
<tr>
|
|
<td>Agility Größe:</td>
|
|
<td><?= escape($dogdata['agility_size']); ?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<?php if($ismydog===true): ?>
|
|
<div class="d-flex justify-content-end">
|
|
<button type="button" class="btn btn-secondary" hx-get="/dogs/edit/<?= $dogid; ?>" hx-target="#main">
|
|
<i class="fas fa-edit"></i>
|
|
</button>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="container" id="sitemain">
|
|
<!-- table of all runs of this dog-->
|
|
<h2>Alle Ergebnisse</h2>
|
|
|
|
<div class="accordion" id="accordion-dog-runs">
|
|
<div class="accordion-item">
|
|
<h3 class="accordion-header">
|
|
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
|
|
2023
|
|
</button>
|
|
</h3>
|
|
<div id="collapseOne" class="accordion-collapse collapse show" data-bs-parent="#accordion-dog-runs">
|
|
<div class="accordion-body">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Turnier</th>
|
|
<th>Lauf</th>
|
|
<th class="text-end">VW</th>
|
|
<th class="text-end">F</th>
|
|
<th class="text-end">ZF</th>
|
|
<th class="text-end">Zeit</th>
|
|
<th class="text-end">GF</th>
|
|
<th class="text-end">m/Sek</th>
|
|
<th class="text-end">Bew.</th>
|
|
<th class="text-end">Platz</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table-responsive">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Turnier</th>
|
|
<th>Lauf</th>
|
|
<th class="text-end">VW</th>
|
|
<th class="text-end">F</th>
|
|
<th class="text-end">ZF</th>
|
|
<th class="text-end">Zeit</th>
|
|
<th class="text-end">GF</th>
|
|
<th class="text-end">m/Sek</th>
|
|
<th class="text-end">Bew.</th>
|
|
<th class="text-end">Platz</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if(count($results) > 0): ?>
|
|
<?php foreach($results as $result) : ?>
|
|
<?php
|
|
$t = new Tournament();
|
|
$run = new Run();
|
|
|
|
$tname = $t->getField('name',$result['tournament']);
|
|
$tdate = $t->getField('date',$result['tournament']);
|
|
$rname = $run->getField('name',$result['run']);
|
|
|
|
$sdata['dates'][] = $tdate;
|
|
|
|
$sdata['speed'][] = $result['speed'];
|
|
$sdata['errors'][] = $result['errors'];
|
|
$sdata['refusals'][] = $result['refusals'];
|
|
$sdata['time'][] = $result['runtime'];
|
|
$sdata['points'][] = $result['points'];
|
|
$sdata['ranking'][] = $result['ranking'];
|
|
|
|
//'Geschwindigkeit', 'Fehler', 'Verweigerungen', 'Zeit', 'Punkte','Platz'
|
|
|
|
?>
|
|
<tr>
|
|
<td><a href="/tournaments/event/<?= $result['tournament']; ?>">
|
|
<?= $tname; ?>
|
|
</a></td>
|
|
<td><a href="/runs/overview/<?= $result['run']; ?>">
|
|
<?= $rname; ?>
|
|
</a></td>
|
|
<td class="text-end">
|
|
<?= $result['disqualified']?'':escape($result['refusals']); ?>
|
|
</td>
|
|
<td class="text-end">
|
|
<?= $result['disqualified']?'':escape($result['errors']); ?>
|
|
</td>
|
|
<td class="text-end">
|
|
<?= $result['disqualified']?'':escape($result['timefaults']); ?>
|
|
</td>
|
|
<td class="text-end">
|
|
<?= $result['disqualified']?'':escape($result['runtime']); ?>
|
|
</td>
|
|
<td class="text-end">
|
|
<?= $result['disqualified']?'':escape($result['penalties']); ?>
|
|
</td>
|
|
<td class="text-end">
|
|
<?= $result['disqualified']?'':escape($result['speed']); ?>
|
|
</td>
|
|
<td class="text-end">
|
|
<?= $result['disqualified']?'':escape($result['rating']); ?>
|
|
</td>
|
|
<td class="text-end">
|
|
<?= $result['disqualified']?'Dis':escape($result['ranking'] . '. Platz'); ?>
|
|
</td>
|
|
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php else: ?>
|
|
<tr>
|
|
<td colspan="12">
|
|
<div class="alert alert-info" role="alert">
|
|
<i class="fas fa-info-circle"></i> <?= escape($dogdata['name']); ?> hat noch keine Ergebnisse
|
|
</div>
|
|
</td>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if(count($results) > 0): ?>
|
|
<div class="col">
|
|
<div id="graph" data-bs-theme="light" class="card bg-light text-black" style="min-height: 400px;"></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: ['Geschwindigkeit', 'Fehler', 'Verweigerungen', 'Zeit', 'Geschwindigkeit','Punkte','Platz']
|
|
},
|
|
grid: {
|
|
left: '3%',
|
|
right: '4%',
|
|
bottom: '3%',
|
|
containLabel: true
|
|
},
|
|
toolbox: {
|
|
feature: {
|
|
saveAsImage: {}
|
|
}
|
|
},
|
|
xAxis: {
|
|
type: 'category',
|
|
boundaryGap: false,
|
|
data: <?= json_encode($sdata['dates']); ?>
|
|
},
|
|
yAxis: {
|
|
type: 'value'
|
|
},
|
|
series: [
|
|
{
|
|
name: 'Geschwindigkeit',
|
|
type: 'line',
|
|
stack: 'Total',
|
|
data: <?= json_encode($sdata['speed']); ?>
|
|
},
|
|
{
|
|
name: 'Fehler',
|
|
type: 'line',
|
|
stack: 'Total',
|
|
data: <?= json_encode($sdata['errors']); ?>
|
|
},
|
|
{
|
|
name: 'Verweigerungen',
|
|
type: 'line',
|
|
stack: 'Total',
|
|
data: <?= json_encode($sdata['refusals']); ?>
|
|
},
|
|
{
|
|
name: 'Zeit',
|
|
type: 'line',
|
|
stack: 'Total',
|
|
data: <?= json_encode($sdata['time']); ?>
|
|
},
|
|
{
|
|
name: 'Punkte',
|
|
type: 'line',
|
|
stack: 'Total',
|
|
data: <?= json_encode($sdata['points']); ?>
|
|
},
|
|
{
|
|
name: 'Platz',
|
|
type: 'line',
|
|
stack: 'Total',
|
|
data: <?= json_encode($sdata['ranking']); ?>
|
|
}
|
|
]
|
|
};
|
|
|
|
// Display the chart using the configuration items and data just specified.
|
|
myChart.setOption(option);
|
|
</script>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|