{% 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>
                    </div>
                    <div class="text-right">
                        {% if userData.type == 'Super Admin' or 'Admin Referral New' in userData.accesses %}
                            <a class="href-new-action" href="{{ path('referral_form') }}">New Referral</a>
                        {% endif %}
                    </div>
                    <table class="display responsive" id="referral-datalist" width="100%">
                        <thead>
                        <tr>
                            <th>Referral Date</th>
                            <th>Full Name</th>
                            <th>Branch</th>
                            <th>Gender</th>
                            <th>Birth Date</th>
                            <th>Address</th>
                            <th>Referring Physician</th>
                            <th>Referring Affiliate</th>
                            <th>Action</th>
                        </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                </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[
        referral.settings.ajaxUrl = '{{ path('referral_ajax_list') }}';
        referral.settings.referralPatientApproval_formUrl = '{{ path('referral_approval_form') }}';
        referral.settings.referralPatientApproval_formActionUrl = '{{ path('referral_approval_action') }}';
        jQ(document).ready(function(){
            referral.init();
        });
        //]]>
    </script>
{% endblock %}