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/runs/edit_result.html

116 lines
5.9 KiB
HTML
Raw Permalink Normal View History

2023-10-31 21:38:03 +01:00
<div class="container">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/tournaments/event/<?= $tournament_id; ?>" hx-push-url="/tournaments/event/<?= $tournament_id; ?>" hx-get="/tournaments/event/<?= $tournament_id; ?>" hx-target="#main">
<i class="fas fa-calendar-star"></i>
<?= escape($tournament['name']); ?>
</a>
</li>
<li class="breadcrumb-item">
<a href="/runs/overview/<?= $run_id; ?>" hx-push-url="/runs/overview/<?= $run_id; ?>" hx-get="/runs/overview/<?= $run_id; ?>" hx-target="#main">
<i class="far fa-running"></i>
<?= escape($run['name']); ?>
</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
<i class="fas fa-edit"></i>
<?= $result_id?'Bearbeiten':'Eintragen'; ?>
</li>
</ol>
</nav>
<h2>Ergebnis
<?= $result_id?'Bearbeiten':'Eintragen'; ?>
</h2>
2023-11-01 22:03:37 +01:00
<form id="resulteditform" hx-post="/runs/validateresults" hx-encoding='multipart/form-data' hx-target="#response" hx-disabled-elt="#submit">
<div class="dropzone-previews"></div>
2023-10-31 21:38:03 +01:00
<input type="hidden" name="result_id" value="<?= $result_id; ?>">
<input type="hidden" name="run_id" value="<?= $run_id; ?>">
<div>
<label for="dog">Hund</label>
2023-11-02 18:52:05 +01:00
<select id="dog" name="dog" class="form-control">
2023-10-31 21:38:03 +01:00
<option value="false" <?=!$result['dog']?'selected':''; ?>>-- Bitte auswählen --</option>
<?php foreach($_SESSION['user']->data['dogs'] as $dogid) : ?>
<?php
2023-10-31 23:42:26 +01:00
$dog = new Dog();
$dog->load($dogid);
$dd = $dog->data;
?>
2023-10-31 21:38:03 +01:00
<option value="<?= $dogid ?>" <?=$result['dog']==$dogid ?'selected':''; ?>>
<?= escape($dd['name']); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div class="form-check form-switch">
<label class="form-check-label" for="disqualified">Disqualifiziert</label>
2023-11-02 18:52:05 +01:00
<input class="form-control form-check-input" type="checkbox" id="disqualified" name="disqualified" value="1" <?=$result['disqualified']=='1' ?'checked':''; ?>>
2023-10-31 21:38:03 +01:00
</div>
<div>
2023-10-31 23:42:26 +01:00
<label for="refusals">Verweigerungen</label>
2023-11-02 18:52:05 +01:00
<input type="number" value="<?= $result['refusals']; ?>" id="refusals" name="refusals" class="form-control">
2023-10-31 21:38:03 +01:00
</div>
<div>
<label for="faults">Fehler</label>
2023-11-02 18:52:05 +01:00
<input type="number" value="<?= $result['faults']; ?>" id="faults" name="faults" class="form-control">
2023-10-31 21:38:03 +01:00
</div>
<div>
<label for="time_faults">Zeitfehler</label>
2023-11-02 18:52:05 +01:00
<input type="number" step="0.01" value="<?= $result['time_faults']; ?>" id="time_faults" name="time_faults" class="form-control">
2023-10-31 21:38:03 +01:00
</div>
<div>
<label for="time">Zeit</label>
2023-11-02 18:52:05 +01:00
<input type="number" step="0.01" value="<?= $result['time']; ?>" id="time" name="time" class="form-control">
2023-10-31 21:38:03 +01:00
</div>
<div>
<label for="penalties">Gesamtfehler</label>
2023-11-02 18:52:05 +01:00
<input type="number" step="0.01" value="<?= $result['penalties']; ?>" id="penalties" name="penalties" class="form-control">
2023-10-31 21:38:03 +01:00
</div>
<div>
<label for="time_speed">m/Sek</label>
2023-11-02 18:52:05 +01:00
<input type="number" step="0.01" value="<?= $result['time_speed']; ?>" id="time_speed" name="time_speed" class="form-control">
2023-10-31 21:38:03 +01:00
</div>
<div>
<label for="bewertung">Bewertung</label>
2023-11-02 18:52:05 +01:00
<select id="bewertung" name="bewertung" class="form-control">
2023-10-31 21:38:03 +01:00
<option value="V" <?=$result['bewertung']=='V' ?'selected':''; ?>>V</option>
<option value="SG" <?=$result['bewertung']=='SG' ?'selected':''; ?>>SG</option>
<option value="G" <?=$result['bewertung']=='G' ?'selected':''; ?>>G</option>
<option Galue="B" <?=$result['bewertung']=='B' ?'selected':''; ?>>B</option>
</select>
</div>
<div>
<label for="points">Punkte</label>
2023-11-02 18:52:05 +01:00
<input type="number" value="<?= $result['points']; ?>" id="points" name="points" class="form-control">
2023-10-31 21:38:03 +01:00
</div>
<div>
<label for="rank">Platz</label>
2023-11-02 18:52:05 +01:00
<input type="number" value="<?= $result['rank']; ?>" id="rank" name="rank" class="form-control">
2023-10-31 21:38:03 +01:00
</div>
<div>
<label for="uploads">Uploads</label>
2023-11-02 18:52:05 +01:00
<input type="file" accept="image/png, image/jpeg, image/gif" id="uploads" class="form-control" name="photos[]" multiple>
2023-10-31 21:38:03 +01:00
</div>
<div>
<label for="video-url">Video Url</label>
2023-11-02 18:52:05 +01:00
<input type="text" value="<?= $result['video-url']; ?>" class="form-control" id="video-url" aria-describedby="basic-addon3" placeholder="https://www.youtube.com/...">
2023-10-31 21:38:03 +01:00
</div>
<div>
<label for="memo">Memo</label>
2023-11-02 18:52:05 +01:00
<textarea value="<?= $result['memo']; ?>" id="memo" name="memo" class="form-control" placeholder="Deine Gedankengänge"></textarea>
2023-10-31 21:38:03 +01:00
</div>
<div class="form-check form-switch">
<label class="form-check-label" for="public">Daten im Lauf veröffentlichen</label>
2023-11-02 18:52:05 +01:00
<input class="form-control form-check-input" type="checkbox" id="public" name="public" value="1" <?=$result['public']!='0' ?'checked':''; ?>>
2023-10-31 21:38:03 +01:00
</div>
2023-11-01 22:03:37 +01:00
<button type="submit" id="submit" name="submit" value="true" class="btn btn-primary">Speichern</button>
<progress id='progress' value='0' max='100'></progress>
2023-10-31 21:38:03 +01:00
<div id="response"></div>
</form>
</div>
<script>
htmx.on('#resulteditform', 'htmx:xhr:progress', function(evt) {
htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100)
});
</script>