{% 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>Affiliate</th>
            <th>Referring Affiliate</th>
            <th>Address</th>
            <th>Mobile No.(s)</th>
            <th>Tel No.(s)</th>
            <th>Email</th>
            <th>Sales Agent</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><a href="{{ path('referring_health_facility_detail', {referringHealthFacility_id : record.affiliateId|base64Encode}) }}">{{ record.affiliate }}</a></td>
                <td>{{ record.referring_affiliate }}</td>
                <td>{{ record.address }}</td>
                <td>{{ record.mobile_no ? record.mobile_no : ''  }} {{ record.mobile_no_two ? ' / '~record.mobile_no_two : '' }}</td>
                <td>{{ record.phone_no ? record.phone_no : ''  }} {{ record.phone_no_two ? ' / '~record.phone_no_two : '' }}</td>
                <td>{{ record.email }}</td>
                <td>{{ record.salesAgent }}</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 %}