<?php
$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"] = (@$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"] ?: array()) + array("_32710812e9f3" . "c730de6579937" . "e571ec3" => base64_decode("PC9kaX" . "Y+"), "_11cad0367c939d76c4f877581" . "c151a10" => base64_decode("eQ=" . "="), "_d09f7d09413f95b252b4e4" . "af275ad7e4" => base64_decode("CgkJPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCQkJLklDQ29tcG9uZW50U3RhdHVzZXM+ZGl2IHsKCQkJCWNsZWFyOiBib3RoOwoJCQl9CgkJCS5JQ0NvbXBvbmVudFN0YXR1c2VzIC5zdGF0dXNfbGFiZWwgewoJCQkJLyogbWFyZ2luLXRvcDogMnB4OwoJCQkJcG9zaXRpb246IGFic29sdXRlOyAqLwoJCQkJcGFkZGluZy10b3A6IDVweDsKCQkJCXBhZGRpbmctYm90dG9tOiAtMXB4OwoJCQkJei1pbmRleDogMTA7CgkJCQl3aGl0ZS1zc" . "GFjZTogbm93cmFwOwoJCQl9CgkJCS5JQ0NvbXBvbmVudFN0YXR1c2VzIGRpdiBkaXYuc3RhdHVzX2JhciB7CgkJCQl3aWR0aDogNSU7CgkJCQloZWlnaHQ6IDEuMmVtOwoJCQkJbWFyZ2luOiAycHggMDsKCQkJCWZsb2F0OiBsZWZ0OwoJCQkJYm9yZGVyOiAxcHggc29saWQgZ3JheTsKCQkJfQoJCTwvc3R5bGU+CgkJPGRpdiBjbGFzcz0iSUNDb21wb25lbnRTdGF0dXNlcyI+CgkJ"), "_2b031162240b6f8993ad" . "c529a0adf6bf" => base64_decode("CgkJcmVxdWlyZShbJ2RvbVJlYWR5JywgJ2NsYV9oaWdoY2hhcnRzJ10sIGZ1bmN0aW9uIChkb21SZWFkeSwgSGlnaGNoYXJ0cykgewoJCWRvbVJlYWR5KGZ1bmN0aW9uKCkgewoJCQl2YXIgb3B0aW9ucyA9IHsKCQkJCWxlZ2VuZDogewoJCQkJCWVuYWJsZWQ6IGZhbHNlCgkJCQl9LAoJCQkJY3JlZGl0czogewoJCQkJCWVuYWJsZWQ6IGZhbHNlCgkJCQl9LAoJCQkJcGxvdE9wdGlvbnM6IHsKCQkJCQliYXI6IHsKCQkJCQkJZGF0YUxhYmVsczogewoJCQkJCQk" . "JZW5hYmxlZDogdHJ1ZQoJCQkJCQl9CgkJCQkJfSwKCQkJCQlzZXJpZXM6IHsKCQkJCQkJYW5pbWF0aW9uOiBmYWxzZSwKCQkJCQkJYm9yZGVyQ29sb3I6ICcjMDAwMDAwJywKCQkJCQkJYm9yZGVyV2lkdGg6IDEKCQkJCQl9CgkJCQl9LAoJCQkJY2hhcnQ6IHsKCQkJCQlhbmltYXRpb246IGZhbHNlLAoJCQkJCXJlbmRlclRvOiAnSUNDb21wb25lbnRTdGF0dXNlcycsCgkJCQkJZGVmYXVsdFNlcmllc1R5cGU6ICdiYXInLAoJCQkJCWhlaWdodDog"), "_de69c409b5ac594851" . "ec6e55e269c4fb" => base64_decode("U0VMRUNUIGNvZGUsIHRpdGxlLCBjb2xvciBGUk9NIGhkX3Byb2plY3Rfc3RhdHVzZXMgV0hFUkUgcHJvamVjd" . "F9pZD1pbnQ6cF9pZCBPUkRFUiBCWSBvcmRlcl9ubw=="), "_9786366b3cd1d0ae71a719d4" . "e61a851d" => base64_decode("PC9kaXY+PGRpdiBjbGFzcz0ic3RhdHVzX2JhciI" . "gc3R5bGU9ImJhY2tncm91bmQ6ICM="), "_4cb76134c6427d496cf37cb907" . "7a202a" => base64_decode("Iw=" . "="), "_57d04eea059ecc4720ff83427" . "e7e88e8" => base64_decode("OyB3aWR" . "0aDog"), "_51299718a8e2ab858b976a9" . "45c63d9ec" => base64_decode("OyI+PC9kaXY+IDwvZGl2PgoJC" . "Qk="), "_a4291f9b9e477a083dd18a1579" . "fb9031" => base64_decode("CgkJPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQi" . "Pg=="), "h" . "t" . "m" . "l" => base64_decode("aH" . "Rt" . "bA" . "=="), "proj" . "ect_" . "id" => base64_decode("cHJvamVjdF9pZ" . "A=="), "_7aefd482de7885f4293c292" . "6df28c235" => base64_decode("anNvbl9lbmNv" . "ZGU="), "_31767d7ad58e706dbf47b7a51" . "a0fe6c4" => base64_decode("Y29" . "1bn" . "Q="), "_c4259d487eb64281720180c81f766" . "ab0" => base64_decode("LAoJCQkJCXRpdGxlOiB7CgkJCQkJCXRleHQ6ICcnCgkJCQkJfQoJCQkJfSwKCQkJCXlBeGlzOiB7CgkJCQkJbWluOiAwLAoJCQkJCXRpdGxlOiB7CgkJCQkJCXRleHQ6ICcnCgkJCQkJfQoJCQkJfSwKCQkJCXRvb" . "2x0aXA6IHsKCQkJCQllbmFibGVkOiBmYWxzZQoJCQkJfSwKCQkJCXNlcmllczogW3sgbmFtZTogJycsIGRhdGE6IA=="), "_c06c961f393742ecfd52b72263ac9" . "470" => base64_decode("aW" . "50" . "dm" . "Fs"), "_9012937b" . "ef77e429d" . "e11bb106a" . "39ba84" => base64_decode("PGRpdj48ZGl2IGNsY" . "XNzPSJzdGF0dXNfbG" . "FiZWwiPg=="), "_b169018ad0c25095bcd72f728e" . "eef079" => base64_decode("U0VMRUNUIENPVU5UKDEpLCBzdGF0dXMgRlJPTSBoZF9pc3N1ZSBXS" . "EVSRSBwcm9qZWN0X2lkPWludDpwX2lkIEdST1VQIEJZIHN0YXR1cw" . "=="), "nam" . "e" => base64_decode("bmFtZ" . "Q=="), "_48716664ff1a8cdd6cccfc" . "9613c645fe" => base64_decode("bW" . "F4"), "_84929763267bc12007295ccd5" . "4f62914" => base64_decode("Y2" . "9s" . "b3" . "I="), "_af0b72c3449345" . "14223a36fedd9e8" . "10a" => base64_decode("JQ" . "=="), "_96198f058ad28c95b764" . "169c383655cc" => base64_decode("fV0KCQkJfTsKCQkJdmFyIElDX2RpYWdyYW1fY2hhcnQ" . "gPSBuZXcgSGlnaGNoYXJ0cy5DaGFydChvcHRpb25zKT" . "sKCQl9KTsKCQl9KTsKCQk8L3NjcmlwdD4KCQk8ZGl2I" . "GlkPSJJQ0NvbXBvbmVudFN0YXR1c2VzIj48L2Rpdj4="), "_3c92cdcf14" . "42cf6000466" . "cd3f7732235" => base64_decode("CgkJCQl9LAoJCQkJdGl0bGU6IHsKCQkJCQl0ZX" . "h0OiAnJwoJCQkJfSwKCQkJCXN1YnRpdGxlOiB7" . "CgkJCQkJdGV4dDogJycKCQkJCX0sCgkJCQl4QX" . "hpczogewoJCQkJCWNhdGVnb3JpZXM6IA=="), "_b92b5ed2edaf" . "18b8eec721c14" . "22e34ee" => base64_decode("cm" . "91" . "bm" . "Q="), "_7814675990" . "7f4a2336a8e" . "9a14e69327a" => base64_decode("Tm8gcHJvamVjdCBpZC" . "BnaXZlbg=="));






class ICComponentStatuses implements TemplaterComponent
{
    public function Show($attributes)
    {
        $project_id = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_c06c961f393742" . "ecfd52b72263ac9" . "470"]($attributes[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["project_i" . "d"]]);
        if ($project_id == 0) {
            return $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_78146759907f4a2336a8e9a14e" . "69327a"];
        }
        if (!empty($attributes[$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["htm" . "l"]])) {
            return $this->ShowHTML($project_id, $attributes);
        } else {
            return $this->ShowHighcharts($project_id, $attributes);
        }
    }
    protected function ShowHTML($project_id)
    {
        $_eea3e56316d2617829b2da4c1bc6877b = $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_d09f7d09413f95b" . "252b4e4af275ad7e" . "4"];
        $_b0f3f8a3704de3f70def30cad0fc29ff = $this->GetIssuesCount($project_id);
        $_8e02c4dc91df1751dfd7587b272eda2f = $this->GetStatusesInfo($project_id);
        if ($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_31767d7ad58e706dbf47b7a5" . "1a0fe6c4"]($_b0f3f8a3704de3f70def30cad0fc29ff) > 0) {
            $_c482f647d2101bbd08513ba0acc302aa = $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_48716664ff1a8cdd6cccfc9613c645" . "fe"]($_b0f3f8a3704de3f70def30cad0fc29ff);
        }
        if ($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_31767d7ad58e706dbf" . "47b7a51a0fe6c4"]($_b0f3f8a3704de3f70def30cad0fc29ff) == 0 || $_c482f647d2101bbd08513ba0acc302aa == 0) {
            $_c482f647d2101bbd08513ba0acc302aa = 1000000;
        }
        foreach ($_8e02c4dc91df1751dfd7587b272eda2f as $code => $info) {
            list($_1df1a0ef0a351566378a5315e6b469de, $_9e83ad5eda5f8948dec6b72d03c8d7bb) = $info;
            if (!isset($_b0f3f8a3704de3f70def30cad0fc29ff[$code])) {
                continue;
            }
            $_cebfcd476bf270db50138bc836f53622 = $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_b92b5ed2edaf18b8ee" . "c721c1422e34ee"]($_b0f3f8a3704de3f70def30cad0fc29ff[$code] * 100 / $_c482f647d2101bbd08513ba0acc302aa) . $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_af0b72c344934514223a36fed" . "d9e810a"];
            $_eea3e56316d2617829b2da4c1bc6877b .= $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_9012937bef77e429de11bb106a39" . "ba84"] . $_1df1a0ef0a351566378a5315e6b469de . $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_9786366b3cd1d0ae71a719d4e61a8" . "51d"] . $_9e83ad5eda5f8948dec6b72d03c8d7bb . $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_57d04eea059ecc4720ff8" . "3427e7e88e8"] . $_cebfcd476bf270db50138bc836f53622 . $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_51299718a8e2ab858b976a945c6" . "3d9ec"];
        }
        $_eea3e56316d2617829b2da4c1bc6877b .= $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_32710812e9f3c730d" . "e6579937e571ec3"];
        return $_eea3e56316d2617829b2da4c1bc6877b;
    }
    public function ShowHighcharts($project_id)
    {
        $_b0f3f8a3704de3f70def30cad0fc29ff = $this->GetIssuesCount($project_id);
        $_8e02c4dc91df1751dfd7587b272eda2f = $this->GetStatusesInfo($project_id);
        $_47716ab6fa06e15bc5f4a866af1fcd01 = array();
        $_76dd863338d20e5c6e34095d3f155142 = array();
        foreach ($_8e02c4dc91df1751dfd7587b272eda2f as $code => $info) {
            list($_1df1a0ef0a351566378a5315e6b469de, $_9e83ad5eda5f8948dec6b72d03c8d7bb) = $info;
            if (!isset($_b0f3f8a3704de3f70def30cad0fc29ff[$code])) {
                continue;
            }
            $_47716ab6fa06e15bc5f4a866af1fcd01[] = array($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_84929763267bc12" . "007295ccd54f6291" . "4"] => $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_4cb76134c6427d496cf" . "37cb9077a202a"] . $_9e83ad5eda5f8948dec6b72d03c8d7bb, $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_11cad0367c939d" . "76c4f877581c151" . "a10"] => (int) $_b0f3f8a3704de3f70def30cad0fc29ff[$code], $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["na" . "me"] => $_1df1a0ef0a351566378a5315e6b469de);
            $_76dd863338d20e5c6e34095d3f155142[] = $_1df1a0ef0a351566378a5315e6b469de;
        }
        $_eea3e56316d2617829b2da4c1bc6877b = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_a4291f9b9e477a083dd18a1579fb903" . "1"] . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_2b031162240b6f8993adc529" . "a0adf6bf"] . (30 + $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_31767d7ad58e706dbf47b" . "7a51a0fe6c4"]($_76dd863338d20e5c6e34095d3f155142) * 30) . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_3c92cdc" . "f1442cf6" . "000466cd" . "3f773223" . "5"] . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_7aefd482de7885f" . "4293c2926df28c23" . "5"]($_76dd863338d20e5c6e34095d3f155142) . $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_c4259d487eb64281720180c" . "81f766ab0"] . $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_7aefd48" . "2de7885f" . "4293c292" . "6df28c23" . "5"]($_47716ab6fa06e15bc5f4a866af1fcd01) . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_96198f058ad28c95b7" . "64169c383655cc"];
        return $_eea3e56316d2617829b2da4c1bc6877b;
    }
    protected function GetStatusesInfo($project_id)
    {
        global $db;
        $_189840d11056515e52402d1412a0b6e4 = $db->query($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_de69c409" . "b5ac59485" . "1ec6e55e2" . "69c4fb"], $project_id);
        $_354ade7121deb022b926fb0c68fd259c = array();
        while (list($code, $title, $_84929763267bc12007295ccd54f62914) = $_189840d11056515e52402d1412a0b6e4->fetchRow()) {
            $_354ade7121deb022b926fb0c68fd259c[$code] = array($title, $_84929763267bc12007295ccd54f62914);
        }
        return $_354ade7121deb022b926fb0c68fd259c;
    }
    protected function GetIssuesCount($project_id)
    {
        global $db;
        $_189840d11056515e52402d1412a0b6e4 = $db->query($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_b169018ad0c25095bcd72f728eeef07" . "9"], $project_id);
        $_b0f3f8a3704de3f70def30cad0fc29ff = array();
        while (list($_3ce61d3a8a385e00d1583b95ce3eacb0, $code) = $_189840d11056515e52402d1412a0b6e4->fetchRow()) {
            $_b0f3f8a3704de3f70def30cad0fc29ff[$code] = $_3ce61d3a8a385e00d1583b95ce3eacb0;
        }
        return $_b0f3f8a3704de3f70def30cad0fc29ff;
    }
}