56 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<div>
 | 
						|
  <h1>Hund <?= $dogid?'Bearbeiten':'Hinzufügen'; ?></h1>
 | 
						|
 | 
						|
  <form id="dogeditform" hx-post="/dogs/edit" hx-encoding='multipart/form-data' hx-target="#response" class="row row-cols-2">
 | 
						|
    <input type="hidden" name="dog_id" value="<?= $dogid; ?>">
 | 
						|
    <div class="mb-3 mb-md-4">
 | 
						|
        <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="form-control" placeholder="Max" required>
 | 
						|
    </div>
 | 
						|
    <div class="mb-3 mb-md-4">
 | 
						|
        <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="form-control" placeholder="Zuchtname">
 | 
						|
    </div>
 | 
						|
    <div class="mb-3 mb-md-4">
 | 
						|
        <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="form-control" placeholder="Flowbite">
 | 
						|
    </div>
 | 
						|
    <div class="mb-3 mb-md-4">
 | 
						|
        <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="form-control" placeholder="">
 | 
						|
    </div>
 | 
						|
    <div class="mb-3 mb-md-4">
 | 
						|
      <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="form-control" placeholder="" required>
 | 
						|
    </div>
 | 
						|
    <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>
 | 
						|
      <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>
 | 
						|
    <div class="mb-3 mb-md-4">
 | 
						|
      <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="form-control">
 | 
						|
        <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>
 | 
						|
    <div class="mb-3 mb-md-4">
 | 
						|
      <label for="photo" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Photo</label>
 | 
						|
      <input type="file" accept="image/png, image/jpeg, image/gif" id="photo" name="photo">
 | 
						|
    </div>
 | 
						|
    <button type="submit" name="submit" value="true" class="btn btn-primary">Submit</button>
 | 
						|
  </form>
 | 
						|
  <progress id='progress' value='0' max='100'></progress>
 | 
						|
  <div id="response"></div>
 | 
						|
</div>
 | 
						|
 | 
						|
<script>
 | 
						|
  htmx.on('#dogeditform', 'htmx:xhr:progress', function(evt) {
 | 
						|
    htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100)
 | 
						|
  });
 | 
						|
</script> |