<?php
include_once("c_setting_members.php");
class c_page_cab_setting_members_new extends c_page_cab_setting_members
{
  public $h1='Новый персонал' ;

  function block_main()
  { //$this->page_title() ;
    $this->panel_group_create() ;
    $this->panel_member_create() ;
    $this->panel_arm_create() ;
//    $this->panel_terminal_create() ;
  }

  function panel_group_create()
    {   $this->page_title('Рабочие группы ЭСМО') ;
        //$arr_groups=ACCOUNTS()->get_list_workgoups(array('usl'=>'(clss=206 and enabled=1) or (clss=1 and parent=1)')) ;
        $arr_groups=ACCOUNTS()->get_list_workgoups(array('_usl'=>'(clss=1 and parent=1)')) ;
        ?><div id="panel_filter">
                <form id="sky-form" class="sky-form">
                    <input type="hidden" name="filter_dir" value="<?echo _CUR_REPORT_DIR?>">
                     <fieldset>
                         <div class="row">
                             <section class="col col-2">
                                 <label class="label">Название группы:</label>
                                 <label class="input"><input type="text" data-required name="filter[name]" value="<?echo $this->filter['name']?>"></label>
                             </section>
                             <section class="col col-2">
                                 <label class="label">Родительская группа</label>
                                 <label class="select">
                                     <select name="filter[group_id]">
                                        <?if (_sizeof($arr_groups)) foreach($arr_groups as $id=>$rec){?><option value="<?echo $id?>" <?if ($this->filter['group_id']==$id) echo 'selected'?>><?echo $rec['obj_name']?></option><?}?>
                                     </select>
                                 </label>
                             </section>

                         </div>
                     </fieldset>
                    <div id="panel_buttons"><input type="submit" class="button v2" cmd="aspmo_setting/group_create" value="Добавить новую рабочую группу"  validate="form"></div><br>
                 </form>
          </div><br>
        <?
    }

  function panel_member_create()
    {   $arr_groups=ACCOUNTS()->get_list_workgoups(array('usl'=>'(clss=206 and enabled=1) or (clss=1 and parent=1)')) ;
        $this->page_title('Персонал') ;
        ?><div id="panel_filter">
                <form id="sky-form" class="sky-form">
                    <input type="hidden" name="filter_dir" value="<?echo _CUR_REPORT_DIR?>">
                     <fieldset>
                         <div class="row">
                             <section class="col col-2">
                                 <label class="label">ФИО:</label>
                                 <label class="input"><input type="text" name="filter[name]" data-required value="<?echo $this->filter['name']?>"></label>
                             </section>
                             <section class="col col-2">
                                 <label class="label">Группа</label>
                                 <label class="select">
                                     <select name="filter[group_id]" data-required >
                                        <?if (_sizeof($arr_groups)) foreach($arr_groups as $id=>$rec){?><option value="<?echo $id?>" <?if ($this->filter['group_id']==$id) echo 'selected'?>><?echo $rec['obj_name']?></option><?}?>
                                     </select>
                                 </label>
                             </section>
                             <section class="col col-2">
                              <label class="label">Роль</label>
                              <label class="select" >
                                  <select name="filter[rol]" data-required>
                                     <?if (_sizeof($_SESSION['ARR_roll'])) foreach($_SESSION['ARR_roll'] as $id=>$rec){?><option value="<?echo $id?>" <?if ($this->filter['rol']==$id) echo 'selected'?>><?echo $rec['obj_name']?></option><?}?>
                                  </select>
                              </label>
                             </section>
                         </div>
                         <div class="row">
                             <section class="col col-2">
                                 <label class="label">Логин:</label>
                                 <label class="input"><input type="text" name="filter[login]" data-required  value="<?echo $this->filter['login']?>"></label>
                             </section>
                             <section class="col col-2">
                                 <label class="label">Пароль:</label>
                                 <label class="input"><input type="password" name="filter[password]" data-required  value="<?echo $this->filter['password']?>"></label>
                             </section>
                         </div>
                     </fieldset>
                    <div id="panel_buttons"><input type="submit" class="button v2" cmd="aspmo_setting/account_create" value="Добавить нового сотрудника"  validate="form"></div><br>
                 </form>
          </div><br>
        <?
    }

    function panel_arm_create()
      {   $this->page_title('АРМ ЭСМО') ;
          $arr_groups=ACCOUNTS()->get_list_workgoups() ;
          ?><div id="panel_filter">
                  <form id="sky-form" class="sky-form">
                      <input type="hidden" name="filter_dir" value="<?echo _CUR_REPORT_DIR?>">
                       <fieldset>
                           <div class="row">
                               <section class="col col-2">
                                   <label class="label">Группа</label>
                                   <label class="select">
                                       <select name="filter[group_id]" data-required >
                                          <?if (_sizeof($arr_groups)) foreach($arr_groups as $id=>$rec){?><option value="<?echo $id?>" <?if ($this->filter['group_id']==$id) echo 'selected'?>><?echo $rec['obj_name']?></option><?}?>
                                       </select>
                                   </label>
                               </section>
                               <section class="col col-2">
                                   <label class="label">Название АРМ:</label>
                                   <label class="input"><input type="text" name="filter[name]" data-required  value="<?echo $this->filter['name']?>"></label>
                               </section>
                               <section class="col col-2">
                                   <label class="label">IP адрес:</label>
                                   <label class="input"><input type="text" name="filter[ip]" data-required  value="<?echo $this->filter['ip']?>"></label>
                               </section>
                           </div>
                       </fieldset>
                      <div id="panel_buttons"><input type="submit" class="button v2" cmd="aspmo_setting/arm_create" value="Добавить новый АРМ"  validate="form"></div><br>
                   </form>
            </div><br>
          <?
      }

    function panel_terminal_create()
      {   $this->page_title('Терминалы') ;
          $arr_groups=ACCOUNTS()->get_list_workgoups() ;
          ?><div id="panel_filter">
                  <form id="sky-form" class="sky-form">
                      <input type="hidden" name="filter_dir" value="<?echo _CUR_REPORT_DIR?>">
                       <fieldset>
                           <div class="row">
                               <section class="col col-2">
                                   <label class="label">Группа</label>
                                   <label class="select">
                                       <select name="filter[group_id]" data-required >
                                          <?if (_sizeof($arr_groups)) foreach($arr_groups as $id=>$rec){?><option value="<?echo $id?>" <?if ($this->filter['group_id']==$id) echo 'selected'?>><?echo $rec['obj_name']?></option><?}?>
                                       </select>
                                   </label>
                               </section>
                               <section class="col col-2">
                                   <label class="label">Название терминала:</label>
                                   <label class="input"><input type="text" data-required name="filter[name]" value="<?echo $this->filter['name']?>"></label>
                               </section>
                               <section class="col col-2">
                                   <label class="label">ID терминала:</label>
                                   <label class="input"><input type="text" data-required name="filter[id]" value="<?echo $this->filter['id']?>"></label>
                               </section>
                               <section class="col col-2">
                                   <label class="label">IP адрес:</label>
                                   <label class="input"><input type="text" data-required name="filter[ip]" value="<?echo $this->filter['ip']?>"></label>
                               </section>
                               <section class="col col-2">
                                <label class="label">Профиль</label>
                                <label class="select">
                                    <select name="filter[profil]">
                                       <?if (_sizeof(_IL('IL_term_prof')->recs)) foreach(_IL('IL_term_prof')->recs as $id=>$rec){?><option value="<?echo $id?>" <?if ($this->filter['profil']==$id) echo 'selected'?>><?echo $rec['obj_name']?></option><?}?>
                                    </select>
                                </label>
                               </section>

                           </div>
                       </fieldset>
                      <div id="panel_buttons"><input type="submit" class="button v2" cmd="aspmo_setting/terminal_create" value="Добавить новый терминал"  validate="form"></div><br>
                   </form>
            </div><br>
          <?
      }



}



?>
