<?php
$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"] = (@$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"] ?: array()) + array("_939c6a45ff74323dbef487ed15753a7" . "c" => base64_decode("c3" . "Rh" . "dG" . "U="), "te" . "xt" => base64_decode("dGV4dA" . "=="), "_e34a896152ff9a2c8f" . "8e2043ef6a9862" => base64_decode("U0VMRUNUIGdyb3VwbmFtZSBGUk9NIGdyb3VwcyBXSEVSRSBncm91cGlkPWludD" . "ppZA=="), "_ebcd6f048786cbe7c25" . "07bec81bfcf8b" => base64_decode("R1JPVVBTX1N" . "ZU1RFTV9HUk" . "9VUF9TVEFUR" . "Q=="), "ite" . "m" => base64_decode("aXRlbQ=" . "="), "_ac607c7647863e835e243dbb" . "2e570767" => base64_decode("Li4vY29tbW9" . "uL2NsYXNzZX" . "MvQ2xhVHJlZ" . "S5waHA="), "_5eb874c1" . "0bcb822ac" . "57156206d" . "34b541" => base64_decode("ZGVm" . "aW5l"), "i" . "d" => base64_decode("aWQ" . "="), "_1252391578f71702a86e" . "93bddde5365a" => base64_decode("dHJlZQ=" . "="), "_a0972d4e1cb63c1201a1861eb7" . "216618" => base64_decode("U0VMRUNUIGdyb3VwaWQ" . "gRlJPTSBncm91cHMgV0" . "hFUkUgcGFyZW50X2lkP" . "WludDppZA=="));
require_once $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_ac607c7647863e835e243dbb2e57" . "0767"];
$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_5eb874c10bcb822" . "ac57156206d34b54" . "1"]($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_ebcd6f048786cbe7c2507bec81" . "bfcf8b"], 2);




class Groups
{
    
    
    
    
    
    
    protected $tree;
    public function __construct()
    {
        $this->tree = new ClaTree();
    }
    
    
    
    
    
    
    public function GetGroupsTree()
    {
        $root = $this->tree->appendChild(new DOMElement($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_1252391578f71702a86e93bddde5" . "365a"]));
        $root->setAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["i" . "d"], 0);
        $this->LoadNode($root);
        return $this->tree;
    }
    
    
    
    
    
    
    protected function LoadNode(DOMElement $_5c59c380aa5c5e5f18f039ad7757fe97)
    {
        foreach ($this->GetChildsInfoById($_5c59c380aa5c5e5f18f039ad7757fe97->getAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["i" . "d"])) as $_174e15928a28c15cc95b46dd39328987) {
            $_df8d541fa6963e8101557408acad8023 = $_5c59c380aa5c5e5f18f039ad7757fe97->appendChild($this->GetElementByInfo($_174e15928a28c15cc95b46dd39328987));
            $_df8d541fa6963e8101557408acad8023->Load();
            $this->LoadNode($_df8d541fa6963e8101557408acad8023);
        }
    }
    protected function GetElementByInfo($info)
    {
        list($id) = $info;
        return new GroupTreeElement($id);
    }
    
    
    
    
    
    
    
    
    protected function GetChildsInfoById($id)
    {
        global $db;
        $_343a395319323dd7609bcbc465b4d034 = array();
        $_189840d11056515e52402d1412a0b6e4 = $db->query($this->GetChildsQuery($id));
        while ($row = $_189840d11056515e52402d1412a0b6e4->fetchRow()) {
            $_343a395319323dd7609bcbc465b4d034[] = $row;
        }
        return $_343a395319323dd7609bcbc465b4d034;
    }
    
    
    
    
    
    
    
    protected function GetChildsQuery($id)
    {
        return new Query($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_a0972d4e1cb63c1201a18" . "61eb7216618"], $id);
    }
}




class GroupTreeElement extends ClaTreeElement
{
    protected $state = GROUPS_SYSTEM_GROUP_STATE;
    public string $id;
    public function __construct($id)
    {
        parent::__construct($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["i" . "t" . "e" . "m"]);
        $this->id = $id;
    }
    
    
    
    
    public function Load()
    {
        global $db;
        $this->SetBasicAttributes();
        list($name) = $db->query_row($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_e34a896152ff9a2c8" . "f8e2043ef6a9862"], $this->id);
        $this->setAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["tex" . "t"], $name);
        $this->AddUserDataByName($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_939c6a45ff" . "74323dbef48" . "7ed15753a7c"], $this->state);
    }
}