<?php
include_once("c_AD_setting.php");
class c_page_cab_AD_setting_rol extends c_page_cab_AD_setting
{
  public $h1='Роли персонала - ActiveDirectory' ;

 function block_main()
 { global $member ;

   $this->page_title() ;

   //include_once('panel_list_edit.php');
   //panel_list_edit(array('title_list'=>'Роли персонала','title_create'=>'Новая роль','list_name'=>'IL_roll','read_only_id'=>$member->info['rol'])) ;
   $this->panel_list_edit($_SESSION['ARR_roll']) ;
     //damp_array($_SESSION['ARR_roll']) ;
 }

 function panel_list_edit($recs)
{ $recs_AD_to_rol=execSQL_row('select personal_id,id from view_IL_ad_groups where personal_id>0') ;
  ?><form>
    <button class="v2" cmd="AD/save_AD_rol">Сохранить изменения</button>
    <table class="basic fz_small"><tr><th>ID</th><th>Роль</th><th>Группы ActiveDirectory</th></tr>
     <?if ($recs) foreach($recs as $id=>$rec)
       { ?><tr><td class="left"><?echo $id?></td>
               <td class="left"><?echo $rec['obj_name'] ; ?></td>
               <td class="left"><?//if (_sizeof($recs_rol_by_AD[$id])) echo implode('<br>',$recs_rol_by_AD[$id]).'<br>' ;
                 ?><select name="recs_rol[<?echo $id?>][groups_AD]" style="width:400px;"><option value="0">-</option>
                     <? foreach(_IL('IL_ad_groups')->recs as $rec_group)  {?><option value="<?echo $rec_group['id']?>" <?if ($recs_AD_to_rol[$id]==$rec_group['id']) echo 'selected'?>><?echo $rec_group['obj_name']?></option><?}?>
                   </select>
               </td>
          </tr><?
       }?>
   </table>
   </form>
  <?
}


}



?>
