{% extends "base.html" %}
{% block content %}
<div class="container mt-5">
    <h1 class="mb-4">Daftar Pesanan Tangki Air</h1>
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead class="thead-dark">
                <tr>
                    <th scope="col">Tanggal Pesan</th>
                    <th scope="col">Nama Pelanggan</th>
                    <th scope="col">No. Telepon</th>
                    <th scope="col">Alamat</th>
                    <th scope="col">Kapasitas Tangki (L)</th>
                    <th scope="col">Jumlah</th>
                    <th scope="col">Catatan</th>
                </tr>
            </thead>
            <tbody>
                {% for order in orders %}
                <tr>
                    <td>{{ order.order_date|date:"d M Y, H:i" }}</td>
                    <td>{{ order.customer_name }}</td>
                    <td>{{ order.phone_number }}</td>
                    <td>{{ order.address }}</td>
                    <td>{{ order.tank_capacity }}</td>
                    <td>{{ order.quantity }}</td>
                    <td>{{ order.notes|default:"-" }}</td>
                </tr>
                {% empty %}
                <tr>
                    <td colspan="7" class="text-center">Belum ada pesanan.</td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
    <div class="mt-4">
        <a href="{% url 'index' %}" class="btn btn-secondary">Kembali ke Beranda</a>
    </div>
</div>
{% endblock %}
