38 lines
2.5 KiB
PHTML
38 lines
2.5 KiB
PHTML
<div class="inhalt">
|
|
<div class="form-container">
|
|
<h1>Event erstellen</h1>
|
|
<?php if (!empty(
|
|
$errors['event'])): ?>
|
|
<div class="error-box"><?=htmlspecialchars($errors['event'])?></div>
|
|
<?php endif; ?>
|
|
<form class="form-horizontal" action="index.php" method="post">
|
|
<input type="hidden" name="controller" value="Event">
|
|
<input type="hidden" name="do" value="createEvent">
|
|
<label for="name">Name</label>
|
|
<input type="text" name="name" id="name" required value="<?=htmlspecialchars($validData['name'] ?? '')?>">
|
|
<label for="start_date">Startdatum</label>
|
|
<input type="date" name="start_date" id="start_date" required value="<?=htmlspecialchars($validData['start_date'] ?? '')?>">
|
|
<label for="end_date">Enddatum</label>
|
|
<input type="date" name="end_date" id="end_date" required value="<?=htmlspecialchars($validData['end_date'] ?? '')?>">
|
|
<label for="location_id">Standort</label>
|
|
<select name="location_id" id="location_id" required>
|
|
<option value="">Standort wählen</option>
|
|
<?php if (!empty($locations)): ?>
|
|
<?php foreach ($locations as $loc): ?>
|
|
<option value="<?= htmlspecialchars($loc['location_id']) ?>" <?= (isset($validData['location_id']) && $validData['location_id'] == $loc['location_id']) ? 'selected' : '' ?>>
|
|
<?= htmlspecialchars($loc['city']) ?>, <?= htmlspecialchars($loc['street']) ?> <?= htmlspecialchars($loc['house_number']) ?>
|
|
</option>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</select>
|
|
<label for="description">Beschreibung</label>
|
|
<textarea name="description" id="description" rows="7" required><?=htmlspecialchars($validData['description'] ?? '')?></textarea>
|
|
<label for="max_tickets">Max. Tickets</label>
|
|
<input type="number" name="max_tickets" id="max_tickets" required value="<?=htmlspecialchars($validData['max_tickets'] ?? '')?>">
|
|
<label for="ticket_price">Ticketpreis</label>
|
|
<input type="number" step="0.01" name="ticket_price" id="ticket_price" required value="<?=htmlspecialchars($validData['ticket_price'] ?? '')?>">
|
|
<button class="button-register" type="submit">Event erstellen</button>
|
|
</form>
|
|
<a href="?controller=Event&do=showEvents">Zurück zur Übersicht</a>
|
|
</div>
|
|
</div>
|