{% extends '@RxConnexion/Admin/global.html.twig' %}
{% block body %}
    <h3 class="report-header"><strong>{{ page_title }}</strong> From: {{ dateFrom }} To: {{ dateTo }}</h3>
    <h6 style="text-align: center">CBT Productivity Report</h6>
    <h6 style="text-align: center">Scheduling</h6>
    <table class="report-data" width="100%">
        <thead class="header">
        <tr>
            <th>ACTIVITY</th>
            <th>BOOKED</th>
            <th>Total Actual Number</th>
            <th>Target</th>
        </tr>
        </thead>
        <tbody>
        {% set hsatTarget = 0 %}
        {% for record in records %}
            {% set trC = loop.index > 1 and loop.index % 2 == 0 ? 'even' : 'odd' %}
            {% set hsatTarget = (record.totalBookedCount / 240) * 100 %}
            <tr class="{{ trC }}">
                <td>{{ record.chartType }}</td>
                <td>{{ record.totalBookedCount }}</td>
                <td>{{ record.totalCount }}</td>
                {% if record.chartType == 'HSAT' %}
                    <td>{{ hsatTarget|number_format(2, '.', ',')~'%' }}</td>
                {% endif %}
            </tr>
        {% endfor %}
    </table>

    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script>
        //<![CDATA[
        jQ(document).ready(function(){
            report_preview.init();
        });
        //]]>
    </script>
{% endblock %}