{% load static %}


{% include "diaxeirisi/00_head.html" %}
<body id="app-container" class="menu-default show-spinner">
{% include "diaxeirisi/01_menu.html" %}

    <main>
        <div class="container-fluid">
            <div class="row mb-4">
             <div class="col-12">
                <h2>Παραγγελίες</h2>
                <div class="separator mb-5"></div>
                 {% if messages %}
                    <div class="alert alert-success">
                        {% for m in messages %}
                        <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ m }}</li>
                        {% endfor %}
                    </div>
                 {% endif %}
             </div>
                <div class="col-12 mb-4">
                    <div class="card">
                        <div class="card-body">
                            <table class="table table-responsive data-table data-table-feature">
                                <thead>
                                    <tr>
                                        <th>Α/Α</th>
                                        <th>Κατάσταση</th>
                                        <th>Πελάτης</th>
                                        <th>Τηλέφωνο</th>
                                        <th>Ημ/νια Παραγγελίας</th>
                                        <th>Ημ/νια Παράδοσης</th>
                                        <th>Κατάστημα</th>
                                        <th>Προϊόντα</th>
                                        <th>Προβολή</th>
                                    </tr>
                                </thead>
                                <tbody>
                                {% for db_object in  DB_Objects %}
                                    <tr>
                                        <td>{{ db_object.id }}</td>
                                        <td>
                                            {% if db_object.order_status == "ΕΤΜ" %}
                                                <span class="badge badge-pill badge-success mb-1">{{ db_object.order_status }}{{ db_object.room.number }}</span>
                                            {% elif db_object.order_status == "ΝΕΑ" %}
                                                <span class="badge badge-pill badge-info mb-1">{{ db_object.order_status }}</span>
                                            {% elif db_object.order_status == "ΕΠΕ" %}
                                                <span class="badge badge-pill badge-warning mb-1">{{ db_object.order_status }}</span>
                                            {% else %}
                                                <span class="badge badge-pill badge-outline-danger mb-1">{{ db_object.order_status }}</span>
                                            {% endif %}
                                        </td>
                                        <td>{{ db_object.customer_name }}</td>
                                        <td>{{ db_object.customer_telephone }}</td>
                                        <td>{{ db_object.order_date }}</td>
                                        <td>{{ db_object.delivery_date}}</td>
                                        <td>{{ db_object.store }}</td>
                                        <td><ul>{% for prod in  db_object.order_products.all %}
                                            <li>{{ prod }}</li>
                                            {% endfor %}</ul></td>
                                        <td>
                                            <a href="/dx/order/update/{{ db_object.id }}/">

                                            <button type="button" class="btn btn-outline-primary">
                                                Επεξεργασία</button>
                                        </a>
                                        </td>
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </main>


{% include "diaxeirisi/99_footer.html" %}