<pd4ml:page.break ifSpaceBelowLessThan=800>
<table style="border-color: {$border_color_table}; margin-bottom: 10px;">
    <colgroup>
        <col style="width: 30mm;" />
        <col style="width: 68mm;" />
        <col style="width: 30mm;" />
        <col style="width: 68mm;" />
    </colgroup>
    <thead>
        <tr>
            <th style="text-align: left; background-color: {$background_color_heading}">
                {$i.reporting_rep_id}: <kbd>{$row.id}</kbd>
            </th>            
            <th style="text-align: left; background-color: {$background_color_heading}">
                {$row.staff_name}
            </th>
            <th colspan="2" style="text-align: center; background-color: {$background_color_heading}">
                {$i.reporting_rep_username}: <kbd>{$row.username}</kbd>
            </th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>{$i.reporting_rep_gender}</td>
            <td>{$row.gender}</td>
            <td colspan="2">{*
                *}{if $row.photo_file_uri neq ''}{*
                    *}<img src="{img_url uri=$row.photo_file_uri}" style="height: 70px; max-width: 100px;" />{*
                *}{/if}{*
            *}</td>
        </tr>
        <tr>
            <td>{$i.reporting_rep_street}</td>
            <td>{$row.street}</td>
            <td>{$i.reporting_rep_phone1}</td>
            <td>{$row.phone_1}</td>
        </tr>
        <tr>
            <td>{$i.reporting_rep_town}</td>
            <td>{$row.town}</td>
            <td>{$i.reporting_rep_phone2}</td>
            <td>{$row.phone_2}</td>
        </tr>
        <tr>
            <td>{$i.reporting_rep_zip}</td>
            <td>{$row.zip_code}</td>
            <td>{$i.reporting_rep_fax}</td>
            <td>{$row.fax}</td>
        </tr>
        <tr>
            <td>{$i.reporting_rep_insurance_no}</td>
            <td>{$row.insurance_no}</td>
            <td>{$i.reporting_rep_email}</td>
            <td>{$row.email}</td>
        </tr>
        <tr>
            <td>{$i.reporting_rep_birthday}</td>
            <td>{$row.birthday.usdate}</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td>{$i.reporting_staff_start_date}</td>
            <td>{$row.start_date.usdate}</td>
            <td>{$i.reporting_staff_end_date}</td>
            <td>{$row.end_date.usdate}</td>
        </tr>
        <tr>
            <td>{$i.reporting_staff_hourly_wage}</td>
            <td>{$row.gross_hourly_wage.usnumber}</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td>{$i.reporting_rep_x_comment}</td>
            <td colspan="3">{$row.remark}</td>
        </tr>
        
        <tr>
            <td>{$i.reporting_staff_bank_code}</td>
            <td>{$row.bank_code}</td>
            <td>{$i.reporting_staff_bank_name}</td>
            <td>{$row.bank_name}</td>
        </tr>
        <tr>
            <td>{$i.reporting_staff_account_no}</td>
            <td>{$row.account_no}</td>
            <td colspan="2"></td>
        </tr>

        <tr>
            <td>{$i.reporting_staff_abbreviation}</td>
            <td>{$row.abbreviation}</td>
            <td>{$i.reporting_staff_direct_dial}</td>
            <td>{$row.direct_dial}</td>
        </tr>
        <tr>
            <td>{$i.reporting_staff_annex}</td>
            <td colspan="3">{$row.annex}</td>
        </tr>
        <tr>
            <td>{$i.reporting_holiday_rate_name}</td>
            <td>{$row.holiday_rate_name}</td>
            <td>{$i.reporting_cost_centre_name}</td>
            <td>{$row.cost_centre_name}</td>
        </tr>
        <tr>
            <td>{$i.reporting_project_manager_name}</td>
            <td>{$row.project_manager_name}</td>
            <td colspan="2"></td>
        </tr>
    </tbody>
</table>

{if (count($row_addi) > 0)}
    <table cellpadding="2" border="1" style="border-color: {$border_color_table}; margin-bottom: 20px;">
        <colgroup>
            <col style="width: 50mm;" />
            <col style="width: 129mm;" />
        </colgroup>
        <thead>
            <tr>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_rep_addi_key}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_rep_addi_value}
                </th>
            </tr>
        </thead>
        <tbody>
            {foreach item=field from=$row_addi}
                <tr>
                    <td>{*
                        *}{$field.title}{*
                    *}</td>
                    <td>{*
                        *}{reportview field=$field}{*
                    *}</td>
                </tr>
            {/foreach}
        </tbody>
    </table>
{/if}


<!-- ---------------------------------------------------------------------------------------------------------- -->
<!-- - Normal working hours ----------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------------------------------- -->
{if (count($row.target_hours) > 0)}
    <table style="border-color: {$border_color_table}; margin-bottom: 10px;">
        <colgroup>
            <col style="width: 30mm;" />
            <col style="width: 30mm;" />
            <col style="width: 14mm;" />
            <col style="width: 14mm;" />
            <col style="width: 14mm;" />
            <col style="width: 14mm;" />
            <col style="width: 14mm;" />
            <col style="width: 14mm;" />
            <col style="width: 14mm;" />
            <col style="width: 21mm;" />
        </colgroup>
        <thead>
            <tr>
                <th colspan="10" style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_target_hours}
                </th>
            </tr>
            <tr>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_rep_time_from}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_rep_time_to}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_norm_work_mon}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_norm_work_tue}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_norm_work_wed}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_norm_work_thu}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_norm_work_fri}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_norm_work_sat}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_norm_work_sun}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_norm_work_sum}
                </th>
            </tr>
        </thead>
        <tbody>
            {foreach item=field from=$row.target_hours}
                <tr>
                    <td>{*
                        *}{$field.from_date.usdate}{*
                    *}</td>
                    <td>{*
                        *}{$field.to_date.usdate}{*
                    *}</td>
                    <td>{*
                        *}{$field.norm_work_mon.usnumber}{*
                    *}</td>
                    <td>{*
                        *}{$field.norm_work_tue.usnumber}{*
                    *}</td>
                    <td>{*
                        *}{$field.norm_work_wed.usnumber}{*
                    *}</td>
                    <td>{*
                        *}{$field.norm_work_thu.usnumber}{*
                    *}</td>
                    <td>{*
                        *}{$field.norm_work_fri.usnumber}{*
                    *}</td>
                    <td>{*
                        *}{$field.norm_work_sat.usnumber}{*
                    *}</td>
                    <td>{*
                        *}{$field.norm_work_sun.usnumber}{*
                    *}</td>
                    <td>{*
                        *}{$field.norm_work_sum.usnumber}{*
                    *}</td>
                </tr>
            {/foreach}
        </tbody>
    </table>
{/if}


<!-- ---------------------------------------------------------------------------------------------------------- -->
<!-- - Occupation groups -------------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------------------------------- -->
{if (count($row.occupation_grps) > 0)}
    <table style="border-color: {$border_color_table}; margin-bottom: 10px;">
        <colgroup>
            <col style="width: 30mm;" />
            <col style="width: 30mm;" />
            <col style="width: 50mm;" />
            <col style="width: 69mm;" />
        </colgroup>
        <thead>
            <tr>
                <th colspan="4" style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_occupation_grps}
                </th>
            </tr>
            <tr>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_rep_time_from}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_rep_time_to}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_occupation_grps}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_rep_description}
                </th>
            </tr>
        </thead>
        <tbody>
            {foreach item=field from=$row.occupation_grps}
                <tr>
                    <td>{*
                        *}{$field.from_date.usdate}{*
                    *}</td>
                    <td>{*
                        *}{$field.to_date.usdate}{*
                    *}</td>
                    <td>{*
                        *}{$field.group_name}{*
                    *}</td>
                    <td>{*
                        *}{$field.group_description}{*
                    *}</td>
                </tr>
            {/foreach}
        </tbody>
    </table>
{/if}

<!-- ---------------------------------------------------------------------------------------------------------- -->
<!-- - Skill groups -------------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------------------------------- -->
{if (count($row.skill_grps) > 0)}
    <table style="border-color: {$border_color_table}; margin-bottom: 10px;">
        <colgroup>
            <col style="width: 30mm;" />
            <col style="width: 30mm;" />
            <col style="width: 50mm;" />
            <col style="width: 69mm;" />
        </colgroup>
        <thead>
            <tr>
                <th colspan="4" style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_skill_grps}
                </th>
            </tr>
            <tr>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_rep_time_from}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_rep_time_to}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_skill_grps}
                </th>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_rep_description}
                </th>
            </tr>
        </thead>
        <tbody>
            {foreach item=field from=$row.skill_grps}
                <tr>
                    <td>{*
                        *}{$field.from_date.usdate}{*
                    *}</td>
                    <td>{*
                        *}{$field.to_date.usdate}{*
                    *}</td>
                    <td>{*
                        *}{$field.skill_name}{*
                    *}</td>
                    <td>{*
                        *}{$field.description}{*
                    *}</td>
                </tr>
            {/foreach}
        </tbody>
    </table>
{/if}

<!-- ---------------------------------------------------------------------------------------------------------- -->
<!-- - staff_gross_hourly_wage ------------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------------------------------- -->
<table style="border-color: {$border_color_table}; margin-bottom: 10px;">
    <colgroup>
        <col style="width: 30mm;" />
        <col style="width: 30mm;" />
        <col style="width: 50mm;" />
        <col style="width: 69mm;" />
    </colgroup>
    <thead>
        <tr>
            <th colspan="4" style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_gross_hourly_wage}
            </th>
        </tr>
        <tr>
            <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_rep_time_from}
            </th>
            <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_rep_time_to}
            </th>
            <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_gross_hourly_wage}
            </th>
            <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_rep_description}
            </th>
        </tr>
    </thead>
    <tbody>
        {foreach item=field from=$row.gross_hourly_wages_list}
            <tr>
                <td>{*
                    *}{$field.from_date.usdate}{*
                *}</td>
                <td>{*
                    *}{$field.to_date.usdate}{*
                *}</td>
                <td>{*
                    *}{$field.gross_hourly_wage}{*
                *}</td>
                <td>{*
                    *}{$field.description}{*
                *}</td>
            </tr>
        {/foreach}
    </tbody>
</table>

<!-- ---------------------------------------------------------------------------------------------------------- -->
<!-- - Gross hourly wages ------------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------------------------------- -->
<table cellpadding="2" border="1" style="border-color: {$border_color_table}; margin-bottom: 10px;">
    <colgroup>
        <col style="width: 50mm;" />
        <col style="width: 129mm;" />
    </colgroup>
    <thead>
        <tr>
            <th colspan="2" style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_gross_hourly_wages}
            </th>
        </tr>
        <tr>
            <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_rep_time_from}
            </th>
            <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_gross_hourly_wage}
            </th>
        </tr>
    </thead>
    <tbody>
        {foreach item=field from=$row.gross_hourly_wages}
            <tr>
                <td>{*
                    *}{$field.date.usdate}{*
                *}</td>
                <td>{*
                    *}{$field.gross_hourly_wage.usnumber}{*
                *}</td>
            </tr>
        {/foreach}
    </tbody>
</table>
    
<!-- ---------------------------------------------------------------------------------------------------------- -->
<!-- - staff_cost_centre_name ------------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------------------------------- -->
<table style="border-color: {$border_color_table}; margin-bottom: 10px;">
    <colgroup>
        <col style="width: 30mm;" />
        <col style="width: 30mm;" />
        <col style="width: 50mm;" />
        <col style="width: 69mm;" />
    </colgroup>
    <thead>
        <tr>
            <th colspan="4" style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_cost_centre_name}
            </th>
        </tr>
        <tr>
            <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_rep_time_from}
            </th>
            <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_rep_time_to}
            </th>
            <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_cost_centre_name}
            </th>
            <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                {$i.reporting_rep_description}
            </th>
        </tr>
    </thead>
    <tbody>
        {foreach item=field from=$row.cost_centres}
            <tr>
                <td>{*
                    *}{$field.from_date.usdate}{*
                *}</td>
                <td>{*
                    *}{$field.to_date.usdate}{*
                *}</td>
                <td>{*
                    *}{$field.cost_centre_name}{*
                *}</td>
                <td>{*
                    *}{$field.description}{*
                *}</td>
            </tr>
        {/foreach}
    </tbody>
</table>
    
<!-- ---------------------------------------------------------------------------------------------------------- -->
<!-- - Staff assigned to projects ----------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------------------------------- -->
{if (count($row.staff_project_grps) > 0)}
    <table style="border-color: {$border_color_table}; margin-bottom: 10px;">
        <colgroup>
            <col style="width: 179mm;" />
        </colgroup>
        <thead>
            <tr>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_staff_project_grps}
                </th>
            </tr>
        </thead>
        <tbody>
            {foreach item=field from=$row.staff_project_grps}
                <tr>
                    <td>{*
                        *}{$field.name}{*
                    *}</td>
                </tr>
            {/foreach}
        </tbody>
    </table>
{/if}
{if (count($row.staff_projects) > 0)}
    <table style="border-color: {$border_color_table}; margin-bottom: 40px;">
        <colgroup>
            <col style="width: 179mm;" />
        </colgroup>
        <thead>
            <tr>
                <th style="text-align: left; background-color: {$background_color_subheading}; font-weight:{$font_weight_subheading};">
                    {$i.reporting_staff_projects}
                </th>
            </tr>
        </thead>
        <tbody>
            {foreach item=field from=$row.staff_projects}
                <tr>
                    <td>{*
                        *}{$field.project}{*
                    *}</td>
                </tr>
            {/foreach}
        </tbody>
    </table>
{/if}
