<?php
include_once("c_kt_setting.php");
class c_page_cab_kt_setting_device_edit extends c_page_cab_kt_setting
{
    public $h1='Конфигурация устройств контроля трезвости' ;

    function block_main()
    {
        $this->panel_zone_list();
    }

    function panel_zone_list()
    {
        $arr_groups=SKD()->get_list_zone() ;?>
        <table class="basic fz_small auto">
            <tr><th>ID</th><th>Зона доступа</th><th width="250">Терминалы</th><th>Карточка зоны</th></tr>
            <? if (_sizeof($arr_groups)) foreach ($arr_groups as $group) {?>
            <tr>
                <td><?echo $group['pkey']?></td>
                <td class="left"><?echo SKD()->get_full_zone_path($group['pkey']);?></td>
                <td class="left">
                    <? $recs=DEVICE()->get_devices_by_parent($group['pkey']);
                    if (_sizeof($recs)) {?>
                        <div style="max-height:100px;overflow:auto;">
                        <? foreach ($recs as $rec) {?>
                            <p><?echo $rec['obj_name']?></p>
                        <?}?>
                        </div>
                    <?}?>
                </td>
                <td><a href="/window/kt/setting/zone/<?echo $group['pkey']?>/" class="new_window">Карточка</a></td>
            </tr>
            <?}?>
        </table><?
    }


}

?>
