<?php
/*
Generated by OutputBooks Team
*/

defined("\102\101\123\x45\x50\x41\124\x48") or exit("\116\157\40\144\151\x72\x65\x63\164\x20\163\x63\162\151\x70\x74\x20\x61\x63\x63\x65\x73\x73\40\x61\154\x6c\157\167\x65\x64");
class GroupreportModel extends MY_Model
{
    public $message = '';
    private $cId = null;
    public function __construct()
    {
        goto RlL8e;
        RlL8e:
        parent::__construct();
        goto vamuX;
        vamuX:
        $this->cId = get_company("\151\x64");
        goto K6zqt;
        K6zqt:
        $this->userId = get_user_data("\151\x64");
        goto iaTuj;
        iaTuj:
    }
    public function getcompanies_list($params)
    {
        goto ivH0A;
        wON3L:
        if (!empty($params) && !empty($params["\x69\163\x72\x65\x70\157\162\164"])) {
            $this->db->where("\x70\111\x64\40\75", 0);
        }
        goto yTdzH;
        MHAhk:
        $this->db->from("\x63\157\x6d\160\x61\156\x69\145\163");
        goto wON3L;
        cjooM:
        return $companies;
        goto NzELr;
        ivH0A:
        $companies = array();
        goto NyaMS;
        mnDg_:
        $companies = $this->db->get()->result_array();
        goto cjooM;
        NyaMS:
        $this->db->select("\52");
        goto MHAhk;
        yTdzH:
        $this->db->where("\x69\163\101\143\164\151\x76\145", 1);
        goto mnDg_;
        NzELr:
    }
    public function getchild_companies($id)
    {
        goto uS7DZ;
        EmZQ0:
        $this->db->from("\143\157\x6d\x70\x61\156\151\x65\163");
        goto KoXrr;
        eyCOR:
        return $companies;
        goto xQKA5;
        amPfi:
        $companies["\143\x68\x69\154\144\163"] = $this->db->get()->row_array();
        goto ueY61;
        HDqjP:
        $this->db->where("\160\x49\144", $id);
        goto u139a;
        uS7DZ:
        $this->db->select("\x47\x52\117\x55\x50\137\103\117\116\103\x41\x54\50\x69\x64\51\40\x61\x73\40\x69\x64");
        goto t184t;
        T0Hi0:
        $this->db->group_start();
        goto HDqjP;
        KoXrr:
        $this->db->where("\151\144", $id);
        goto RqphK;
        ueY61:
        $this->db->select("\x2a");
        goto EmZQ0;
        c6UM1:
        $this->db->group_end();
        goto amPfi;
        t184t:
        $this->db->from("\x63\x6f\155\160\141\x6e\x69\x65\163");
        goto T0Hi0;
        RqphK:
        $companies["\x63\157\x6d\160\141\x6e\171"] = $this->db->get()->result_array();
        goto eyCOR;
        u139a:
        $this->db->or_where("\x69\144", $id);
        goto c6UM1;
        xQKA5:
    }
    public function getparent_list($data)
    {
        goto KTLfB;
        PNGE9:
        return $res;
        goto hXniA;
        K_6MP:
        $this->db->select("\x2a");
        goto a_2SW;
        XGeuF:
        $get_parent = $this->db->get()->result_array();
        goto bNdh7;
        P_1jv:
        $this->db->where("\160\111\144\x20\x3d", 0);
        goto XGeuF;
        G1Qmf:
        $companies = $this->db->get()->row_array();
        goto K_6MP;
        bNdh7:
        if (!empty($companies)) {
            goto OS718;
            D3O8a:
            $res = array_values($res);
            goto wEE76;
            BB0st:
            foreach ($res as $ky => $val) {
                if ($val["\151\144"] == (int) $data["\151\x64"]) {
                    unset($res[$ky]);
                }
                dxpu5:
            }
            goto wTzlT;
            wTzlT:
            vQzY3:
            goto D3O8a;
            OS718:
            $res = $get_parent;
            goto BB0st;
            wEE76:
        }
        goto PNGE9;
        Aj_UA:
        $this->db->from("\x63\157\x6d\x70\141\x6e\x69\x65\x73");
        goto LD7aO;
        a_2SW:
        $this->db->from("\143\x6f\155\x70\x61\156\151\x65\x73");
        goto P_1jv;
        LD7aO:
        $this->db->where("\x69\x64", $data["\151\x64"]);
        goto G1Qmf;
        KTLfB:
        $this->db->select("\52");
        goto Aj_UA;
        hXniA:
    }
    public function save($data)
    {
        if (isset($data["\160\141\x72\145\156\164"])) {
            goto CIn9u;
            CIn9u:
            $this->db->set("\160\x49\x64", $data["\160\x49\x64"]);
            goto CTW40;
            Ip1JF:
            return true;
            goto dxZ3X;
            ziItD:
            $this->db->update("\143\157\155\160\x61\156\x69\145\x73");
            goto Ip1JF;
            CTW40:
            $this->db->where("\151\144", $data["\x69\144"]);
            goto ziItD;
            dxZ3X:
        }
    }
}
