{% set absUrl = app.request.getSchemeAndHttpHost() ~ app.request.baseUrl|replace({'/app_dev.php': ''}) %}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="{{ absUrl ~ asset('bundles/rxconnexion/admin/css/report/report_wkpdf.css') }}" />
</head>
<body>
<h3 class="report-header"><strong>{{ page_title }}</strong> From: {{ date_from }} To: {{ date_to }}</h3>
<table class="report-data" width="100%">
    <thead class="header">
    <tr>
        <th>Encounter ID</th>
        <th>Staff</th>
        <th>Encounter Date</th>
        <th>Patient</th>
        <th>Company</th>
        <th>Branch</th>
        <th>Clinician</th>
        <th>Encounter Type</th>
        <th>Status</th>
        <th>Note</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 }}">
        <tr>
            <td>{{ record.encounterId }}</td>
            <td>{{ record.accountUser }}</td>
            <td>{{ record.encounterDate }}</td>
            <td>{{ record.patient }}</td>
            <td>{{ record.companyDesc }}</td>
            <td>{{ record.branch }}</td>
            <td>{{ record.clinician }}</td>
            <td>{{ record.encounterType }}</td>
            <td>{{ record.encounterStatus }}</td>
            <td>{{ record.note|raw }}</td>
        </tr>
    {% endfor %}
</table>
<div>Total Records: {{ totalCount }}</div>
<br>
<h3>Summary</h3>
<div style="border: 1px solid; padding: 20px; margin: 10px;">
    <ul>
        {% for key,et in summary.encounterTypes %}
            <li>
                {{ key }}
                <ul>
                    {% for key2,es in et %}
                        <li>
                            {{ key2 }}: {{ es }}
                        </li>
                    {% endfor %}
                </ul>
            </li>
        {% endfor %}
    </ul>
</div>
</body>
</html>