<?php
include_once("c_esmo_setting_mo.php");
class c_page_cab_esmo_setting_groups extends c_page_cab_esmo_setting_mo
{
  public $h1='Группы' ;

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

   ?><form class="basic" id="personal_groups_form"><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_create validate=form>
           <button class="v2" cmd="esmo_setting/group_delete">Удалить выбранные группы</button>
     <?
       $list_recs=PERSONAL()->get_list_groups() ;
       $this->list_groups($list_recs,array()) ;
   ?></form><?

     //damp_array(_IL('IL_groups')->recs) ;
 }

 function list_groups(&$list_recs,$options=array())
  { $id=($options['id'])? 'id='.$options['id']:'' ;
     //damp_array($list_recs)  ;
    $items_filter_sets=PERSONALS_FILTER()->get_personals_filter_all() ;
    include_once(_DIR_EXT.'/personal/panel_personal_info.php') ;

    ?><table class="basic fz_small auto" <?echo $id?> id="exist_personal_groups_table">
        <colgroup><col id="c1"><col id="c2"><col id="c3"><col id="c4"></colgroup>
        <tr><th>ID</th><th>Выбор</th><th>Название группы</th><th>Параметры отбора</th><th>Отобрано</th><th class="space"></th></tr><? ;
        if (_sizeof($list_recs)) foreach($list_recs as $rec) if (!$rec['hidden'])
        {   ?><tr class=item>
                <td><?echo $rec['id']?></td>
                <td><input type="checkbox" name="_check[]" value="<?echo $rec['id']?>"></td>
                <td class="left"><?echo $rec['obj_name']?></td>
                <td class="left"><? panel_personals_filter_info($items_filter_sets[$rec['_reffer']]) ; ?></td>
                <td class="center"><?echo execSQL_value('select count(pkey) from view_personals_group_'.$rec['id'])?></td>
                <td class="space"><a href="/cab/esmo_setting/group_of_personal/<?echo $rec['id']?>/" class=new_window target=_blank title="group_of_disease">Карточка группы</a></td>
            </tr><?
        }
      ?></table>
      <style type="text/css">
     		 ul.usl_select_personals_to_group p{text-align:left;display:inline;}
     		 ul.usl_select_personals_to_group li{text-align:left;}
     	 </style>

      <?

  }



}



?>
