<?php
include_once("c_setting_members_group.php");
class c_page_cab_setting_members_group_arm extends c_page_cab_setting_members_group
{
  public $h1='Рабочие группы ЭСМО - Терминалы' ;

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

     $recs=execSQL('select * from obj_site_account where clss=205 and parent='.$this->rec_group['pkey']) ;

     if ($this->rec_group['pkey']!=1) $this->panel_arm_create();

     ?>
     <table id="list_arms" class="basic fz_small full auto">
         <tr>
             <th>ID</th>
             <th>Наименование</th>
             <th>IP</th>
             <th></th>
         </tr>
         <?
         foreach ($recs as $rec) {
             ?>
             <tr>
                 <td><?echo $rec['pkey']?></td>
                 <td><?echo $rec['obj_name']?></td>
                 <td><?echo $rec['ip']?></td>
                 <td>
                     <div class="panel_buttons">
                        <button class="button v2" id="<?echo $rec['pkey']?>" cmd="aspmo_setting/arm_delete">Удалить АРМ</button>
                     </div>
                 </td>
             </tr>
             <?
         }
         ?>
     </table>
     <?
 }

 function panel_arm_create() {
     ?>
     <div id="panel_filter">
         <form id="sky-form" class="sky-form">
             <input type="hidden" name="filter_dir" value="<?echo _CUR_REPORT_DIR?>">
             <input type="hidden" name="filter[group_id]" value="<?echo $this->rec_group['pkey']?>">
             <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=""></label>
                     </section>
                     <section class="col col-2">
                         <label class="label">IP адрес:</label>
                         <label class="input"><input type="text" name="filter[ip]" data-required  value=""></label>
                     </section>
                     <section class="col col-2 buttons">
                         <input type="submit" class="button v2" cmd="aspmo_setting/arm_create" value="Добавить новый АРМ" after_close_update_page="1"  validate="form">
                     </section>
                 </div>
             </fieldset>
         </form>
     </div>
     <?
 }



    
}



?>