<div class="ui-report-header ui-widget-header ui-corner-all noprint" style="pd4ml-display:none; margin-bottom:5mm;">
    <a class="dialog_make_text_btn ui-corner-all" style="pd4ml-display:none;"
       onclick="evaluation.open_file(this, 'pdf', '{site_url url="reportportlet/`$reports_xjxcookie`/s_overview/result_pdf4/`$s_overview_file_id`"}', 'XNOX')">
        <span class="dialog_make_btn16 pdf"></span>
        PDF A4
    </a>
    <a class="dialog_make_text_btn ui-corner-all" style="pd4ml-display:none;"
       onclick="evaluation.open_file(this, 'pdf', '{site_url url="reportportlet/`$reports_xjxcookie`/s_overview/result_pdf3/`$s_overview_file_id`"}', 'XNOX')">
        <span class="dialog_make_btn16 pdf"></span>
        PDF A3
    </a>
    
    {portlet file='report_designs_list'}
    
    {if $filter_project_manager}<span style="margin-left:40px; display:inline-block;" class="warningsmall ui-corner-all">{$i.reporting_only_project_manager}</span>{/if}
    {if $filter_division_manager}<span style="margin-left:40px; display:inline-block;" class="warningsmall ui-corner-all">{$i.reporting_only_division_manager}</span>{/if}
</div>

<table class="editablepop" style="margin-bottom:5mm; display:none; pd4ml-display:block; ">
    <tbody>
        {if isset($request_vars->date)}
        <tr>
            <td style="vertical-align:top; width:350px; background: none;"><h3 style="line-height:20px;">{$i.reporting_time_period}: {$request_vars->date->us_date()}</h3></td>
            <td style="vertical-align:bottom; width:500px; background: none;"><textarea style="display:none; pd4ml-display:block; width:500px; height:28px; font-size:20px; border:0 none; margin:0; padding:0;" rows="1" cols="50"></textarea></td>
        </tr>
        {/if}
        {if isset($request_vars->staff__staff)}
        <tr>
            <td style="vertical-align:top; width:350px; background: none;"><h3 style="line-height:20px;">{$i.filter_staff}: {$staff_info->staff_name}</h3></td>
            <td style="vertical-align:bottom; width:500px; background: none;"><textarea style="display:none; pd4ml-display:block; width:500px; height:28px; font-size:20px; border:0 none; margin:0; padding:0;" rows="1" cols="50"></textarea></td>
        </tr>
        {/if}
        {if isset($request_vars->staff__staff_group)}
        <tr>
            <td style="vertical-align:top; width:350px; background: none;"><h3 style="line-height:20px;">{$i.filter_staff_group}: {$staff_group_info->name}</h3></td>
            <td style="vertical-align:bottom; width:500px; background: none;"><textarea style="display:none; pd4ml-display:block; width:500px; height:28px; font-size:20px; border:0 none; margin:0; padding:0;" rows="1" cols="50"></textarea></td>
        </tr>
        {/if}
        {if !isset($request_vars->staff__staff) && isset($request_vars->active_only) && $request_vars->active_only === TRUE}
        <tr>
            <td style="vertical-align:top; width:350px; background: none;"><h3 style="line-height:20px;">{$i.filter_active_only}</h3></td>
            <td style="vertical-align:bottom; width:500px; background: none;"><textarea style="display:none; pd4ml-display:block; width:500px; height:28px; font-size:20px; border:0 none; margin:0; padding:0;" rows="1" cols="50"></textarea></td>
        </tr>            
        {/if}
    </tbody>
</table>
<!-- ------------------------------------- Hauptliste ------------------------------------- -->
<table class="editablepop" style="margin-top: 2mm;">
    <thead>
        <tr>
            <th>&nbsp;</th>
            <th colspan="{4+count($overtime_rates)}">{$i.basic_to} {$request_vars->date->us_date()}</th>
            <th colspan="{count($overtime_project_list)}">1.1.{$request_vars->date->format('Y')} {$i.filter_fromto} {$request_vars->date->us_date()}</th>
        </tr>
        <tr>
            <th>{$i.filter_name}</th>
            <th class="rotc"><span>{$i.portlet_target_hours}</span></th>
            <th class="rotc"><span>{$i.holidayadmin_last_balance_update}</span></th>
            <th class="rotc"><span>{$i.reporting_deadline}</span></th>
            <th class="rotc"><span>{$i.holidayadmin_remaining_vacation}</span></th>
            {foreach item=overtime_rate from=$overtime_rates}
                {$ovt_id = $overtime_rate->id}
                <th class="rotc"><span>{$overtime_rate->name}</span></th>
            {/foreach}
            {foreach item=overtime_project from=$overtime_project_list}
                <th class="rotc"><span>{$overtime_project->project_name}</span></th>
            {/foreach}
        </tr>
    </thead>
    <tbody>
        {foreach item=row from=$data}
            <tr>
                <th style="text-align:left;">{$row.staff_name}</th>
                <td style="text-align:right;">{if $row.taw !== FALSE && $row.taw !== '0'}{isfloat value=$row.taw}{/if}</td>
                <td style="text-align:right;">{if $row.entitlement !== FALSE && $row.entitlement !== '0'}{isfloat value=$row.entitlement}{/if}</td>
                <td style="text-align:right;">{if $row.deadline !== FALSE}{$row.deadline->format('d.m')}{/if}</td>
                <td style="text-align:right;">{if $row.balance !== FALSE && $row.balance !== '0'}{isfloat value=$row.balance}{/if}</td>
                {$ii = 0}
                {foreach item=overtime_rate from=$overtime_rates}
                    {if isset($row.overtime.$ii->ors_id) && $row.overtime.$ii->ors_id === $overtime_rate->id}
                        {$ovt = $row.overtime.$ii->number + $row.overtime.$ii->number_paid}
                        {$ovt_id = $overtime_rate->id}
                        <td style="text-align:right;">{if $ovt !== 0}{isfloat value=$ovt}{else}&nbsp;{/if}</td>
                    {else}
                        <td>&nbsp;</td>
                    {/if}
                    {$ii = $ii+1}
                {/foreach}
                {foreach item=overtime_project from=$overtime_project_list}
                    {$pro_id = $overtime_project->id}
                    {if $row.project_times.$pro_id !== null && $row.project_times.$pro_id !== 0}
                        {$project_time = $row.project_times.$pro_id}
                        <td style="text-align:right;">{isfloat value=$project_time}</td>
                    {else}    
                         <td>&nbsp;</td>
                    {/if}    
                {/foreach}
            </tr>
        {/foreach}   
<!-- ------------------------------------- Sumrow ------------------------------------- -->
        <tr>
            <th>{$i.reporting_rep_x_total}</th>
            <th>{if $sums.taw !== 0}{isfloat value=$sums.taw}{else}&nbsp;{/if}</th>
            <th>{if $sums.entitlement !== 0}{isfloat value=$sums.entitlement}{else}&nbsp;{/if}</th>
            <th>&nbsp;</th>
            <th>{if $sums.balance !== 0}{isfloat value=$sums.balance}{else}&nbsp;{/if}</th>
            {foreach item=val from=$sums.overtime}
                <th>{if $val !== 0}{isfloat value=$val}{else}&nbsp;{/if}</th>
            {/foreach}
            {foreach item=val from=$sums.project_times}
                <th>{if $val !== 0}{isfloat value=$val}{else}&nbsp;{/if}</th>
            {/foreach}            
        </tr>    
    </tbody>
</table>
