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

49 lines
4.2 KiB
HTML
Raw 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-10-26 13:46:55 +02:00
<form id="dogeditform" hx-post="/dogs/edit" hx-encoding='multipart/form-data' hx-target="#response">
2023-10-22 23:05:24 +02:00
<input type="hidden" name="dog_id" value="<?= $dogid; ?>">
<div>
<label for="name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Name</label>
<input type="text" value="<?= $dogdata['name']; ?>" id="name" name="name" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="Max" required>
</div>
<div>
<label for="kennel_name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Zuchtname</label>
<input type="text" value="<?= $dogdata['kennel_name']; ?>" id="kennel_name" name="kennel_name" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="Zuchtname">
</div>
<div>
<label for="dog_breed" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Rasse</label>
<input type="text" value="<?= $dogdata['breed']; ?>" id="dog_breed" name="dog_breed" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="Flowbite">
</div>
<div>
<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>
<input type="number" value="<?= $dogdata['size']; ?>" id="dog_size" name="dog_size" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="">
</div>
<div>
<label for="dog_birthday" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Geburtstag des Hundes</label>
<input type="date" value="<?= $dogdata['birthday']; ?>" id="dog_birthday" name="dog_birthday" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="" required>
</div>
<div>
<label for="agi_height_category" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Agility Größenklasse</label>
<select id="agi_height_category" name="agi_height_category" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
<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-26 13:46:55 +02:00
<div>
<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>