{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <div class="row max-width-initial">
        <div class="small-12 columns">
            <div class="content-container has-loading">
                <div class="content-container-content hide">
                    <div class="row max-width-initial">
                        <div class="large-4 columns">
                            <div class="input-group">
                                <label class="input-group-label">Branch</label>
                                <select class="input-group-field" id="purchaseOrderFilter-branch">
                                    <option value="all">All</option>
                                    {% for branch in branches %}
                                        <option value="{{ branch.idencoded }}">{{ branch.description }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        <div class="large-4 columns">
                            <div class="input-group">
                                <label class="input-group-label">Status</label>
                                <select class="input-group-field" id="purchaseOrderFilter-status">
                                    <option value="all">All</option>
                                    <option {{ status is null or status == 'Active' ? 'selected' : '' }} value="Active">Active</option>
                                    <option {{ status == 'Closed' ? 'selected' : '' }} value="Closed">Closed</option>
                                </select>
                            </div>
                        </div>
                        <div class="large-4 columns">
                        </div>
                    </div>
                    <table class="display responsive" id="purchaseOrder-datalist" width="100%">
                        <thead>
                        <tr>
                            {#<th>Batch No.</th>#}
                            <th>Supplier</th>
                            <th>Control No</th>
                            <th>PO No/s</th>
                            <th>Request Date</th>
                            <th>Branch</th>
                            {#<th>Department</th>#}
                            <th>Purpose</th>
                            {#<th>Specific Purpose</th>#}
                            <th>Requested By</th>
                            {#<th>Status</th>#}
                            <th>Action</th>
                        </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script language="javascript">
        //<![CDATA[
        purchaseOrder.settings.ajaxUrl = '{{ path('material_requisition_purchase_order_ajax_list') }}';
        jQ(document).ready(purchaseOrder.init);
        //]]>
    </script>
{% endblock %}