Implement email functionality and improve booking system

Features:
- Add real email sending with PHP mail() function
- Create HTML email templates for bookings
- Send booking notifications to bands
- Send confirmation emails to customers
- Add email field to bands table and profile
- Enable guest bookings without login
- Improve form validation and UX
- Add migration script for database updates

This fixes the non-working email system and improves the reservation/booking process significantly.
This commit is contained in:
Claude
2025-12-02 21:01:02 +00:00
parent 798a2785e7
commit acc50dbb5d
6 changed files with 420 additions and 12 deletions
+7 -2
View File
@@ -13,9 +13,10 @@ if ($user['role'] === 'band') {
$band = $stmt->fetch(PDO::FETCH_ASSOC);
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$stmt = db()->prepare('UPDATE bands SET name = :name, city = :city, genre = :genre, price = :price, description = :description, style_tags = :tags WHERE id = :id');
$stmt = db()->prepare('UPDATE bands SET name = :name, email = :email, city = :city, genre = :genre, price = :price, description = :description, style_tags = :tags WHERE id = :id');
$stmt->execute([
':name' => $_POST['name'],
':email' => $_POST['email'] ?? null,
':city' => $_POST['city'],
':genre' => $_POST['genre'],
':price' => (int) $_POST['price'],
@@ -47,7 +48,11 @@ if ($user['role'] === 'band') {
<h2>Bandprofil</h2>
<form method="post">
<label>Bandname
<input class="form-control" name="name" value="<?= htmlspecialchars($band['name']) ?>">
<input class="form-control" name="name" value="<?= htmlspecialchars($band['name']) ?>" required>
</label>
<label>Email für Buchungsanfragen
<input class="form-control" type="email" name="email" value="<?= htmlspecialchars($band['email'] ?? '') ?>" placeholder="band@example.ch">
<small>An diese Adresse werden Buchungsanfragen gesendet</small>
</label>
<label>Ort
<input class="form-control" name="city" value="<?= htmlspecialchars($band['city']) ?>">