<?php
include_once("c_esmo_setting_mo.php");
class c_page_cab_esmo_setting_groups_of_disease extends c_page_cab_esmo_setting_mo
{
  public $h1='Группы по болезни' ;

 function block_main()
 { $this->page_title() ;

   ?><form class="basic"><input type="text" class="big" name="new_org_name" data-required placeholder="Новая группа" >&nbsp;
           <input type="submit" class="v2 fa fa-plus" value="Создать" cmd=esmo_setting/group_medic_create validate=form>
           <button class="v2" cmd="esmo_setting/group_medic_delete">Удалить выбранные группы</button>
     <?
       //$list_org=PERSONAL()->get_list_groups() ;
       $this->list_groups() ;
   ?></form><?
 }

 function list_groups()
  { ?><table class="basic fz_small auto" id="list_groups">
        <tr><th>Выбор</th><th>Название группы</th><th>Сотрудников</th><th>Давление<br>систолическое<br>мин/макс</th><th>Давление<br>диастолическое<br>мин/макс</th><th>Пульс<br>мин/макс</th><th>Запрет прохождения МО</th><th>Использовать для ПМО</th><th class="space">Операция</th></tr><? ;
        if (_sizeof(_IL('IL_group_medic')->recs)) foreach(_IL('IL_group_medic')->recs as $rec)
        {  //$arr=get_arr_links_to_reffer($rec['_reffer']) ;
            $cnt_work=0 ; $cnt_pers=0 ;
           //if (_sizeof($arr)) foreach($arr as $rec_link) if ($rec_link['link_clss']==211) $cnt_pers++ ;
           if ($rec['id']) $cnt_pers=execSQL_value('select count(pkey) from view_personals_medic_group_'.$rec['id'].' where enabled=1 and clss=211') ;
           //damp_array($arr,1,-1) ;
            ?><tr class=item>
                <td><input type="checkbox" name="_check[]" value="<?echo $rec['id']?>"></td>
                <td class="left"><?echo $rec['obj_name']?></td>
                <td><? echo ($cnt_pers)? $cnt_pers:'-'?></td>
                <td><?if ($rec['s']) echo $rec['s_min'].' - '.$rec['s_max']?></td>
                <td><?if ($rec['d']) echo $rec['d_min'].' - '.$rec['d_max']?></td>
                <td><?if ($rec['p']) echo $rec['p_min'].' - '.$rec['p_max']?></td>
                <td><?echo ($rec['_ext_info']['mo_denited'])? 'Да':''?></td>
                <td><?echo ($rec['_ext_info']['use_PMO'])? 'Да':''?></td>
                <td class="space"><a href="/cab/esmo_setting/group_of_disease/<?echo $rec['id']?>/" class=new_window target=_blank title="group_of_disease">Карточка группы</a></td>
            </tr><?
        }
      ?></table><?
  }

}



?>
