{% 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-5 columns">
                            <div class="input-group">
                                <label class="input-group-label">Month</label>
                                <select class="input-group-field" id="month-filter-type">
                                    <option value="all" selected>All Months</option>
                                    {% for month in monthFilter %}
                                        <option value="{{ month.value }}" >{{ month.display }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        <div class="large-5 columns">
                            <div class="input-group">
                                <label class="input-group-label">Status</label>
                                <select class="input-group-field" id="status-filter-type">
                                    <option value="all">All Status</option>
                                    {% for status, value in statusFilter %}
                                        <option value="{{ value }}" {{ status == 'Active' ? 'selected' : '' }} >{{ status }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        {% if userData.type == 'Super Admin' or 'Admin Faxing Option' in userData.accesses %}
                            <div class="large-2 columns">
                                <label class="middle text-right">
                                    <a href="javascript:void(0)" class="href-faxTran-form href-new-action" data-action="n" data-id="0">Create Fax</a>
                                </label>
                            </div>
                        {% endif %}
                    </div>
                    <form method="POST" action="{{ path('fax') }}">
                        <div class="text-right">
                            {#<a class="href-new-action" href="{{ path('fax_send_form') }}">Send Fax</a>#}
                        </div>
                        <table class="display responsive" id="unite-fax-datalist" width="100%">
                            <thead>
                            <tr>
                                {#<th>No</th>#}
                                <th style="text-align: center">Date</th>
                                <th>From Fax#</th>
                                <th>Pages</th>
                                <th>Category</th>
                                <th>Patient</th>
                                <th>Branch</th>
                                <th>Assigned To</th>
                                <th>Status</th>
                                <th>Action</th>
                            </tr>
                            </thead>
                            <tbody></tbody>
                        </table>
                        <div class="small-12 columns">
                            <hr class="max-width-initial">
                            <div class="row">
                                <div class="large-6 columns">
                                    <select name="forms[accountUser]" >
                                        <option></option>
                                        {% for m in moaUsers %}
                                            <option value={{ m.id }}>{{ m.full_name }}</option>
                                        {% endfor %}
                                    </select>
                                </div>
                                <button type="submit" class="button just-continue" style="background-color: grey">Assign Fax</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="reveal small" id="modal-small" data-reveal>
        <div id="modal-content-small"></div>
        <button class="close-button" data-close aria-label="Close modal" type="button">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script language="javascript">
        //<![CDATA[
        faxTran.settings.unite_ajaxUrl = '{{ path('unite_ajax_list') }}';
        faxTran.settings.faxTranFormUrl = '{{ path('fax_form') }}';
        faxTran.settings.faxTran_formActionUrl = '{{ path('fax_form_save') }}';
        faxTran.settings.health_facility_autocomplete_url = '{{ path('health_facility_autocomplete') }}';
        faxTran.settings.account_user_autocomplete_url = '{{ path('account_user_autocomplete') }}';
        faxTran.settings.patient_autocomplete_url = '{{ path('patient_autocomplete') }}';
        jQ(document).ready(function(){
            faxTran.init();
        });
        //]]>
    </script>
{% endblock %}