{* Smarty *}

{literal}
<script type="text/javascript">
//<![CDATA[
$(function() {
  tableToGrid("#RepairByStatusView", {
    caption:'Ремонты по статусам',
    colModel: [
      {name: "repairstatus_color", width:10, align:"center", sortable: false},
      {name: "repairstatus_name", width:100, align:"left", sortable: false},
      {name: "repairstatus_count", width:100, align:"right", sortable: false}
    ],
    width:220,
    height:"auto"
  });
});
//]]>
</script>
{/literal}

{foreach $ArrRepair as $val}
  {if $val@first}
    {$VarTotal=0}
<table id="RepairByStatusView">
  <thead>
    <tr>
      <th id="repairstatus_color"></th>
      <th id="repairstatus_name">Статус</th>
      <th id="repairstatus_count">Количество</th>
    </tr>
  </thead>
  <tbody>
  {/if}
    <tr>
      <td><div style="background-color: {$val.repairstatus_color};">&nbsp;</div></td>
      <td><a target="_self" class="ui-state-default" href="/{$MS_SP->Sp_PathTop}/OpRepairs.php?repairstatus_id={$val.repairstatus_id}">{$val.repairstatus_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}