{% extends '@RxConnexion/Admin/global.html.twig' %}
{% block body %}
    <div class="row max-width-initial">
        <div class="large-11 columns">
            <form method="GET" action="{{ path('patient_pft') }}">
                <div class="large-4 columns">
                    <div class="input-group">
                        <label class="input-group-label">Branch</label>
                        <select class="input-group-field" name="branch[]" multiple size="4">
                            <option value='All'>All</option>
                            {% for h in healthFacilities %}
                                <option value={{ h.id }} {{ h.id == branch ? 'selected' : '' }}>{{ h.description }}</option>
                            {% endfor %}
                        </select>
                    </div>
                </div>
                <div class="large-2 columns">
                    <div class="input-group">
                        <label class="input-group-label">Month </label>
                        <select class="input-group-field" name="month">
                            <option value="" selected>All</option>
                            {% for month in monthFilter %}
                                <option value="{{ month.value }}" {{ getMonth == month.value ? 'selected' : '' }}>{{ month.display }}</option>
                            {% endfor %}
                        </select>
                    </div>
                    <div class="input-group">
                        <label class="input-group-label">Year </label>
                        <select class="input-group-field" name="year">
                            <option value="" selected>All</option>
                            {% for year in yearFilter %}
                                <option value="{{ year.value }}" {{ getYear == year.value ? 'selected' : '' }}>{{ year.display }}</option>
                            {% endfor %}
                        </select>
                    </div>
                </div>
                <div class="large-2 columns">
                    <button type="submit" class="button just-continue" value=""
                            data-message="Are you sure you want to save this information?"
                    >Apply filter</button>
                </div>
            </form>
            {#<form method="POST" action="{{ path('patient_pft_export_to_excel') }}">#}
                {#<button style="margin-left:1%" type="submit" class="button just-continue" value=""#}
                        {#data-message="Are you sure you want to save this information?"#}
                {#>Export To Excel</button>#}
            {#</form>#}
        </div>
    </div>
    <div class="large-12 columns">
        <h5 class="report-header">{{ page_title }} - No PFT Encounter</h5>
    </div>
    <div class="large-12 columns">
        <table class="report-data" width="100%">
            <thead class="header">
            <tr>
                <th width="15%">Branch</th>
                <th width="15%">Patient</th>
                <th width="70%">Note</th>
            </tr>
            </thead>
            <tbody>
            {% for record in records.no_pft %}
                <tr>
                    <td>{{ record.healthFacility }}</td>
                    <td style="color: {{ record.noteInterval == 'red' or record.note|raw == '' ? 'red' : '' }}"><a href="{{ path('patient_detail', {patient_id : record.patientId|base64Encode, tab: 'c'}) }}" target="_blank">{{ record.fullName }}</a></td>
                    <td>{{ record.note|raw }}</td>
                </tr>
            {% endfor %}
            <tr>
                <td colspan="7">Total: {{ records.no_pft|length|number_format(0, '.', ',') }}</td>
            </tr>
        </table>
    </div>
    <div class="large-12 columns">
        <h5 class="report-header">{{ page_title }} - PFT Encounter Not Completed</h5>
    </div>
    <div class="large-12 columns">
        <table class="report-data" width="100%">
            <thead class="header">
            <tr>
                <th width="15%">Branch</th>
                <th width="15%">Patient</th>
                <th width="70%">Note</th>
            </tr>
            </thead>
            <tbody>
            {% for record in records.no_pft_completed %}
                <tr>
                    <td>{{ record.healthFacility }}</td>
                    <td style="color: {{ record.noteInterval == 'red' or record.note|raw == '' ? 'red' : '' }}"><a href="{{ path('patient_detail', {patient_id : record.patientId|base64Encode, tab: 'c'}) }}" target="_blank">{{ record.fullName }}</a></td>
                    <td>{{ record.note|raw }}</td>
                </tr>
            {% endfor %}
            <tr>
                <td colspan="7">Total: {{ records.no_pft_completed|length|number_format(0, '.', ',') }}</td>
            </tr>
        </table>
    </div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script>
        //<![CDATA[

        //]]>
    </script>
{% endblock %}