<?php
/**
 * @var Laminas\View\Renderer\PhpRenderer $this
 * @var \Structure\Entity\Structure[] $structures
 * @var \Tour\Entity\Tour[] $tours
 */
$this->headTitle('Nouveau show');
?>
<div class="page-title mt-3">
    <i class="bi bi-calendar3-event"></i> Nouveau show
</div>

<div class="row justify-content-center mt-3">
    <div class="col-md-7">
        <div class="card-app">
            <form method="post">
                <div class="mb-3">
                    <label for="title" class="form-label">Titre</label>
                    <input type="text" name="title" id="title" class="form-control" required placeholder="Ex : Concert Paris – Zenith">
                </div>
                <div class="row">
                    <div class="col mb-3">
                        <label for="date" class="form-label">Date</label>
                        <input type="datetime-local" name="date" id="date" class="form-control">
                    </div>
                </div>
                <div class="row">
                    <div class="col mb-3">
                        <label for="city" class="form-label">Ville</label>
                        <input type="text" name="city" id="city" class="form-control" placeholder="Paris">
                    </div>
                    <div class="col mb-3">
                        <label for="venue" class="form-label">Salle / Lieu</label>
                        <input type="text" name="venue" id="venue" class="form-control" placeholder="Zénith de Paris">
                    </div>
                </div>
                <div class="mb-3">
                    <label for="structure_id" class="form-label">Structure organisatrice</label>
                    <select name="structure_id" id="structure_id" class="form-select" required>
                        <option value="">Choisir...</option>
                        <?php foreach ($structures as $structure): ?>
                            <option value="<?= $structure->getId() ?>"><?= $this->escapeHtml($structure->getName()) ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div class="mb-3">
                    <label for="tour_id" class="form-label">Tournée (optionnel)</label>
                    <select name="tour_id" id="tour_id" class="form-select">
                        <option value="">Aucune</option>
                        <?php foreach ($tours as $tour): ?>
                            <option value="<?= $tour->getId() ?>"><?= $this->escapeHtml($tour->getName()) ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div class="mb-3">
                    <label for="notes" class="form-label">Notes</label>
                    <textarea name="notes" id="notes" class="form-control" rows="3" placeholder="Notes optionnelles"></textarea>
                </div>
                <div class="d-flex justify-content-between">
                    <a href="<?= $this->url('shows', ['action' => 'index']) ?>" class="btn btn-outline-secondary">Annuler</a>
                    <button type="submit" class="btn btn-app">Créer</button>
                </div>
            </form>
        </div>
    </div>
</div>
