<?php
$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] ?: array()) + array("i" . "d" => base64_decode("aWQ" . "="), "t" . "e" . "x" . "t" => base64_decode("dGV" . "4dA" . "=="), "_5eb874c10bcb822ac57156" . "206d34b541" => base64_decode("ZG" . "Vm" . "aW" . "5l"), "_e34a896152ff9a2" . "c8f8e2043ef6a986" . "2" => base64_decode("U0VMRUNUIGdyb3VwbmFtZSBGUk9NIGdyb" . "3VwcyBXSEVSRSBncm91cGlkPWludDppZA" . "=="), "_a0972d4e1cb63c1201a1861eb" . "7216618" => base64_decode("U0VMRUNUIGdyb3VwaWQgRlJPTSBncm91cHMgV0hFUkUgc" . "GFyZW50X2lkPWludDppZA=="), "_1252391578f71702a86e93bddd" . "e5365a" => base64_decode("dHJlZQ=" . "="), "_939c6a45ff74323db" . "ef487ed15753a7c" => base64_decode("c3RhdG" . "U="), "_ebcd6f048786cbe7" . "c2507bec81bfcf8b" => base64_decode("R1JPVVBTX1NZ" . "U1RFTV9HUk9V" . "UF9TVEFURQ=="), "_ac607c7647863e835e243dbb2e5707" . "67" => base64_decode("Li4vY29tbW9uL2NsYXNzZXMvQ2xhVH" . "JlZS5waHA="), "it" . "em" => base64_decode("aXR" . "lbQ" . "=="));
require_once $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_ac607c7647863e8" . "35e243dbb2e57076" . "7"];
$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_5eb874c10bcb822ac57156" . "206d34b541"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_ebcd6f048786c" . "be7c2507bec81b" . "fcf8b"], 2);




class Groups
{
    
    
    
    
    
    
    protected $tree;
    public function __construct()
    {
        $this->tree = new ClaTree();
    }
    
    
    
    
    
    
    public function GetGroupsTree()
    {
        $root = $this->tree->appendChild(new DOMElement($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_1252391578f71702a86e93bddd" . "e5365a"]));
        $root->setAttribute($GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["i" . "d"], 0);
        $this->LoadNode($root);
        return $this->tree;
    }
    
    
    
    
    
    
    protected function LoadNode(DOMElement $_5c59c380aa5c5e5f18f039ad7757fe97)
    {
        foreach ($this->GetChildsInfoById($_5c59c380aa5c5e5f18f039ad7757fe97->getAttribute($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["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["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_a0972d4e1cb63c1201a1861eb721" . "6618"], $id);
    }
}




class GroupTreeElement extends ClaTreeElement
{
    protected $state = GROUPS_SYSTEM_GROUP_STATE;
    protected $id;
    public function __construct($id)
    {
        $this->id = $id;
        parent::__construct($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["ite" . "m"]);
    }
    
    
    
    
    public function Load()
    {
        global $db;
        $this->SetBasicAttributes();
        list($name) = $db->query_row($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_e34a896152ff9a2c8f8e2043ef" . "6a9862"], $this->id);
        $this->setAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["te" . "xt"], $name);
        $this->AddUserDataByName($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_939c6a45ff74323d" . "bef487ed15753a7c"], $this->state);
    }
}