All checks were successful
		
		
	
	Build and push / Pulling repo on server (push) Successful in 2s
				
		
			
				
	
	
		
			147 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			147 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<h2>Hunde:</h2>
 | 
						|
<ul>
 | 
						|
    <?php foreach ($dogs as $dog) : ?>
 | 
						|
        <li><a href="#<?= $dog ?>"><?= $dog ?></a></li>
 | 
						|
    <?php endforeach; ?>
 | 
						|
</ul>
 | 
						|
 | 
						|
 | 
						|
<?php foreach ($dogs as $dog) :
 | 
						|
 | 
						|
    $dogid=preg_replace("/[^A-Za-z0-9]/", '', $dog);
 | 
						|
    $results = $results_dogs[$dog];
 | 
						|
    $sdata = [];
 | 
						|
?>
 | 
						|
 | 
						|
    <h1 id="<?= $dogid; ?>"><?= $dog; ?></h1>
 | 
						|
 | 
						|
    <button onClick="getElementById('table_<?= $dogid ?>').style.display='table'">Tabelle anzeigen</button>
 | 
						|
    <table id="table_<?= $dogid ?>" class="table" style="display:none">
 | 
						|
        <tr>
 | 
						|
            <th>event</th>
 | 
						|
            <th>Wann wars</th>
 | 
						|
            <th>run</th>
 | 
						|
            <th>rang</th>
 | 
						|
            <th>stnr</th>
 | 
						|
            <th>teilnehmer</th>
 | 
						|
            <th>hund</th>
 | 
						|
            <th>verein</th>
 | 
						|
            <th>f</th>
 | 
						|
            <th>vw</th>
 | 
						|
            <th>zf</th>
 | 
						|
            <th>zeit</th>
 | 
						|
            <th>gf</th>
 | 
						|
            <th>msek</th>
 | 
						|
            <th>bew</th>
 | 
						|
            <th>punkte</th>
 | 
						|
        </tr>
 | 
						|
        <?php foreach ($results as $res) :
 | 
						|
            // graph data preparation
 | 
						|
 | 
						|
            if ($res['bew'] != 'DIS' && $res['punkte'] != 'DIS') {
 | 
						|
                $sdata['dates'][] = date("d.m.Y", strtotime($res['date']));
 | 
						|
                $sdata['speed'][] = $res['msek'] ?: 0;
 | 
						|
                $sdata['errors'][] = $res['f'] ?: 0;
 | 
						|
                $sdata['refusals'][] = $res['vw'] ?: 0;
 | 
						|
                $sdata['time'][] = $res['zeit'] ?: 0;
 | 
						|
                $sdata['points'][] = $res['punkte'];
 | 
						|
                $sdata['ranking'][] = $res['rang'];
 | 
						|
 | 
						|
                $a = array_filter($sdata['speed']);
 | 
						|
                if(count($a)>0)
 | 
						|
                    $averagespeed = round(array_sum($a)/count($a),2);
 | 
						|
 | 
						|
                $a = array_filter($sdata['errors']);
 | 
						|
                if(count($a)>0)
 | 
						|
                    $averageerrors = round(array_sum($a)/count($a),2);
 | 
						|
 | 
						|
                $a = array_filter($sdata['refusals']);
 | 
						|
                if(count($a)>0)
 | 
						|
                    $averagerefusals = round(array_sum($a)/count($a),2);
 | 
						|
 | 
						|
                $a = array_filter($sdata['ranking']);
 | 
						|
                if(count($a)>0)
 | 
						|
                    $averageranking = round(array_sum($a)/count($a),2);
 | 
						|
            }
 | 
						|
 | 
						|
        ?>
 | 
						|
            <tr>
 | 
						|
                <td><?= $res['event'] ?></td>
 | 
						|
                <td><?= $res['ago'] ?></td>
 | 
						|
                <td><?= $res['run'] ?></td>
 | 
						|
                <td><?= $res['rang'] ?></td>
 | 
						|
                <td><?= $res['stnr'] ?></td>
 | 
						|
                <td><?= $res['teilnehmer'] ?></td>
 | 
						|
                <td><?= $res['hund'] ?></td>
 | 
						|
                <td><?= $res['verein'] ?></td>
 | 
						|
                <td><?= $res['f'] ?></td>
 | 
						|
                <td><?= $res['vw'] ?></td>
 | 
						|
                <td><?= $res['zf'] ?></td>
 | 
						|
                <td><?= $res['zeit'] ?></td>
 | 
						|
                <td><?= $res['gf'] ?></td>
 | 
						|
                <td><?= $res['msek'] ?></td>
 | 
						|
                <td><?= $res['bew'] ?></td>
 | 
						|
                <td><?= $res['punkte'] ?></td>
 | 
						|
 | 
						|
            </tr>
 | 
						|
        <?php endforeach; ?>
 | 
						|
    </table>
 | 
						|
 | 
						|
    <h4>Statistik</h4>
 | 
						|
 | 
						|
    <div class="card" style="width: 18rem;">
 | 
						|
        <ul class="list-group list-group-flush">
 | 
						|
            <li class="list-group-item">Durchschnittsgeschwinigkeit: <span class="badge bg-secondary"><?= $averagespeed ?> m/s</span></li>
 | 
						|
            <li class="list-group-item">Fehler pro Lauf: <span class="badge bg-secondary"><?= $averageerrors ?></span></li>
 | 
						|
            <li class="list-group-item">Verweigerungen pro Lauf: <span class="badge bg-secondary"><?= $averagerefusals ?></span></li>
 | 
						|
            <li class="list-group-item">Durchschnittliche Platzierung: <span class="badge bg-secondary"><?= $averageranking ?></span></li>
 | 
						|
        </ul>
 | 
						|
    </div>
 | 
						|
    <br/>
 | 
						|
 | 
						|
    <div class="row">
 | 
						|
        <?php if (count($results) > 0) : ?>
 | 
						|
            <div class="col">
 | 
						|
                <?= partial('graph.html.php', [
 | 
						|
                    'id' => 'graph1'.$dogid,
 | 
						|
                    'title' => 'Fehler und Verweigerungen',
 | 
						|
                    'xaxis' => $sdata['dates'],
 | 
						|
                    'seriesdata' => [
 | 
						|
                        ['name' => 'Fehler', 'type' => 'line', 'stack' => 'Total', 'data' => $sdata['errors']],
 | 
						|
                        ['name' => 'Verweigerungen', 'type' => 'line', 'stack' => 'Total', 'data' => $sdata['refusals']],
 | 
						|
                    ],
 | 
						|
                ]);
 | 
						|
                ?>
 | 
						|
            </div>
 | 
						|
 | 
						|
            <div class="col">
 | 
						|
                <?= partial('graph.html.php', [
 | 
						|
                    'id' => 'graph2'.$dogid,
 | 
						|
                    'title' => 'Geschwindigkeit',
 | 
						|
                    'xaxis' => $sdata['dates'],
 | 
						|
                    'seriesdata' => [
 | 
						|
                        ['name' => 'Geschwindigkeit', 'type' => 'line', 'stack' => 'Total', 'data' => $sdata['speed']],
 | 
						|
                    ],
 | 
						|
                ]);
 | 
						|
                ?>
 | 
						|
            </div>
 | 
						|
 | 
						|
            <div class="col">
 | 
						|
                <?= partial('graph.html.php', [
 | 
						|
                    'id' => 'graph3'.$dogid,
 | 
						|
                    'title' => 'Platzierung',
 | 
						|
                    'xaxis' => $sdata['dates'],
 | 
						|
                    'seriesdata' => [
 | 
						|
                        ['name' => 'Platzierung', 'type' => 'line', 'stack' => 'Total', 'data' => $sdata['ranking']],
 | 
						|
                    ],
 | 
						|
                ]);
 | 
						|
                ?>
 | 
						|
            </div>
 | 
						|
    </div>
 | 
						|
 | 
						|
<?php endif; ?>
 | 
						|
 | 
						|
 | 
						|
<hr>
 | 
						|
 | 
						|
<?php endforeach; ?>
 |