{* Smarty *}

{literal}
<script type="text/javascript">
//<![CDATA[
$(function() {
  tableToGrid("#SvtGiveoutByStatusView", {
    caption:'Выдача СВТ по статусам',
    colModel: [
      {name: "svtgiveoutstatus_color", width:10, align:"center", sortable: false},
      {name: "svtgiveoutstatus_name", width:100, align:"left", sortable: false},
      {name: "svtgiveoutstatus_count", width:100, align:"right", sortable: false}
    ],
    width:220,
    height:"auto"
  });
});
//]]>
</script>
{/literal}

{foreach $ArrSvtGiveout as $val}
  {if $val@first}
    {$VarTotal=0}
<table id="SvtGiveoutByStatusView">
  <thead>
    <tr>
      <th id="svtgiveoutstatus_color"></th>
      <th id="svtgiveoutstatus_name">Статус</th>
      <th id="svtgiveoutstatus_count">Количество</th>
    </tr>
  </thead>
  <tbody>
  {/if}
    <tr>
      <td><div style="background-color: {$val.svtgiveoutstatus_color};">&nbsp;</div></td>
      <td><a target="_self" class="ui-state-default" href="/{$MS_SP->Sp_PathTop}/SvtGiveout.php?svtgiveoutstatus_id={$val.svtgiveoutstatus_id}">{$val.svtgiveoutstatus_name}</a></td>
      <td>{$val.cnt}{$VarTotal=$VarTotal+$val.cnt}</td>
    </tr>
  {if $val@last}
    <tr>
      <td></td>
      <td></td>
      <td><div style="font-weight: bold;">Всего: {$VarTotal}</div></td>
    </tr>
  </tbody>
</table>
  {/if}
{/foreach}