<section class="section">
  <p class="eyebrow">Admin</p>
  <h1>Bilete</h1>
  <p>Status bilete, blocare/deblocare si urmarire eveniment.</p>
  <div class="table-wrap">
    <table>
      <thead><tr><th>Bilet</th><th>Eveniment</th><th>Tip</th><th>Holder</th><th>Status</th><th>Actiuni</th></tr></thead>
      <tbody>
        <% tickets.forEach((ticket) => { %>
          <tr>
            <td><strong><%= ticket.code %></strong><br><small><%= ticket.order_number || '-' %></small></td>
            <td><%= ticket.event_title || '-' %></td>
            <td><%= ticket.ticket_type_name || '-' %></td>
            <td><%= ticket.holder_name || '-' %><br><small><%= ticket.holder_email || '-' %></small></td>
            <td><%- include('../partials/status-badge', { status: ticket.status }) %></td>
            <td>
              <form method="post" action="/admin/tickets/<%= ticket.id %>/status" class="inline-admin-form">
                <%- include('../partials/csrf-field') %>
                <select name="status">
                  <% ['valid', 'checked_in', 'transferred', 'refunded', 'cancelled', 'blocked'].forEach((status) => { %>
                    <option value="<%= status %>" <%= ticket.status === status ? 'selected' : '' %>><%= status %></option>
                  <% }) %>
                </select>
                <button>Salveaza</button>
              </form>
            </td>
          </tr>
        <% }) %>
      </tbody>
    </table>
  </div>
</section>
