{* Smarty *}

{literal}
<script type="text/javascript">
//<![CDATA[
$(function() {
  tableToGrid("#DemandsMasterByStatusView", {
    caption:'Заявки по статусам и сис. инженерам',
    colModel: [
      {name: "sprstatus_color", width:10, align:"center", sortable: false},
      {name: "sprstatus_name", width:110, align:"left", sortable: false},
      {name: "users_fio", width:215, align:"left", sortable: false},
      {name: "sprstatus_count", width:70, align:"right", sortable: false}
    ],
    width:"auto",
    height:"auto"
  });
});
//  $(function() {
//    $('.DemandsMasterByStatusView').flexigrid({title: "Заявки по статусам и сис. инженерам", width: 320, height:'auto', nowrap:false});
//  });
//]]>
</script>
{/literal}

{foreach $ArrDemandsMasterByStatus as $val}
  {if $val@first}
    {$VarTotal=0}
<table id="DemandsMasterByStatusView">
  <thead>
    <tr>
      <th id="sprstatus_color"></th>
      <th id="sprstatus_name">Статус</th>
      <th id="users_fio">Сис.инженер</th>
      <th id="sprstatus_count">Количество</th>
    </tr>
  </thead>
  <tbody>
  {/if}
    <tr>
      <td><div style="background-color: {$val.sprstatus_color};">&nbsp;</div></td>
      <td><a title="Смотреть по статусу" class="ui-state-default" href="/{$MS_SP->Sp_PathTop}/OpDemands.php?sprstatus_id={$val.sprstatus_id}">{$val.sprstatus_name}</a></td>
      <td><a title="Смотреть по сист. инженеру" class="ui-state-default" href="/{$MS_SP->Sp_PathTop}/OpDemands.php?demands_masterid={$val.users_id}">{$val.users_fio}</a></td>
      <td><a title="Смотреть по статусу и сист. инженеру" class="ui-state-default" href="/{$MS_SP->Sp_PathTop}/OpDemands.php?demands_masterid={$val.users_id}&amp;sprstatus_id={$val.sprstatus_id}">{$val.cnt}</a></td>
    </tr>
  {if $val@last}
  </tbody>
</table>
  {/if}
{/foreach}