Added Styles to Create and Update Event

This commit is contained in:
2025-07-07 20:32:35 +02:00
parent a9944259b6
commit 3faec473ef
3 changed files with 97 additions and 14 deletions

View File

@@ -1,12 +1,36 @@
<?php
include dirname(__DIR__).'/header.phtml';
?>
<div class="inhalt">
<div class="msg">
<p>Das Event "<?php echo $name?>" wurde erfolgreich erstellt!</p>
<a href="?controller=Event&do=showEvents">Weiter</a>
</div>
</div>
<h2>Create Event</h2>
<form action="/Event/create" method="POST">
<label>Event Name:</label>
<input type="text" name="name" required><br>
<?php include dirname(__DIR__).'/footer.phtml'; ?>
<label>Start Date:</label>
<input type="date" name="start_date" required><br>
<label>End Date:</label>
<input type="date" name="end_date" required><br>
<label>Location:</label>
<select name="location_id" required>
<option value="">Select location</option>
<?php if (!empty($locations)): ?>
<?php foreach ($locations as $loc): ?>
<option value="<?= htmlspecialchars($loc['location_id']) ?>">
<?= htmlspecialchars($loc['city']) ?>, <?= htmlspecialchars($loc['street']) ?> <?= htmlspecialchars($loc['house_number']) ?>
</option>
<?php endforeach; ?>
<?php endif; ?>
</select><br>
<label>Description:</label>
<textarea name="description" required></textarea><br>
<label>Max Tickets:</label>
<input type="number" name="max_tickets" required><br>
<label>Ticket Price:</label>
<input type="number" step="0.01" name="ticket_price" required><br>
<button type="submit">Create Event</button>
</form>
</div>

View File

@@ -3,10 +3,32 @@ include dirname(__DIR__).'/header.phtml';
?>
<div class="inhalt">
<div class="msg">
<p>Das Event mit der ID "<?php echo $ausstellungid?>" wurde erfolgreich bearbeitet!</p>
<a href="?controller=Event&do=showEvents">Weiter</a>
</div>
<h2>Update Event</h2>
<form action="/Event/update?id=<?= htmlspecialchars($event['id']) ?>" method="POST">
<label>Event Name:</label>
<input type="text" name="name" value="<?= htmlspecialchars($event['name']) ?>" required><br>
<label>Start Date:</label>
<input type="date" name="start_date" value="<?= htmlspecialchars($event['start_date']) ?>" required><br>
<label>End Date:</label>
<input type="date" name="end_date" value="<?= htmlspecialchars($event['end_date']) ?>" required><br>
<label>Location:</label>
<input type="text" name="location_name" value="<?= htmlspecialchars($event['location_name']) ?>" readonly><br>
<input type="hidden" name="location_id" value="<?= htmlspecialchars($event['location_id']) ?>">
<label>Description:</label>
<textarea name="description" required><?= htmlspecialchars($event['description']) ?></textarea><br>
<label>Max Tickets:</label>
<input type="number" name="max_tickets" value="<?= htmlspecialchars($event['max_tickets']) ?>" required><br>
<label>Ticket Price:</label>
<input type="number" step="0.01" name="ticket_price" value="<?= htmlspecialchars($event['ticket_price']) ?>" required><br>
<button type="submit">Update Event</button>
</form>
</div>
<?php include dirname(__DIR__).'/footer.phtml'; ?>