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/dogs/edit.html

56 lines
3.4 KiB
HTML
Raw Permalink Normal View History

2023-10-23 13:05:16 +02:00
<div>
2023-10-26 13:46:55 +02:00
<h1>Hund <?= $dogid?'Bearbeiten':'Hinzufügen'; ?></h1>
2023-10-22 23:05:24 +02:00
2023-11-03 21:07:34 +01:00
<form id="dogeditform" hx-post="/dogs/edit" hx-encoding='multipart/form-data' hx-target="#response" class="row row-cols-2">
2023-10-22 23:05:24 +02:00
<input type="hidden" name="dog_id" value="<?= $dogid; ?>">
2023-10-27 11:30:29 +02:00
<div class="mb-3 mb-md-4">
2023-10-22 23:05:24 +02:00
<label for="name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Name</label>
2023-10-27 11:30:29 +02:00
<input type="text" value="<?= $dogdata['name']; ?>" id="name" name="name" class="form-control" placeholder="Max" required>
2023-10-22 23:05:24 +02:00
</div>
2023-10-27 11:30:29 +02:00
<div class="mb-3 mb-md-4">
2023-10-22 23:05:24 +02:00
<label for="kennel_name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Zuchtname</label>
2023-10-27 11:30:29 +02:00
<input type="text" value="<?= $dogdata['kennel_name']; ?>" id="kennel_name" name="kennel_name" class="form-control" placeholder="Zuchtname">
2023-10-22 23:05:24 +02:00
</div>
2023-10-27 11:30:29 +02:00
<div class="mb-3 mb-md-4">
2023-10-22 23:05:24 +02:00
<label for="dog_breed" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Rasse</label>
2023-10-27 11:30:29 +02:00
<input type="text" value="<?= $dogdata['breed']; ?>" id="dog_breed" name="dog_breed" class="form-control" placeholder="Flowbite">
2023-10-22 23:05:24 +02:00
</div>
2023-10-27 11:30:29 +02:00
<div class="mb-3 mb-md-4">
2023-10-22 23:05:24 +02:00
<label for="dog_size" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Größe des Hundes (in cm)</label>
2023-10-27 11:30:29 +02:00
<input type="number" value="<?= $dogdata['size']; ?>" id="dog_size" name="dog_size" class="form-control" placeholder="">
2023-10-22 23:05:24 +02:00
</div>
2023-10-27 11:30:29 +02:00
<div class="mb-3 mb-md-4">
2023-10-22 23:05:24 +02:00
<label for="dog_birthday" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Geburtstag des Hundes</label>
2023-10-27 11:30:29 +02:00
<input type="date" value="<?= $dogdata['birthday']; ?>" id="dog_birthday" name="dog_birthday" class="form-control" placeholder="" required>
2023-10-22 23:05:24 +02:00
</div>
2023-10-27 11:30:29 +02:00
<div class="mb-3 mb-md-4">
<label for="agi_active" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Hund ist noch aktiv im Sport?</label>
2023-10-27 11:30:29 +02:00
<select id="agi_active" name="agi_active" class="form-control">
<option value="1" <?= $dogdata['active']=='1'?'selected':''; ?>>Ja</option>
<option value="0" <?= $dogdata['active']=='0'?'selected':''; ?>>Nein</option>
</select>
</div>
2023-10-27 11:30:29 +02:00
<div class="mb-3 mb-md-4">
2023-10-22 23:05:24 +02:00
<label for="agi_height_category" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Agility Größenklasse</label>
2023-10-27 11:30:29 +02:00
<select id="agi_height_category" name="agi_height_category" class="form-control">
2023-10-22 23:05:24 +02:00
<option value="S" <?= $dogdata['agility_size']=='S'?'selected':''; ?>>S</option>
<option value="M" <?= $dogdata['agility_size']=='M'?'selected':''; ?>>M</option>
<option value="I" <?= $dogdata['agility_size']=='I'?'selected':''; ?>>I</option>
<option value="L" <?= $dogdata['agility_size']=='L'?'selected':''; ?>>L</option>
</select>
</div>
2023-10-27 11:30:29 +02:00
<div class="mb-3 mb-md-4">
2023-10-26 13:46:55 +02:00
<label for="photo" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Photo</label>
2023-10-26 16:41:33 +02:00
<input type="file" accept="image/png, image/jpeg, image/gif" id="photo" name="photo">
2023-10-26 13:46:55 +02:00
</div>
2023-10-23 13:05:16 +02:00
<button type="submit" name="submit" value="true" class="btn btn-primary">Submit</button>
2023-10-22 23:05:24 +02:00
</form>
2023-10-26 13:46:55 +02:00
<progress id='progress' value='0' max='100'></progress>
2023-10-22 23:05:24 +02:00
<div id="response"></div>
2023-10-26 13:46:55 +02:00
</div>
<script>
htmx.on('#dogeditform', 'htmx:xhr:progress', function(evt) {
htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100)
});
</script>