{% extends '@RxConnexion/Admin/global.html.twig' %}
{% block body %}
    <h3 class="report-header"><strong>Referral - Fax Summary</strong></h3>
    <div style="margin-bottom: 10%;">
        <table class="report-data" width="100%">
            <thead class="header">
            <tr>
                <th>Branch</th>
                <th>Received</th>
                <th>Encoded</th>
                <th>Duplicate</th>
                <th>Existing</th>
                <th>Unable to Process</th>
            </tr>
            </thead>
            <tbody>
            {% set totalCount = 0 %}
            {% for branchesSummary in branch %}
                {% set trC = loop.index > 1 and loop.index % 2 == 0 ? 'even' : 'odd' %}
                {% set totalCount = totalCount + 1 %}
                <tr class="{{ trC }}">
                    <td>{{ branchesSummary.description is defined ? branchesSummary.description : ''}}</td>
                    <td>{{ branchesSummary.faxReceived is defined ? branchesSummary.faxReceived : 0}}</td>
                    <td>{{ branchesSummary.referralCount is defined ? branchesSummary.referralCount : 0}}</td>
                    <td>{{ branchesSummary.faxIsDuplicatedCount is defined ? branchesSummary.faxIsDuplicatedCount : 0}}</td>
                    <td>{{ branchesSummary.faxIsExistingCount is defined ? branchesSummary.faxIsExistingCount : 0}}</td>
                    <td>{{ branchesSummary.faxIsUnableToProcessCount is defined ? branchesSummary.faxIsUnableToProcessCount : 0}}</td>
                </tr>
            {% endfor %}
        </table>
        <div>Total Records: {{ totalCount }}</div>
    </div>
    <h3 class="report-header"><strong>Referral - Staff Summary</strong></h3>
    <table class="report-data" width="100%">
        <thead class="header">
        <tr>
            <th>Full Name</th>
            <th>Received</th>
            <th>Encoded</th>
            <th>Duplicate</th>
            <th>Existing</th>
            <th>Unable to Process</th>
        </tr>
        </thead>
        <tbody>
        {% set totalCount1 = 0 %}
        {% for staffSummary in staff %}
            {% set trC = loop.index > 1 and loop.index % 2 == 0 ? 'even' : 'odd' %}
            {% set totalCount1 = totalCount1 + 1 %}
            <tr class="{{ trC }}">
                <td>{{ staffSummary.fullName is defined ? staffSummary.fullName : ''}}</td>
                <td>{{ staffSummary.faxCount is defined ? staffSummary.faxCount : 0}}</td>
                <td>{{ staffSummary.referralCount is defined ? staffSummary.referralCount : 0}}</td>
                <td>{{ staffSummary.faxIsDuplicatedCount is defined ? staffSummary.faxIsDuplicatedCount : 0}}</td>
                <td>{{ staffSummary.faxIsExistingCount is defined ? staffSummary.faxIsExistingCount : 0}}</td>
                <td>{{ staffSummary.faxIsUnableToProcessCount is defined ? staffSummary.faxIsUnableToProcessCount : 0}}</td>
            </tr>
        {% endfor %}
    </table>
    <div>Total Records: {{ totalCount1 }}</div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script>
        //<![CDATA[
        jQ(document).ready(function(){
            report_preview.init();
        });
        //]]>
    </script>
{% endblock %}