<?php
include_once("c_AD_setting.php");
class c_page_cab_AD_setting_groups extends c_page_cab_AD_setting
{
    public $h1='Группы - ActiveDirectory' ;

    function block_main()
    {
        global $member ;
        $this->page_title() ;
        $this->panel_list_edit() ;
    }

    function panel_list_edit()
    { ?>
        <form>
            <table class="basic fz_small">
                <tr>
                    <th>Группа</th>
                    <th><input data-required="" type="text" name="group_name" class="big input_required" value=""></th>
                    <th><button class="v2" cmd="AD/get_group">Найти</button></th>
                </tr>
           </table>
            <div id="group_data"></div>
        </form>

        <script>
            $j(document).ready(function() {
                $j('#group_data').on('change', '.ad-role-select', function(e) {
                    var $el = $j(this)
                    var guid = $el.data('guid')
                    var role_id = $el.val()

                    $j('#save_'+guid).attr('role_id', role_id)
                })

                $j('#group_data').on('change', '.ad-group-select', function(e) {
                    var $el = $j(this)
                    var guid = $el.data('guid')
                    var group_id = $el.val()
                    $j('#save_'+guid).attr('group_id', group_id)
                })
            });
        </script>
    <? }
}
