{% extends '@RxConnexion/Admin/global.html.twig' %}
{% block body %}
    <h5 class="report-header">{{ page_title }}</h5>
    <table class="report-data" width="100%">
        <thead class="header">
        <tr>
            <th>Fax Date</th>
            <th>Patient Name</th>
            <th>Fax Category</th>
            <th>Fax #</th>
            <th>Company</th>
            <th>Branch</th>
            <th>Assigned To</th>
            <th>File Name</th>
            <th>Pages</th>
            <th>Duplicate</th>
            <th>Existing</th>
            <th>Unable To Process</th>
        </tr>
        </thead>
        <tbody>
        {% set totalCount = 0 %}
        {% for record in records %}
            {% set trC = loop.index > 1 and loop.index % 2 == 0 ? 'even' : 'odd' %}
            {% set totalCount = totalCount + 1 %}
            <tr class="{{ trC }}">
                <td>{{ record.faxDate }}</td>
                <td><a href="{{ path('patient_detail', {patient_id : record.patientIdEncoded|default('null')}) }}" target="_blank">{{ record.patientName }}</a></td>
                <td>{{ record.fax_category }}</td>
                <td>{{ record.faxNo == null ?  '8332624798' : record.faxNo }}</td>
                <td>{{ record.companyDesc }}</td>
                <td>{{ record.branchDesc }}</td>
                <td>{{ record.assignTo }}</td>
                <td><a href="{{ path('fax_view', {id: record.id ,sDirection:'IN'}) }}" target="_blank">View</a></td>
                <td>{{ record.pages }}</td>
                <td>{{ record.isDuplicate }}</td>
                <td>{{ record.isExisting }}</td>
                <td>{{ record.isUnableToProcess }}</td>
            </tr>
        {% endfor %}
    </table>
    <div>Total Records: {{ totalCount }}</div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script>
        //<![CDATA[
        jQ(document).ready(function(){
            report_preview.init();
        });
        //]]>
    </script>
{% endblock %}