<!-- BEGIN {$smarty.template} -->

<div class="dcaption"><em>{t}Summary{/t}</em>
  <a href="#projects">{t}Projects{/t}</a> |
  <a href="#persons">{t}Persons{/t}</a> |
  <a href="#opcat">{t}Task categories{/t}</a> |
  <a href="#customers">{t}Customers{/t}</a>
</div>

{if (count($summary.projects.rows) > 0)}
<div class="floatcontainer">

<table class="stdtable w20 flleft" cellspacing="0">
  <caption><em>{t}Projects{/t}</em><a name="projects"></a></caption>
  <tr>
    <th rowspan="2"> {t}Project{/t} </th>
    <th colspan="3" class="c"> {t}Duration{/t} </th>
    <th colspan="3" class="c"> {t}Manhours costs{/t} </th>
    <th colspan="3" class="c"> {t}Material costs{/t} </th>
    <th colspan="3" class="c"> {t}Total costs{/t} </th>
  </tr>
  <tr>
    <th class="time"> {t}Planned{/t} </th>
    <th class="time"> {t}Tracked{/t} </th>
    <th class="time"> % </th>
    <th class="time"> {t}Planned{/t} </th>
    <th class="time"> {t}Tracked{/t} </th>
    <th class="time"> % </th>
    <th class="time"> {t}Planned{/t} </th>
    <th class="time"> {t}Tracked{/t} </th>
    <th class="time"> % </th>
    <th class="time"> {t}Planned{/t} </th>
    <th class="time"> {t}Tracked{/t} </th>
    <th class="time"> % </th>
  </tr>

  {section name=r loop=$summary.projects.rows}
  <tr class="{cycle values="odd,even"}">
    <td> <a href="project.php?id={$summary.projects.rows[r].prj_id}">{$summary.projects.rows[r].prj_title|wash}</a></td>
    <td class="time"> {if ($summary.projects.rows[r].prj_planned_manhours > 0)}{$summary.projects.rows[r].prj_planned_manhours|phpaga_minutes2duration}{else}&nbsp;{/if} </td>
    <td class="time"> {$summary.projects.rows[r].prj_tracked_manhours|phpaga_minutes2duration|default:"&nbsp;"} </td>
    <td class="rb number{if $summary.projects.rows[r].prj_perc_manhours > 100} warn{/if}"> {$summary.projects.rows[r].prj_perc_manhours|phpaga_formatpercentage|default:"&nbsp;"} </td>

    <td class="time"> {$summary.projects.rows[r].prj_planned_cost_manhours|phpaga_formatamount|default:"&nbsp;"} </td>
    <td class="time"> {$summary.projects.rows[r].prj_tracked_cost_manhours|phpaga_formatamount|default:"&nbsp;"} </td>
    <td class="rb number{if $summary.projects.rows[r].prj_perc_cost_manhours > 100} warn{/if}"> {$summary.projects.rows[r].prj_perc_cost_manhours|phpaga_formatpercentage|default:"&nbsp;"} </td>

    <td class="time"> {$summary.projects.rows[r].prj_planned_cost_material|phpaga_formatamount|default:"&nbsp;"} </td>
    <td class="time"> {$summary.projects.rows[r].prj_tracked_cost_material|phpaga_formatamount|default:"&nbsp;"} </td>
    <td class="rb number{if $summary.projects.rows[r].prj_perc_cost_material > 100} warn{/if}"> {$summary.projects.rows[r].prj_perc_cost_material|phpaga_formatpercentage|default:"&nbsp;"} </td>

    <td class="time sumrow"> {if ($summary.projects.rows[r].planned_cost_total > 0)}{$summary.projects.rows[r].planned_cost_total|phpaga_formatamount}{else}&nbsp;{/if} </td>
    <td class="time sumrow"> {$summary.projects.rows[r].tracked_cost_total|phpaga_formatamount|default:"&nbsp;"} </td>
    <td class="number{if $summary.projects.rows[r].perc_cost_total > 100} warn{/if}"> {$summary.projects.rows[r].perc_cost_total|phpaga_formatpercentage|default:"&nbsp;"} </td>

  </tr>
  {/section}
  <tr class="summary r">
    <td>&nbsp;</td>
    <td> {$summary.projects.planned_duration|phpaga_minutes2duration|default:"&nbsp;"} </td>
    <td> {$summary.projects.tracked_duration|phpaga_minutes2duration|default:"&nbsp;"} </td>
    <td> &nbsp; </td>
    <td> {$summary.projects.planned_cost_manhours|phpaga_formatamount|default:"&nbsp;"} </td>
    <td> {$summary.projects.tracked_cost_manhours|phpaga_formatamount|default:"&nbsp;"} </td>
    <td> &nbsp; </td>
    <td> {$summary.projects.planned_cost_material|phpaga_formatamount|default:"&nbsp;"} </td>
    <td> {$summary.projects.tracked_cost_material|phpaga_formatamount|default:"&nbsp;"} </td>
    <td> &nbsp; </td>
    <td> {$summary.projects.planned_cost_total|phpaga_formatamount|default:"&nbsp;"} </td>
    <td> {$summary.projects.tracked_cost_total|phpaga_formatamount|default:"&nbsp;"} </td>
    <td> &nbsp; </td>
  </tr>

</table>

<object class="flleft" type="image/svg+xml" data="summary_graph.php?type=prj" height="{$smarty.const.PHPAGA_GRAPH_HEIGHT}" width="{$smarty.const.PHPAGA_GRAPH_WIDTH}">
  You need a browser capeable of SVG to display this image.
  You can find the Adobe SVG Viewer here:
  <a href="http://www.adobe.com/svg/viewer/install/main.html">http://www.adobe.com/svg/viewer/install/main.html</a>
</object>
</div>
<div class="spacer"></div>
{/if}

{if (count($summary.persons.rows) > 0)}
<div class="floatcontainer">

<table class="stdtable w20 flleft" cellspacing="0">
  <caption><em>{t}Persons{/t}</em><a name="persons"></a></caption>
  <tr>
    <th> {t}Person{/t} </th>
    <th class="time"> {t}Duration{/t} </th>
  </tr>
  {section name=p loop=$summary.persons.rows}
  <tr class="{cycle values="odd,even"}">
    <td> <a href="person.php?id={$summary.persons.rows[p].pe_id}">{$summary.persons.rows[p].pe_person|wash}</a></td>
    <td class="time"> {$summary.persons.rows[p].sum_duration|phpaga_minutes2duration|default:"&nbsp;"} </td>
  </tr>
  {/section}
  <tr class="summary">
    <td colspan="2" class="time"> {$summary.persons.duration|phpaga_minutes2duration|default:"&nbsp;"} </td>
  </tr>
</table>

<object class="flleft" type="image/svg+xml" data="summary_graph.php?type=pe" height="{$smarty.const.PHPAGA_GRAPH_HEIGHT}" width="{$smarty.const.PHPAGA_GRAPH_WIDTH}">
  You need a browser capeable of SVG to display this image.
  You can find the Adobe SVG Viewer here:
  <a href="http://www.adobe.com/svg/viewer/install/main.html">http://www.adobe.com/svg/viewer/install/main.html</a>
</object>

</div>
<div class="spacer"></div>
{/if}

{if (count($summary.opcats.rows) > 0)}
<div class="floatcontainer">

<table class="stdtable w20 flleft" cellspacing="0">
  <caption><em>{t}Task categories{/t}</em><a name="opcat"></a></caption>
  <tr>
    <th> {t}Task category{/t} </th>
    <th class="time"> {t}Duration{/t} </th>
  </tr>
  {section name=o loop=$summary.opcats.rows}
  <tr class="{cycle values="odd,even"}">
    <td> {$summary.opcats.rows[o].opcat_title|wash}</td>
    <td class="time"> {$summary.opcats.rows[o].sum_duration|phpaga_minutes2duration|default:"&nbsp;"} </td>
  </tr>
  {/section}
  <tr class="summary">
    <td colspan="2" class="time"> {$summary.opcats.duration|phpaga_minutes2duration|default:"&nbsp;"} </td>
  </tr>
</table>

<object class="flleft" type="image/svg+xml" data="opcat_graph.php" height="{$smarty.const.PHPAGA_GRAPH_HEIGHT}" width="{$smarty.const.PHPAGA_GRAPH_WIDTH}">
  You need a browser capeable of SVG to display this image.
  You can find the Adobe SVG Viewer here:
  <a href="http://www.adobe.com/svg/viewer/install/main.html">http://www.adobe.com/svg/viewer/install/main.html</a>
</object>

</div>
<div class="spacer"></div>
{/if}

{if (count($summary.customers) > 0)}
<div class="dcaption"><em>{t}Invoiced per customer and currency{/t}</em><a name="customers"></a>&nbsp;</div>


{foreach from=$summary.customers item=cust}
<div class="floatcontainer">

<table class="stdtable w20 flleft" cellspacing="0">
  <caption><em>{t}Currency{/t}: {$cust.curr_name}</em></caption>
  <tr>
    <th> {t}Customer{/t} </th>
    <th class="number"> {t}Invoiced{/t} </th>
  </tr>
  {section name=cu loop=$cust.rows}
  <tr class="{cycle values="odd,even"}">
    <td> <a href="company.php?id={$cust.rows[cu].cpn_id}">{$cust.rows[cu].cpn_name|wash}</a></td>
    <td class="time"> {$cust.rows[cu].sum_amount|phpaga_formatamount|default:"&nbsp;"} {$cust.rows[cu].curr_name|default:"&nbsp;"} </td>
  </tr>
  {/section}
  <tr class="summary">
    <td colspan="2" class="time">{$cust.amount|phpaga_formatamount|default:"&nbsp;"} {$cust.curr_name}</td>
  </tr>
</table>

<object class="flleft" type="image/svg+xml" data="summary_graph.php?type=cu&amp;curr_id={$cust.curr_id}" height="{$smarty.const.PHPAGA_GRAPH_HEIGHT}" width="{$smarty.const.PHPAGA_GRAPH_WIDTH}">
  You need a browser capeable of SVG to display this image.
  You can find the Adobe SVG Viewer here:
  <a href="http://www.adobe.com/svg/viewer/install/main.html">http://www.adobe.com/svg/viewer/install/main.html</a>
</object>

</div>
<div class="spacer"></div>
{/foreach}

{/if}

<!-- END {$smarty.template} -->
