<div style="max-height:{$widget_data.height}px; pd4ml-display: inline; overflow:auto;">
    <table class="dashed">
        <thead>
            <tr>
                <th class="floatval">{$i.basic_staff}</th>
                <th class="floatval">{$i.reporting_hours} {$i.reporting_rep_x_total}</th>
                <th class="floatval">{$i.reporting_hours} {$i.reporting_not_productive}</th>
                <th class="floatval">{$i.reporting_social_caused}</th>
                <th class="floatval">{$i.reporting_company_caused}</th>
                <th class="floatval">{$i.reporting_hours} {$i.reporting_productive}</th>
                <th class="floatval" title="{$i.reporting_factor_prod_noprod1}">{$i.reporting_factor_prod_noprod}<span class="hoverhelp"></span></th>
                <th class="floatval" title="{$i.reporting_factor_prod_total1}">{$i.reporting_factor_prod_total}<span class="hoverhelp"></span></th>
            </tr>
        </thead>
        <tbody>
        {$totals = array()}
        {$totals.hours = 0}
        {$totals.social_hours = 0}
        {$totals.total_hours = 0}
        {foreach item="prod" from=$productivities}
            {if isset($prod->total_hours) && $prod->total_hours<>0}
                <tr>
                    <td title="{$i.basic_staff}">{$prod->staff_name}</td>
                    {$totals.total_hours = $totals.total_hours+$prod->total_hours}
                    {$totals.hours = $totals.hours+$prod->hours}
                    {$totals.social_hours = $totals.social_hours+$prod->social_hours}
                    <td title="{$i.reporting_hours} {$i.reporting_rep_x_total}" class="floatval">{float_to_usnumber($prod->total_hours,2)}</td>
                    <td title="{$i.reporting_hours} {$i.reporting_not_productive}" class="floatval">{float_to_usnumber($prod->total_hours-$prod->hours,2)}</td>
                    <td title="{$i.reporting_social_caused}" class="floatval">{float_to_usnumber($prod->social_hours,2)}</td>
                    <td title="{$i.reporting_company_caused}" class="floatval">{float_to_usnumber($prod->total_hours-$prod->hours-$prod->social_hours,2)}</td>
                    <td title="{$i.reporting_hours} {$i.reporting_productive}" class="floatval">{float_to_usnumber($prod->hours,2)}</td>
                    <td title="{$i.reporting_factor_prod_noprod}" class="floatval">{if $prod->hours<>0}{float_to_usnumber(($prod->total_hours-$prod->hours)/$prod->hours*100,2)}&nbsp;%{else}-{/if}</td>
                    <td title="{$i.reporting_factor_prod_total}" class="floatval">{if $prod->total_hours<>0}{float_to_usnumber($prod->hours/$prod->total_hours*100,2)}&nbsp;%{else}-{/if}</td>
                </tr>
            {/if}
        {/foreach}
        <tr>
            <th>{$i.basic_total}</th>
            <th title="{$i.reporting_hours} {$i.reporting_rep_x_totalall}" class="floatval" style="text-align:right;">{float_to_usnumber($totals.total_hours,2)}</th>
            <th title="{$i.reporting_hours} {$i.reporting_not_productive}" class="floatval" style="text-align:right;">{float_to_usnumber($totals.total_hours-$totals.hours,2)}</th>
            <th title="{$i.reporting_social_caused}" class="floatval" style="text-align:right;">{float_to_usnumber($totals.social_hours,2)}</th>
            <th title="{$i.reporting_company_caused}" class="floatval" style="text-align:right;">{float_to_usnumber($totals.total_hours-$totals.hours-$totals.social_hours,2)}</th>
            <th title="{$i.reporting_hours} {$i.reporting_productive}" class="floatval" style="text-align:right;">{float_to_usnumber($totals.hours,2)}</th>
            <th title="{$i.reporting_factor_prod_noprod}" class="floatval" style="text-align:right;">{if $totals.hours<>0}{float_to_usnumber(($totals.total_hours-$totals.hours)/$totals.hours*100,2)}&nbsp;%{else}-{/if}</th>
            <th title="{$i.reporting_factor_prod_total}" class="floatval" style="text-align:right;">{if $totals.total_hours<>0}{float_to_usnumber($totals.hours/$totals.total_hours*100,2)}&nbsp;%{else}-{/if}</th>
        </tr>
        {if $date_from != ''}
            <tr>
                <td colspan=8>{$i.reporting_time_period}: {$date_from} - {$date_to}</td>
            </tr>  
        {/if}
            {if $widget_data.active_staff}
            <tr>
                <td colspan=8>{$i.reporting_only_active_staff}</td>
            </tr>  
        {/if}
        </tbody>
    </table>
</div>
