<?php
/*
Generated by OutputBooks Team
*/

defined("\x42\x41\x53\105\120\x41\124\110") or exit("\x4e\x6f\x20\144\x69\162\145\143\x74\x20\x73\143\162\x69\160\164\40\141\x63\143\145\x73\163\40\141\x6c\154\x6f\167\x65\x64");
class Contacts extends MY_Controller
{
    private $_csType;
    public function __construct()
    {
        goto DUC9Y;
        IqSwq:
        $this->load->model("\143\x6f\156\164\x61\143\164\163\x4d\157\144\x65\x6c");
        goto d5EwE;
        iu9Bi:
        $this->_csType = (object) array("\x63\x75\x73\164\157\155\x65\162" => "\103", "\x73\165\x70\160\154\151\145\x72" => "\123", "\163\141\154\145\163\162\x65\160" => "\x52");
        goto IqSwq;
        d5EwE:
        $this->load->library("\164\x72\141\x6e\163\x5f\164\141\142\x6c\x65");
        goto XbZmd;
        DUC9Y:
        parent::__construct();
        goto iu9Bi;
        XbZmd:
        $this->cId = get_company("\151\144");
        goto gHtPS;
        gHtPS:
    }
    public function index()
    {
        $this->load->page("\x68\157\155\x65");
    }
    public function customers()
    {
        $this->listing($this->_csType->customer);
    }
    public function suppliers()
    {
        $this->listing($this->_csType->supplier);
    }
    public function branches($csType = '')
    {
        goto M51Rw;
        ZxgYT:
        $this->response->write();
        goto W_eVu;
        ELjt7:
        $branches = $this->contactsModel->get_branches($csType);
        goto Nb4XE;
        M51Rw:
        $this->response->success();
        goto ELjt7;
        Nb4XE:
        $this->response->set_data($branches);
        goto ZxgYT;
        W_eVu:
    }
    public function listing($csType = "\x43", $page = 1)
    {
        goto lXFp2;
        HrW8R:
        $data["\x70\x61\147\145\137\x6c\151\x6d\151\164"] = $this->config->item("\x70\141\147\x65\137\154\151\x6d\x69\164");
        goto Dqzsq;
        lXFp2:
        $permissionArr = array("\103" => "\115\x4e\x43\x55\123", "\123" => "\x4d\116\x53\125\120", "\x52" => "\x4d\116\123\x41\122", "\102" => "\115\x4e\x43\x55\123", "\114" => "\x4d\x4e\x43\125\123", "\104" => "\115\x4e\122\102\131", "\106" => "\115\116\103\x55\123", "\120" => "\120\x52\x4f");
        goto Xai5r;
        g9h5F:
        if (!empty($result["\151\164\145\x6d\x73"])) {
            $this->response->set_data("\151\164\145\155\x73", $result["\x69\x74\145\155\163"], true);
            unset($result["\x69\x74\x65\x6d\x73"]);
        }
        goto oZioa;
        Dqzsq:
        $data["\146\162\x6f\x6d"] = ($page - 1) * $data["\x70\141\x67\x65\x5f\x6c\x69\155\151\164"];
        goto eqEpq;
        MW02x:
        v27jU:
        goto HrW8R;
        WK0eV:
        return true;
        goto AwjPE;
        ZWkZA:
        if (!empty($data["\x74\x79\x70\x65"])) {
            if (!empty($result["\x69\164\x65\155\x73"])) {
                if ($csType == "\120" && !empty($data["\164\x79\x70\x65"])) {
                    foreach ($result["\x69\x74\x65\x6d\x73"] as $key => $item) {
                        goto BO1rV;
                        Jww__:
                        LCZ0P:
                        goto nVyH9;
                        BO1rV:
                        $item["\163\x6e\x6f"] = $key + 1;
                        goto HlgTW;
                        rt2Eq:
                        $result["\151\164\x65\x6d\x73"][$key] = $item;
                        goto Jww__;
                        HlgTW:
                        $item["\142\x61\154\141\x6e\x63\x65"] = format_amt_value($item["\142\x61\154\141\x6e\143\x65"]);
                        goto e6dLw;
                        e6dLw:
                        if (!empty($item["\x65\170\160\145\156\x73\145\x73"])) {
                            goto pyqTn;
                            tnwyJ:
                            $item["\160\x72\x6f\146\x69\x74"] = format_amt_value($item["\x70\x72\157\146\x69\164"]);
                            goto USC3C;
                            pyqTn:
                            $item["\145\170\x70\145\156\163\x65\163"] = format_amt_value($item["\145\x78\x70\x65\156\163\x65\x73"]);
                            goto FjxfY;
                            FjxfY:
                            $item["\x69\156\143\x6f\x6d\145"] = format_amt_value($item["\x69\156\x63\x6f\155\145"]);
                            goto tnwyJ;
                            USC3C:
                        }
                        goto rt2Eq;
                        nVyH9:
                    }
                    cfvHI:
                } else {
                    goto bYdjy;
                    Xqi5S:
                    kVuZc:
                    goto lJC0F;
                    bYdjy:
                    $scoreLevel = array(9 => "\x43\150\x61\x6d\160\x69\157\x6e\163", 8 => "\114\x6f\x79\141\154\x20\103\165\163\x74\157\155\145\162\x73", 7 => "\x50\157\164\145\x6e\164\151\141\x6c\x20\114\x6f\171\141\154\x69\163\x74", 6 => "\116\145\x77\40\x43\165\163\x74\x6f\x6d\145\x72", 5 => "\x50\x72\157\155\x69\x73\x69\x6e\147\40\x43\x75\163\164\157\155\x65\162", 4 => "\x4e\x65\x65\144\40\101\164\x74\145\156\164\x69\x6f\156", 3 => "\101\142\x6f\165\x74\x20\164\157\40\x53\x6c\145\145\x70", 2 => "\x43\141\156\47\x74\40\154\157\x6f\163\x65\x20\164\150\145\x6d", 1 => "\123\x6c\x65\x65\160\x69\x6e\147");
                    goto OrQjx;
                    OrQjx:
                    foreach ($result["\151\164\145\155\163"] as $key => $item) {
                        goto qweZB;
                        kyGr0:
                        if ($csType == "\103" && array_key_exists($item["\163\143\x6f\162\145"], $scoreLevel)) {
                            $item["\163\x63\157\162\x65"] = $item["\x73\x63\x6f\x72\145"] . "\55" . $scoreLevel[$item["\163\x63\x6f\162\x65"]];
                        } else {
                            if ($csType == "\103" && empty($item["\163\143\157\162\x65"])) {
                                $item["\163\x63\x6f\162\x65"] = $item["\163\x63\x6f\x72\x65"];
                            }
                        }
                        goto XFzO2;
                        XFzO2:
                        $result["\151\164\x65\x6d\163"][$key] = $item;
                        goto YBt3u;
                        YBt3u:
                        J9lOF:
                        goto oCY1W;
                        qweZB:
                        $item["\x62\x61\x6c\141\x6e\x63\x65"] = format_amt_value($item["\142\141\x6c\141\156\x63\x65"]);
                        goto kyGr0;
                        oCY1W:
                    }
                    goto Xqi5S;
                    lJC0F:
                }
            }
        }
        goto mZaCl;
        t5toP:
        if ($csType == "\x52" && !sal_mod_active(SREP_MOD)) {
            goto ObOPB;
            ObOPB:
            $this->response->error(lang("\115\117\x44\x55\x4c\x45\137\x44\111\123\x41\x42\114\x45\104"));
            goto KLTUY;
            WZMcP:
            return false;
            goto Gs7RO;
            KLTUY:
            $this->response->write();
            goto WZMcP;
            Gs7RO:
        }
        goto aAHrT;
        zJPKj:
        switch ($csType) {
            case "\103\x53":
                $csType = array("\x43", "\x53");
                goto v27jU;
            case "\x43\x53\x42\106":
                $csType = array("\x43", "\x53", "\x42", "\106");
                goto v27jU;
            case "\x43\123\105":
                $csType = array("\x43", "\x53", "\x45");
                goto v27jU;
        }
        goto M2Qdw;
        mZaCl:
        if (!empty($data["\164\171\160\145"])) {
            goto vSa1q;
            YC35b:
            activity_log(array("\x74\111\144" => 0, "\x61\105\166\x65\x6e\x74" => '', "\141\x56\x61\154\165\x65" => $csType == "\x43" ? "\105\170\160\x6f\162\x74\145\144\40\103\x75\x73\x74\x6f\x6d\145\x72\x73" : ($csType == "\122" ? "\x45\x78\160\157\162\x74\145\144\40\x53\141\x6c\x65\x73\x20\122\x65\x70" : "\105\x78\x70\157\162\164\145\144\x20\x53\x75\160\160\x6c\151\145\162\163"), "\x74\x79\160\x65" => "\103\x54"));
            goto WZ_g1;
            L47Kn:
            $this->response->write();
            goto YC35b;
            n2QBt:
            $result["\143\x6f\155\160\x61\x6e\x79\x4e\141\x6d\x65"] = get_company("\156\141\x6d\x65");
            goto YYqVQ;
            YYqVQ:
            $data["\x66\157\x72\x6d\141\x74"] = str_replace("\x5f\144\145\x74", '', $data["\x74\x79\160\145"]);
            goto pYHEQ;
            F5qqR:
            if (file_exists($clsFile)) {
                require_once $clsFile;
            }
            goto bILYc;
            qZaxG:
            if (!empty($result["\x69\x74\x65\155\x73"])) {
                goto O9YWV;
                YDaBM:
                $result["\146\151\154\145\x5f\x6e\x61\x6d\x65"] = $isProject ? "\x50\x72\157\152\145\143\x74\x73" : "\103\157\x6e\x74\141\x63\x74\x73\137\x4c\x69\x73\164";
                goto wV_y8;
                O9YWV:
                $result["\164\151\164\154\x65"] = $data["\x68\x65\x61\144\x69\x6e\147"];
                goto YDaBM;
                wV_y8:
                $result["\x74\171\x70\145"] = "\x63\x6f\x6e\164\141\x63\164\x73\137\x73\165\155\155\141\162\x79";
                goto YON9x;
                YON9x:
                $result["\150\x65\x61\x64\151\156\147"] = $data["\150\x65\141\144"];
                goto ZF8aW;
                ZF8aW:
            }
            goto n2QBt;
            HQmU9:
            if ($exportClass) {
                goto aT1NU;
                mis2W:
                $file_name = $outputPath . DS . $fileName;
                goto hQG38;
                WbB9u:
                $exportClass->save($fileName, $outputPath, $result);
                goto mis2W;
                PwI9B:
                $outputPath = "\164\x65\x6d\160" . DS . "\x65\170\x70\x6f\162\x74" . DS . get_company("\x69\144");
                goto Tkx3z;
                Tkx3z:
                $fileName = $result["\x66\151\x6c\145\137\156\x61\x6d\145"] . "\x2e\170\x6d\x6c";
                goto WbB9u;
                dxtR6:
                $data["\146\157\162\x6d\x61\x74"] = substr($data["\146\157\162\155\x61\x74"], -3);
                goto PwI9B;
                aT1NU:
                $exportClass->setData($result);
                goto dxtR6;
                hQG38:
            } else {
                $export_type = "\160\x64\x66";
                $file_name = $this->export_file($result, $export_type);
            }
            goto EcPOc;
            EcPOc:
            $this->response->set_data("\165\162\154", $file_name);
            goto L47Kn;
            Xg3jZ:
            $clsFile = APPPATH . "\143\154\141\x73\163\x65\x73\57\x65\170\x70\157\x72\x74\57\105\x78\160\x6f\162\x74\106\141\x63\164\x6f\162\x79\x2e\x70\150\160";
            goto F5qqR;
            bILYc:
            $exportClass = ExportFactory::Export($data["\146\x69\x6c\145\x54\x79\160\x65"], $data["\146\157\162\x6d\141\164"], $data);
            goto nAA6K;
            pYHEQ:
            $data["\x66\151\x6c\145\124\171\160\145"] = "\103\157\x6e\164\141\143\x74";
            goto Xg3jZ;
            WZ_g1:
            return true;
            goto B5oKZ;
            vSa1q:
            if (get_user_data("\x72\157\x6c\145\103\x6f\144\145") != "\x41") {
                goto CIQm7;
                iKuLX:
                $this->response->write();
                goto qcsGk;
                qcsGk:
                return false;
                goto uJpGI;
                CIQm7:
                $this->response->error("\40\x59\x6f\165\40\144\157\x20\156\157\164\40\150\141\166\145\x20\x70\x65\162\155\x69\163\x73\x69\157\x6e\40\x74\x6f\x20\x61\143\143\145\x73\x73\40\x65\170\160\157\x72\164\40");
                goto iKuLX;
                uJpGI:
            }
            goto qZaxG;
            nAA6K:
            $file_name = '';
            goto HQmU9;
            B5oKZ:
        }
        goto nRBF2;
        oZioa:
        $this->response->set_data($result);
        goto LNbXX;
        M2Qdw:
        a2Nb8:
        goto MW02x;
        Xai5r:
        valid_permission(!empty($permissionArr[$csType]) ? $permissionArr[$csType] : "\115\x4e\x43\x55\123", 1);
        goto t5toP;
        eqEpq:
        $result = array();
        goto rwqUe;
        nRBF2:
        $this->response->success();
        goto g9h5F;
        hk5Vq:
        if (!$csType) {
            goto KZLMM;
            KZLMM:
            $this->response->error("\x54\x79\x70\145\x20\155\151\x73\x73\x69\156\147");
            goto xpPyd;
            xpPyd:
            $this->response->write();
            goto cf5E1;
            cf5E1:
            return false;
            goto njLBW;
            njLBW:
        }
        goto zJPKj;
        aAHrT:
        $isProject = $csType == "\x50" ? true : false;
        goto bA7WA;
        LNbXX:
        $this->response->write();
        goto WK0eV;
        rwqUe:
        if ($csType == "\120") {
            $result = $this->contactsModel->get_list_project($data);
        } else {
            $result = $this->contactsModel->get_list($csType, $data);
        }
        goto ZWkZA;
        bA7WA:
        $data = $this->request->post();
        goto hk5Vq;
        AwjPE:
    }
    public function address($conId = '')
    {
        goto Plitg;
        Plitg:
        $data = $this->request->post();
        goto sRBU6;
        ll7vt:
        $this->response->set_data($tags);
        goto H558V;
        H558V:
        $this->response->set_data($acc);
        goto OpoW3;
        sRBU6:
        if (empty($conId)) {
            goto t23we;
            t23we:
            $this->response->error("\103\x6f\x6e\164\x61\x63\164\x20\x49\x44\40\x6d\x69\163\x73\151\156\147");
            goto ZyQ3R;
            ZyQ3R:
            $this->response->write();
            goto s9NC0;
            s9NC0:
            return false;
            goto Udzzj;
            Udzzj:
        }
        goto GFWmu;
        cf4gf:
        $isPhoneCode = !empty($data["\x69\x73\x50\x68\x6f\x6e\145\x43\x6f\x64\x65"]) ? true : false;
        goto Uqbwi;
        ZsM8b:
        return true;
        goto fVvc7;
        GFWmu:
        $isProject = !empty($data["\x69\x73\x50\x72\157\x6a\145\x63\x74"]) ? true : false;
        goto cf4gf;
        NLXtX:
        $acc = $this->contactsModel->get_accounts($data);
        goto qZEYX;
        mypAa:
        if ($data["\143\x73\124\x79\160\x65"] == "\120") {
            $this->response->set_data("\x66\151\x65\154\x64\163", $fields, true);
        }
        goto ll7vt;
        yEwKh:
        $tags["\x74\141\x67\163"] = $this->contactsModel->get_contactTags($conId);
        goto NLXtX;
        Uqbwi:
        $address = $this->contactsModel->get_address($conId, '', $isProject, $isPhoneCode);
        goto YgjdX;
        qZEYX:
        $this->response->set_data("\x69\x74\145\x6d\x73", $address, true);
        goto mypAa;
        YgjdX:
        if ($data["\x63\163\124\x79\160\145"] == "\120") {
            $fields = $this->contactsModel->get_custom_fields($conId, false, $data);
        }
        goto yEwKh;
        OpoW3:
        $this->response->write();
        goto ZsM8b;
        fVvc7:
    }
    public function accounts()
    {
        goto H3CPO;
        pJcTr:
        $value = $this->contactsModel->get_accounts($data);
        goto R23qj;
        H3CPO:
        $data = $this->request->post();
        goto pJcTr;
        q5c1c:
        $this->response->write();
        goto gq3iB;
        R23qj:
        if ($value) {
            $this->response->set_data("\x69\164\x65\155\x73", $value);
        }
        goto q5c1c;
        gq3iB:
        return true;
        goto pUnNG;
        pUnNG:
    }
    public function commission($conId = '')
    {
        goto Wx9xR;
        LiScI:
        $this->response->set_data($value);
        goto EQNJS;
        CIEwf:
        $value = $this->contactsModel->get_Commission_data($conId, $data);
        goto LiScI;
        Wx9xR:
        $data = $this->request->post();
        goto MVL5N;
        MVL5N:
        if (empty($conId)) {
            goto Beg8E;
            CXpS5:
            return false;
            goto SB9Uc;
            qfESg:
            $this->response->write();
            goto CXpS5;
            Beg8E:
            $this->response->error("\x43\157\156\164\141\143\x74\40\111\104\x20\155\151\163\163\151\x6e\x67");
            goto qfESg;
            SB9Uc:
        }
        goto CIEwf;
        IGZSb:
        return true;
        goto yuZzn;
        EQNJS:
        $this->response->write();
        goto IGZSb;
        yuZzn:
    }
    public function save_contact_password()
    {
        goto JNrgM;
        JNrgM:
        $post = $this->request->post();
        goto Pe3Ji;
        rQxwD:
        $result = $this->contactsModel->save_contact_password($post);
        goto nLywE;
        MT_Sj:
        return;
        goto lg5kM;
        Pe3Ji:
        if (empty($post["\145\x6d\x61\151\154"])) {
            goto ho5HV;
            ho5HV:
            $this->response->error("\105\x6d\141\x69\154\x20\x69\144\40\x72\x65\161\x75\x69\x72\x65\144\x20\146\157\x72\x20\164\150\x65\x20\143\x6f\x6e\x74\x61\x63\x74");
            goto bGDqr;
            xwR7M:
            return;
            goto qR7ZW;
            bGDqr:
            $this->response->write();
            goto xwR7M;
            qR7ZW:
        }
        goto RqSzi;
        nLywE:
        if ($result) {
            goto BrFih;
            MltLA:
            $this->response->write();
            goto kosA1;
            oYhwC:
            $this->response->set_data("\151\144", $post["\151\144"]);
            goto MltLA;
            kosA1:
            return true;
            goto Dbjm5;
            BrFih:
            $this->response->success("\x53\125\x43\x43\x45\123\x53\137\123\x41\126\105");
            goto oYhwC;
            Dbjm5:
        } else {
            goto HAs0P;
            B20fC:
            return false;
            goto LBM_f;
            Xrbx8:
            $this->response->write();
            goto B20fC;
            HAs0P:
            $this->response->error("\x45\x72\162\x6f\x72\x20\x77\x68\151\x6c\x65\x20\163\141\166\151\156\x67");
            goto Xrbx8;
            LBM_f:
        }
        goto MT_Sj;
        RqSzi:
        if (empty($post["\x69\x64"])) {
            goto vo5I2;
            vo5I2:
            $this->response->error("\x52\x65\161\x75\151\x72\x65\x64\x20\x66\x69\154\x65\144\x73\40\x6d\x69\x73\163\151\156\147");
            goto jce2B;
            FA0qq:
            return;
            goto b2kCQ;
            jce2B:
            $this->response->write();
            goto FA0qq;
            b2kCQ:
        }
        goto rQxwD;
        lg5kM:
    }
    public function save()
    {
        goto wpeV7;
        Gi4b7:
        $isNewBLF = $isNew && ($data["\143\x73\x54\171\160\x65"] == "\102" || $data["\143\x73\124\171\x70\145"] == "\114" || $data["\143\x73\124\171\160\145"] == "\106") ? true : false;
        goto DD4n_;
        zTLgT:
        if (empty($data["\151\x73\x41\154\154\157\x77\x53\x69\155\151\x6c\x61\x72"]) && ($items = $this->contactsModel->names_validate($data))) {
            goto M8WGz;
            g2LTv:
            $this->response->write();
            goto baLmX;
            baLmX:
            return false;
            goto D0sjK;
            M8WGz:
            $this->response->set_data("\x69\x74\145\155\x73", $items);
            goto C4zcr;
            C4zcr:
            $this->response->error();
            goto g2LTv;
            D0sjK:
        }
        goto PEZgB;
        MPgIz:
        if (!empty($conId)) {
            goto b3qqx;
            y3C_B:
            return true;
            goto L4skJ;
            W7AlR:
            $this->response->set_data("\151\x64", $conId);
            goto Z3ItT;
            Z3ItT:
            $this->response->write();
            goto y3C_B;
            b3qqx:
            $this->response->success("\x53\125\x43\103\105\123\x53\137\x53\x41\x56\x45");
            goto W7AlR;
            L4skJ:
        }
        goto qO4l0;
        GHKWP:
        $this->response->error($message);
        goto n8ttV;
        WCwzK:
        if (sal_mod_active(BRANCH_MOD) && !empty($data["\143\163\x54\171\x70\145"]) && in_array($data["\x63\163\x54\171\x70\145"], array("\x42", "\114"))) {
            $this->load->model("\165\x73\145\x72\163");
            $this->users->set_company_data($this->cId);
        }
        goto MPgIz;
        QL_SL:
        if (!empty($data["\143\163\x54\171\x70\145"]) && $data["\143\163\x54\x79\160\x65"] == "\x50") {
            $error_msg = "\x50\162\157\x6a\x65\143\x74\40\156\x61\155\x65";
        }
        goto gVL8G;
        Ydwwx:
        if ($data["\143\x73\124\x79\x70\x65"] == "\x53" && get_company("\x73\150\x61\x72\145\x43\157\x6e\x62\x74\167\x42\162\141\156\143\x68\145\163") == 3) {
            if (!$this->contactsModel->uniquee_to_particularcompany($data)) {
                goto vumWc;
                V2IMk:
                return false;
                goto deCLB;
                vumWc:
                $this->response->error(lang("\123\x55\120\x50\114\x49\x45\x52\x5f\101\114\x52\105\101\104\131\137\x45\130\111\x53\x54\123"));
                goto NyLbT;
                NyLbT:
                $this->response->write();
                goto V2IMk;
                deCLB:
            }
        }
        goto VGpjl;
        p558M:
        $errors = '';
        goto k8SEA;
        itZEd:
        if (in_array($data["\143\163\124\171\x70\x65"], array("\x43", "\123", "\x52", "\x44", "\x42", "\x46", "\x4c"))) {
            valid_permission($permissionArr[$data["\x63\163\x54\x79\x70\145"]], empty($data["\x69\x64"]) ? 2 : 3);
        }
        goto CBgCB;
        KAFMv:
        if (!empty($address["\142\151\x6c\154\x69\x6e\x67"]) && !in_array($data["\143\x73\124\171\x70\145"], array("\122", "\120"))) {
            goto caix8;
            caix8:
            if (!$this->contactsModel->valid_zipCode($address["\142\x69\x6c\x6c\151\156\x67"], $data["\143\163\x54\171\x70\x65"], sal_mod_active("\x45\x42") ? true : false)) {
                goto U3dZD;
                weFBp:
                $this->response->write();
                goto ryVvp;
                U3dZD:
                $this->response->error(sprintf(lang("\x43\117\x4e\x54\x41\103\x54\137\132\111\120\x5f\x45\x52\x52\x4f\122"), "\x62\x69\x6c\x6c\151\x6e\147"));
                goto weFBp;
                ryVvp:
                return false;
                goto J3Asr;
                J3Asr:
            }
            goto h5VO5;
            h5VO5:
            $address["\142\x69\154\154\151\x6e\147"]["\164\141\x78\116\157"] = !empty($address["\142\x69\x6c\x6c\151\x6e\x67"]["\x74\141\x78\x4e\157"]) ? $address["\142\151\154\154\151\x6e\x67"]["\164\x61\x78\x4e\x6f"] : (!empty($data["\x74\141\x78\116\x6f"]) ? $data["\x74\x61\x78\x4e\x6f"] : '');
            goto K6gEm;
            K6gEm:
            if (!$this->contactsModel->valid_gstn_state($address["\x62\151\154\x6c\151\156\x67"])) {
                goto zsUWs;
                wIvIX:
                return false;
                goto TEf1k;
                T32oq:
                $this->response->write();
                goto wIvIX;
                zsUWs:
                $this->response->error(lang("\x53\124\101\124\x45\x5f\x4d\111\x53\x4d\x41\124\x43\110"));
                goto T32oq;
                TEf1k:
            }
            goto f5mMk;
            f5mMk:
        }
        goto p558M;
        VGpjl:
        if ($this->form_validation->run() == FALSE) {
            goto tMOnT;
            tMOnT:
            $this->response->error(validation_errors());
            goto H6Run;
            os1Hz:
            return false;
            goto gMARN;
            H6Run:
            $this->response->write();
            goto os1Hz;
            gMARN:
        }
        goto zTLgT;
        CBgCB:
        $this->load->library("\x66\157\162\155\137\166\141\x6c\151\144\x61\x74\x69\157\x6e");
        goto Ai22N;
        ueoxx:
        $isNew = empty($data["\151\x64"]) ? true : false;
        goto Gi4b7;
        LsBEq:
        $permissionArr = array("\103" => "\115\x4e\103\125\x53", "\123" => "\115\116\123\125\120", "\x52" => "\115\x4e\x53\101\x52", "\102" => "\x4d\116\103\x55\123", "\x4c" => "\115\116\x43\x55\123", "\104" => "\x4d\x4e\x52\102\x59", "\106" => "\x4d\x4e\x43\x55\x53", "\120" => "\x50\122\117");
        goto itZEd;
        Ai22N:
        $error_msg = "\103\x6f\x6e\164\141\143\164\x20\144\151\163\x70\x6c\141\171\x20\x6e\141\x6d\x65";
        goto QL_SL;
        PEZgB:
        if (!empty($data["\164\x61\170\116\x6f"])) {
            if (get_company("\143\157\165\156\164\x72\x79\103\x6f\144\145") == "\111\x4e" && sal_mod_active(BRANCH_MOD) && in_array($data["\x63\x73\x54\x79\160\145"], array("\102", "\x4c"))) {
                if (!$this->contactsModel->valid_branch_taxNo($data)) {
                    goto BR3Xd;
                    F3Z81:
                    return false;
                    goto cCfN7;
                    H6ji2:
                    $this->response->write();
                    goto F3Z81;
                    BR3Xd:
                    $this->response->error($this->contactsModel->message);
                    goto H6ji2;
                    cCfN7:
                }
            } else {
                if (!$this->contactsModel->unique_taxNo($data) && empty($data["\x61\154\x6c\157\167\x5f\144\x75\160\x6c\151\x63\141\x74\x65"])) {
                    goto aUOzO;
                    OiEe3:
                    $this->response->write();
                    goto G7rZN;
                    G7rZN:
                    return false;
                    goto x3jyq;
                    aUOzO:
                    if ($data["\143\x73\x54\x79\160\x65"] != "\106") {
                        $this->response->error();
                        $this->response->set_data("\x64\165\160\137\143\x6f\x6e\146\x69\162\155", 1);
                    } else {
                        $this->response->error(lang("\x54\x41\130\x4e\117\x5f\x41\x4c\x52\105\x41\x44\x59\x5f\105\x58\111\x53\124\123"));
                    }
                    goto OiEe3;
                    x3jyq:
                }
            }
        }
        goto RBfsa;
        n8ttV:
        $this->response->write();
        goto OrsPT;
        TL1xq:
        if ($this->contactsModel->message) {
            $message = $this->contactsModel->message;
        }
        goto GHKWP;
        k8SEA:
        if (!$same && !empty($address["\x73\x68\151\x70\160\151\x6e\x67"])) {
            goto zpwSC;
            GcX3H:
            syYpy:
            goto u3239;
            u3239:
            if (!empty($errors)) {
                goto jAq9s;
                jAq9s:
                $this->response->error($errors);
                goto ipnQV;
                ipnQV:
                $this->response->write();
                goto oS9fj;
                oS9fj:
                return false;
                goto ZllEB;
                ZllEB:
            }
            goto J7fST;
            zpwSC:
            $tmp_addr = !empty($address["\x69\x73\155\165\154\x74\151\163\x68\151\x70"]) ? $address["\163\x68\151\x70\160\151\x6e\x67"] : array($address["\x73\x68\151\160\x70\x69\156\147"]);
            goto bpwWK;
            bpwWK:
            foreach ($tmp_addr as $key => $val) {
                if (!$this->contactsModel->valid_zipCode($val, $data["\143\163\124\x79\160\x65"], sal_mod_active("\105\x42") ? true : false)) {
                    $errors .= sprintf(lang("\x53\110\x49\120\137\x5a\111\x50\137\x45\x52\x52\x4f\122"), $val["\x6e\141\x6d\145"]) . "\x3c\142\162\57\76";
                }
                RntTH:
            }
            goto GcX3H;
            J7fST:
        }
        goto rGP47;
        oFNSE:
        if (!($data["\143\163\124\171\x70\145"] == "\123" && get_company("\163\150\141\162\145\x43\x6f\156\142\164\x77\x42\x72\x61\156\x63\x68\145\163") == 3)) {
            $this->form_validation->set_rules("\x6e\141\x6d\x65", $error_msg, "\x74\x72\151\155\174\x72\x65\161\x75\151\162\x65\144\x7c\x75\x6e\151\x71\x75\145\145\x5f\x74\x6f\137\143\x6f\x6d\160\x61\156\x79\x5b\143\x6f\x6e\x74\x61\143\x74\x73\x2e\156\x61\155\x65\135");
        }
        goto Ydwwx;
        DD4n_:
        $address = $data["\x61\x64\144\x72\145\x73\x73"];
        goto ODlHS;
        qO4l0:
        $message = lang("\x43\x4f\x4e\x54\101\103\124\x5f\123\x41\126\105\137\x45\x52\122\x4f\122");
        goto TL1xq;
        wpeV7:
        $_POST = $data = $this->request->post();
        goto z26WO;
        rGP47:
        $conId = $this->contactsModel->save($data);
        goto WCwzK;
        gVL8G:
        $this->form_validation->set_rules("\x6e\x61\x6d\145", $error_msg, "\164\x72\x69\x6d\174\162\145\x71\x75\151\x72\x65\144");
        goto WuoEI;
        WuoEI:
        if (!empty($data["\x63\x73\124\x79\160\x65"]) && $data["\143\x73\x54\171\x70\x65"] == "\x53" && get_company("\151\163\x46\162\x61\x6e\143\150\x69\x73\x65")) {
            if (!$this->contactsModel->uniquee_to_franchise($data)) {
                goto W6U7T;
                T5SPg:
                return false;
                goto QXmW4;
                W6U7T:
                $this->response->error(lang("\x53\125\x50\120\x4c\x49\x45\x52\x5f\x41\x4c\122\105\101\x44\131\137\105\130\x49\123\x54\123"));
                goto zRSv8;
                zRSv8:
                $this->response->write();
                goto T5SPg;
                QXmW4:
            }
        }
        goto oFNSE;
        RBfsa:
        if (!empty($data["\x63\x6f\x6e\x74\141\x63\x74\120\145\x72\163\x6f\x6e\x4d\x6f\142\151\x6c\x65"]) && !$this->contactsModel->unique_mobile($data) && empty($data["\x61\154\154\157\167\x5f\160\x68\157\156\145\x5f\144\x75\x70\x6c\x69\x63\x61\x74\145"])) {
            goto YsCVZ;
            dF6Pz:
            $this->response->set_data("\x64\165\160\137\160\x68\x6f\x6e\x65\x5f\143\157\x6e\x66\x69\x72\155", 1);
            goto QuNlm;
            JH_o6:
            return false;
            goto oJGnA;
            YsCVZ:
            $this->response->error();
            goto dF6Pz;
            QuNlm:
            $this->response->write();
            goto JH_o6;
            oJGnA:
        }
        goto ueoxx;
        OrsPT:
        return false;
        goto Qp9R_;
        z26WO:
        if (!empty($data["\x69\144"]) && $data["\143\163\x54\171\x70\x65"] == "\102" && $data["\151\144"] == get_company("\x6d\141\x69\156\142\x49\x64")) {
            goto JmRlB;
            Im5ky:
            $this->response->write();
            goto Vovnx;
            Vovnx:
            return false;
            goto cX5Jy;
            JmRlB:
            $this->response->error(lang("\115\x41\x49\116\x5f\102\x52\x41\x4e\x43\110\x5f\x52\105\123\x54\x52\111\103\x54\105\104"));
            goto Im5ky;
            cX5Jy:
        }
        goto LsBEq;
        ODlHS:
        $same = !empty($address["\163\x61\x6d\145\137\141\x73\137\x62\151\x6c\x6c"]) ? $address["\x73\141\x6d\x65\137\141\x73\137\x62\x69\154\x6c"] : false;
        goto KAFMv;
        Qp9R_:
    }
    public function download($id = 0, $isPreview = 0)
    {
        goto vZEgS;
        Ztl0y:
        $this->_trigger_download($data["\x66\x69\x6c\x65\x50\141\164\150"], $data["\x66\x69\154\x65\x4e\x61\155\145"], $isPreview);
        goto jETXR;
        vZEgS:
        $data = $this->contactsModel->get_file($id);
        goto C8h6i;
        C8h6i:
        if (empty($data)) {
            return;
        }
        goto Ztl0y;
        jETXR:
    }
    private function _trigger_download($filePath = '', $fileName = '', $isPreview = 0)
    {
        goto mJHEA;
        iEd63:
        $filePath = FCPATH . $filePath;
        goto pzBU6;
        zd_uy:
        return true;
        goto rpSl0;
        mJHEA:
        if (defined("\125\x53\105\x5f\101\x57\123\137\123\63") && USE_AWS_S3) {
            goto HTEJH;
            XEiTe:
            header("\x43\157\156\164\x65\x6e\x74\55\x54\162\141\x6e\163\146\145\162\55\x45\156\143\x6f\144\151\156\147\x3a\40\x62\151\156\141\x72\171");
            goto cvNCv;
            bEVrx:
            if (!$isPreview) {
                header("\x43\x6f\x6e\x74\145\x6e\164\x2d\104\151\163\x70\x6f\163\151\164\x69\157\x6e\x3a\40\141\164\164\141\143\x68\155\145\156\164\x3b\40\146\x69\154\x65\156\x61\155\x65\75\42" . $fileName . "\x22");
            }
            goto aD0ly;
            nvILb:
            header("\103\157\156\x74\145\x6e\164\55\124\171\160\x65\x3a\x20{$result["\x43\157\156\x74\145\x6e\x74\124\x79\160\145"]}");
            goto bEVrx;
            HTEJH:
            $result = get_from_s3($filePath);
            goto nvILb;
            PDyPz:
            echo $result["\102\157\144\x79"];
            goto i5Z4V;
            aD0ly:
            header("\105\x78\x70\x69\162\145\x73\x3a\x20\60");
            goto XEiTe;
            i5Z4V:
            return true;
            goto jMUhw;
            cvNCv:
            header("\x43\x61\143\x68\145\55\103\x6f\156\x74\x72\157\154\x3a\x20\x70\162\x69\x76\x61\164\145\54\x20\x6e\x6f\55\x74\x72\141\x6e\x73\x66\x6f\162\155\x2c\40\x6e\157\55\x73\164\157\162\x65\54\x20\x6d\165\x73\164\x2d\162\145\166\141\154\151\144\141\164\145");
            goto PDyPz;
            jMUhw:
        }
        goto SLeJ5;
        UD4S3:
        force_download($filePath, null, true, $fileName, $isPreview ? false : true);
        goto zd_uy;
        SLeJ5:
        $this->load->helper("\x64\x6f\x77\x6e\x6c\x6f\x61\x64");
        goto iEd63;
        pzBU6:
        if (strtoupper(substr(PHP_OS, 0, 3)) === "\x57\111\116") {
            $filePath = str_replace("\57", "\134", $filePath);
        }
        goto UD4S3;
        rpSl0:
    }
    public function details($conId, $noAddress = 0)
    {
        goto WOS3a;
        dBL2P:
        if ($this->contactsModel->message) {
            $message = $this->contactsModel->message;
        }
        goto r8jju;
        VGaMl:
        $this->response->write();
        goto cz_Hz;
        cz_Hz:
        return true;
        goto fzYEF;
        r8jju:
        if ($result) {
            $this->response->success($message);
        } else {
            $this->response->error($message);
        }
        goto jK2hB;
        pElTi:
        if (!empty($data["\x63\163\124\171\160\x65"])) {
            valid_permission($permissionArr[$data["\143\163\x54\x79\x70\145"]], empty($data["\x69\x64"]) ? 2 : 3);
        }
        goto NpogQ;
        NpogQ:
        $result = $this->contactsModel->get_details($conId, $data);
        goto HYaLq;
        HYaLq:
        $message = '';
        goto dBL2P;
        jK2hB:
        if (!empty($result)) {
            $this->response->set_data($result);
        }
        goto VGaMl;
        KBGMa:
        $permissionArr = array("\103" => "\x4d\x4e\103\x55\x53", "\123" => "\115\x4e\123\x55\120", "\x52" => "\115\116\123\101\122", "\x42" => "\115\116\103\125\x53", "\x4c" => "\x4d\116\x43\125\123", "\x44" => "\115\116\x52\102\131", "\106" => "\x4d\x4e\x43\x55\x53", "\x50" => "\120\x52\x4f");
        goto pElTi;
        WOS3a:
        $data = $this->request->post();
        goto KBGMa;
        fzYEF:
    }
    public function trans($tType, $conId, $noAddress = 0)
    {
        goto a15h3;
        a15h3:
        $data = $this->request->post();
        goto DRxKx;
        G2vjo:
        $result = $this->contactsModel->get_conTrans_details($tType, $conId, $data);
        goto BaTQz;
        cIJSl:
        $this->response->write();
        goto WNZK4;
        emIUx:
        if ($this->contactsModel->message) {
            $message = $this->contactsModel->message;
        }
        goto AH3Nu;
        BaTQz:
        $message = '';
        goto emIUx;
        DRxKx:
        if (!isset($conId)) {
            goto MIGCM;
            MIGCM:
            $this->response->error("\103\157\x6e\164\141\x63\164\40\x49\104\x20\x6d\x69\163\x73\x69\156\147");
            goto tKuek;
            jTzM8:
            return false;
            goto XopQ7;
            tKuek:
            $this->response->write();
            goto jTzM8;
            XopQ7:
        }
        goto G2vjo;
        WNZK4:
        return true;
        goto E40hr;
        AH3Nu:
        if (!empty($result)) {
            goto S2ubl;
            fttCC:
            $ignoreTodayTrans = isset($data["\151\163\x46\x72\x6f\155\x49\156\x76\157\x69\143\145"]) && !empty($data["\x69\163\106\162\157\x6d\111\x6e\x76\x6f\x69\143\x65"]);
            goto MnWYD;
            MnWYD:
            $return_items = $this->contactsModel->get_return_items($tType, $result["\143\157\x6e\x74\x61\x63\164"], $ignoreTodayTrans);
            goto gWM7z;
            exvfu:
            if (!empty($tType) && $tType == "\x47\122" && !empty($return_items) && !empty($conId)) {
                $reference = $this->contactsModel->get_return_items_reference($conId);
                if ($reference) {
                    $this->response->set_data("\x72\145\146\x65\x72\x65\156\143\145", $reference, true);
                }
            }
            goto Ar2y1;
            xwd5n:
            if (!empty($result)) {
                $this->response->set_data($result);
            }
            goto fttCC;
            gWM7z:
            if ($return_items) {
                $this->response->set_data("\162\x65\x74\165\162\x6e\137\x69\164\145\155\163", $return_items, true);
            }
            goto exvfu;
            dm020:
            if (strpos($modCodes, "\x50\116\x54") !== FALSE) {
                goto gwJWN;
                qBd52:
                $points = $this->pointsModel->getContactPoints(array_merge($data, array("\x74\x54\171\x70\x65" => $tType, "\143\x6f\156\111\144" => $conId)));
                goto iJyhj;
                iJyhj:
                if (!empty($points)) {
                    $this->response->set_data("\160\x6f\151\x6e\x74\x73", $points);
                }
                goto NWme7;
                gwJWN:
                $this->load->model("\x70\157\x69\x6e\164\163\x2f\160\157\151\x6e\164\163\x4d\157\x64\145\x6c");
                goto qBd52;
                NWme7:
            }
            goto wWkLO;
            S2ubl:
            $this->response->success($message);
            goto xwd5n;
            Ar2y1:
            $modCodes = get_company("\163\141\154\115\x6f\144\x43\x6f\144\x65\x73");
            goto dm020;
            wWkLO:
        } else {
            goto b911u;
            x1xrF:
            return false;
            goto xfX5q;
            v55Z1:
            $this->response->write();
            goto x1xrF;
            b911u:
            $this->response->error($message);
            goto v55Z1;
            xfX5q:
        }
        goto cIJSl;
        E40hr:
    }
    public function salesrep($conId)
    {
        goto wQuU6;
        kJa3f:
        return true;
        goto jztu4;
        ZuBT8:
        $this->response->write();
        goto kJa3f;
        VC3Q0:
        if (!empty($result)) {
            $this->response->set_data("\143\x6f\156\x74\141\x63\164", $result);
        }
        goto nGFEI;
        SsrX7:
        if (!empty($user)) {
            $this->response->set_data("\165\x73\145\162", $user);
        }
        goto ZuBT8;
        Nvjn9:
        $user = $this->users->get_user(0, array("\x75\x2e\x63\x6f\x6e\111\144" => $conId));
        goto SsrX7;
        wQuU6:
        $result = $this->contactsModel->salesrep_details($conId);
        goto VC3Q0;
        nGFEI:
        $this->load->model("\165\163\145\x72\163");
        goto Nvjn9;
        jztu4:
    }
    public function credits($tType, $conId, $transId = 0)
    {
        goto thlkB;
        HO0Zq:
        $credits = $this->contactsModel->contact_credit($tType, $conId, $transId, false, $dueAmount);
        goto ge0cz;
        thlkB:
        $dueAmount = 0;
        goto L1bCr;
        qRfQo:
        if (in_array($tType, array(JOURNAL_VOUCHER, JOURNAL_CONTRA))) {
            $payments = $this->contactsModel->get_allot_payments($transId);
            $this->response->set_data("\164\x72\141\x6e\x73\137\x70\x61\x79\x6d\145\x6e\x74\163", $payments, true);
        }
        goto r7D8B;
        r7D8B:
        $this->response->write();
        goto h_3sQ;
        ge0cz:
        $message = '';
        goto npOLs;
        h_3sQ:
        return true;
        goto miiwu;
        Ep49I:
        $this->response->success($message);
        goto OI6i6;
        npOLs:
        if ($this->contactsModel->message) {
            $message = $this->contactsModel->message;
        }
        goto Ep49I;
        OI6i6:
        if (!empty($credits)) {
            $this->response->set_data("\x69\164\x65\155\x73", $credits, true);
        }
        goto qRfQo;
        vlhBz:
        if (empty($conId)) {
            goto JptUG;
            JptUG:
            $this->response->error("\103\x6f\x6e\x74\141\x63\x74\x20\111\x44\40\x6d\x69\x73\x73\151\x6e\147");
            goto OX07q;
            OX07q:
            $this->response->write();
            goto R_OSp;
            R_OSp:
            return false;
            goto qc0Rh;
            qc0Rh:
        }
        goto HO0Zq;
        L1bCr:
        if ($tType == JOURNAL_VOUCHER) {
            $contacts = $this->contactsModel->get_journal_trans_due($transId, $conId);
            if ($contacts) {
                goto hlMaP;
                axFh6:
                $this->response->set_data("\143\x6f\156\111\144", $conId);
                goto rTrRg;
                rTrRg:
                $this->response->set_data("\x64\165\x65\x41\155\x6f\x75\156\x74", $dueAmount);
                goto SQvO2;
                hlMaP:
                foreach ($contacts as $row) {
                    if ($row["\x63\157\156\111\x64"] == $conId || !$conId) {
                        goto xIB4X;
                        kqqhR:
                        $dueAmount = !empty($row["\144\165\x65\x41\155\x6f\165\x6e\164"]) ? $row["\x64\165\145\101\x6d\157\165\x6e\164"] : 0;
                        goto I3U3v;
                        I3U3v:
                        goto Puy8P;
                        goto qjnYJ;
                        xIB4X:
                        $conId = !empty($row["\143\157\156\111\x64"]) ? $row["\x63\157\156\111\x64"] : 0;
                        goto kqqhR;
                        qjnYJ:
                    }
                    UT2qG:
                }
                goto ZqFPR;
                ZqFPR:
                Puy8P:
                goto axFh6;
                SQvO2:
                $this->response->set_data("\x63\157\x6e\x74\x61\143\164\163", $contacts);
                goto NHgPT;
                NHgPT:
            }
        }
        goto vlhBz;
        miiwu:
    }
    public function search($type = "\x43", $q = '')
    {
        goto Sn_x1;
        UiWv6:
        $customer = $this->contactsModel->customer_search($data);
        goto r1DYl;
        Sn_x1:
        $data = $this->request->post();
        goto Dn0Z6;
        Dn0Z6:
        if (!empty($q)) {
            $data = array_merge(array("\x73\x74\162" => $q, "\164\x79\x70\x65" => $type, "\x70\141\x67\x65" => 1, "\151\163\104\x65\164\x61\151\154" => true, "\x69\x73\101\x6c\154\x53\145\x61\x72\143\150" => true), $data);
        }
        goto UiWv6;
        RLTq9:
        $this->response->write();
        goto e8fJV;
        bKgUB:
        if (!empty($customer)) {
            $this->response->set_data("\151\164\x65\155\x73", $customer);
        }
        goto RLTq9;
        r1DYl:
        $this->response->success();
        goto bKgUB;
        e8fJV:
        return true;
        goto haRyu;
        haRyu:
    }
    public function city($q = '', $stateCode = '')
    {
        goto ic8AV;
        sizHh:
        $this->response->write();
        goto WThld;
        nxnWL:
        $this->response->success();
        goto zXymF;
        zXymF:
        if (!empty($city)) {
            $this->response->set_data("\x69\164\145\x6d\x73", $city);
        }
        goto sizHh;
        WThld:
        return true;
        goto LJfPx;
        ic8AV:
        $city = $this->contactsModel->city_search($q, $stateCode);
        goto nxnWL;
        LJfPx:
    }
    public function detailed_search($type = "\103", $isArchived = 0, $q = '')
    {
        goto QSA2X;
        A7rEx:
        $this->response->write();
        goto QEAmg;
        QSA2X:
        $customer = $this->contactsModel->customer_search(array("\163\164\x72" => $q, "\x74\x79\x70\145" => $type, "\x70\x61\147\x65" => 1, "\x69\163\x44\145\x74\141\x69\x6c" => true, "\151\x73\x41\162\143\x68\x69\166\x65\x64" => $isArchived, "\151\x73\x41\x6c\x6c\x53\145\x61\x72\x63\x68" => true));
        goto sPXg6;
        QEAmg:
        return true;
        goto rxiw6;
        sPXg6:
        $this->response->success();
        goto b6oFJ;
        b6oFJ:
        if (!empty($customer)) {
            $this->response->set_data("\x69\x74\x65\x6d\x73", $customer);
        }
        goto A7rEx;
        rxiw6:
    }
    public function search2($type = "\x41", $q = '', $page = 1)
    {
        goto ytySA;
        zzrfS:
        return true;
        goto FtuYf;
        ci_4x:
        $this->response->success();
        goto ol6s6;
        ol6s6:
        if (!empty($customer)) {
            $this->response->set_data("\151\164\x65\x6d\x73", $customer);
        }
        goto S5TYc;
        QALHV:
        if (empty($data["\144\x69\163\x70\x6c\141\171"])) {
            $customer = $this->contactsModel->customer_search(array("\163\164\x72" => $q, "\164\x79\160\x65" => $type, "\x70\x61\x67\145" => $page));
        } else {
            $customer = $this->contactsModel->customer_search(array("\163\x74\162" => $q, "\x74\171\160\x65" => $type, "\x70\x61\x67\145" => $page, "\151\163\x44\145\x74\141\151\x6c" => false, "\x69\163\101\162\x63\x68\151\166\145\x64" => false, "\151\x73\101\154\x6c\x53\145\x61\162\x63\x68" => false, "\141\154\x6c" => true));
        }
        goto ci_4x;
        ytySA:
        $data = $this->request->post();
        goto QALHV;
        S5TYc:
        $this->response->write();
        goto zzrfS;
        FtuYf:
    }
    function restore($id = '')
    {
        goto A37qR;
        jeh8L:
        if ($ret === true) {
            goto AAQct;
            odozi:
            $this->response->write();
            goto lmr4m;
            AAQct:
            $this->response->success("\x52\105\123\124\117\x52\x45\137\x53\x55\103\x43\x45\x53\123");
            goto odozi;
            lmr4m:
            return true;
            goto nqjd9;
            nqjd9:
        } else {
            goto KcKlZ;
            C0txX:
            if ($ret) {
                $this->response->set_data("\x64\141\164\141", $ret);
            }
            goto dAmu_;
            KcKlZ:
            $this->response->error($this->contactsModel->message);
            goto C0txX;
            dAmu_:
            $this->response->write();
            goto LzE1J;
            LzE1J:
            return false;
            goto TcNTG;
            TcNTG:
        }
        goto QEQSN;
        A37qR:
        if (empty($id)) {
            goto FwS8b;
            WOz52:
            $this->response->write();
            goto mBE95;
            mBE95:
            return false;
            goto R7A6z;
            FwS8b:
            $this->response->error("\111\144\x20\x4d\151\x73\x73\151\156\x67\x2e");
            goto WOz52;
            R7A6z:
        }
        goto fEUwQ;
        fEUwQ:
        $ret = $this->contactsModel->restore($id);
        goto jeh8L;
        QEQSN:
    }
    function delete($id = '')
    {
        goto hnjlm;
        ylluM:
        valid_permission($permissionArr[$data["\x63\163\124\171\x70\x65"]], 4);
        goto p1_99;
        hnjlm:
        $data = $this->request->post();
        goto Lzr3L;
        tFc73:
        $ret = $this->contactsModel->delete($id);
        goto t3jF1;
        Lzr3L:
        $permissionArr = array("\103" => "\x4d\116\x43\x55\123", "\123" => "\115\x4e\123\125\120", "\122" => "\x4d\x4e\x53\101\x52", "\102" => "\x4d\x4e\x43\x55\x53", "\114" => "\115\x4e\x43\x55\x53", "\x44" => "\x4d\x4e\122\102\131", "\x46" => "\115\116\x43\x55\x53", "\120" => "\x50\122\x4f");
        goto ylluM;
        p1_99:
        if (empty($id)) {
            goto UyDl_;
            UyDl_:
            $this->response->error("\x49\x64\40\115\x69\163\x73\x69\156\x67\56");
            goto O4zo4;
            O4zo4:
            $this->response->write();
            goto WJfI1;
            WJfI1:
            return false;
            goto oZhGK;
            oZhGK:
        }
        goto tFc73;
        t3jF1:
        if ($ret === true) {
            goto VDyMd;
            dYZ7Z:
            return true;
            goto NZDR_;
            U8aTB:
            $this->response->write();
            goto dYZ7Z;
            VDyMd:
            $this->response->success("\x44\x45\114\105\x54\105\x5f\123\125\x43\103\105\123\x53");
            goto U8aTB;
            NZDR_:
        } else {
            goto AYjp7;
            rLqpX:
            return false;
            goto SvALp;
            wNFmt:
            if ($ret) {
                $this->response->set_data("\x64\141\164\x61", $ret);
            }
            goto wdWpO;
            wdWpO:
            $this->response->write();
            goto rLqpX;
            AYjp7:
            $this->response->error($this->contactsModel->message);
            goto wNFmt;
            SvALp:
        }
        goto qvvSN;
        qvvSN:
    }
    function export($type = "\x41", $format = "\143\163\166")
    {
        goto v2vzb;
        LEkFJ:
        $result = $this->contactsModel->get_contacts($type);
        goto LG2B4;
        bdNUm:
        return true;
        goto WYtnB;
        UbVPE:
        if (!empty($format) && $format == "\x78\x6c\163") {
            goto nokIE;
            nokIE:
            $content = implode("\11", array_values($head)) . "\xa";
            goto qPQKX;
            yJh1y:
            lg2zy:
            goto yrWIZ;
            qPQKX:
            foreach ($result as $key => $row) {
                goto nJ_1v;
                Ik7P4:
                $rowData = '';
                goto HyZEn;
                b4kTw:
                uU4MT:
                goto ykQdb;
                nJ_1v:
                $tmp = array();
                goto Ik7P4;
                DjsCS:
                $content .= trim($rowData) . "\xa";
                goto b4kTw;
                HyZEn:
                foreach ($head as $val) {
                    goto PR6JU;
                    voLyg:
                    $rowData .= $tmp[$val];
                    goto ZKS6o;
                    ZKS6o:
                    mWOfa:
                    goto IA9iy;
                    PR6JU:
                    $row[$val] = !empty($row[$val]) ? $row[$val] : '';
                    goto pVruA;
                    pVruA:
                    $tmp[$val] = "\x22" . $row[$val] . "\x22" . "\11";
                    goto voLyg;
                    IA9iy:
                }
                goto NmkPe;
                NmkPe:
                Shykj:
                goto DjsCS;
                ykQdb:
            }
            goto yJh1y;
            yrWIZ:
        } else {
            goto QdPup;
            gcT_G:
            DawFy:
            goto GkBtk;
            QdPup:
            $content = implode("\x2c", $head) . "\xa";
            goto RUhos;
            RUhos:
            foreach ($result as $key => $row) {
                goto lnUfB;
                qB9N1:
                zXNcK:
                goto MUzlS;
                tX3As:
                foreach ($head as $val) {
                    $tmp[$val] = isset($row[$val]) ? $row[$val] : '';
                    MY6tg:
                }
                goto OG3nZ;
                OG3nZ:
                u2jsI:
                goto O7xmz;
                lnUfB:
                $tmp = array();
                goto tX3As;
                O7xmz:
                $content .= "\42" . implode("\42\x2c\42", array_values($tmp)) . "\x22" . "\xa";
                goto qB9N1;
                MUzlS:
            }
            goto gcT_G;
            GkBtk:
        }
        goto X6Z_l;
        DjrE4:
        $file_path .= DS . $contacts . time() . $ext;
        goto yzVQF;
        n2iBx:
        $ext = $format == "\143\163\166" ? "\x2e\143\x73\166" : "\56\170\x6c\163";
        goto DjrE4;
        yzVQF:
        $this->load->helper("\x64\x6f\167\156\x6c\x6f\141\x64");
        goto cucOj;
        k5Ve1:
        $permissionArr = array("\103" => "\x4d\x4e\x43\125\x53", "\105" => "\x4d\x4e\103\125\x53", "\x45\x43" => "\115\x4e\103\125\123", "\x53" => "\115\116\123\x55\x50", "\x52" => "\x4d\116\x53\101\122", "\x42" => "\x4d\x4e\x43\125\123", "\x4c" => "\x4d\116\103\x55\123", "\104" => "\x4d\116\122\102\131", "\x46" => "\x4d\116\x43\125\123", "\120" => "\120\x52\x4f");
        goto ws1hI;
        cucOj:
        force_download($file_path, $content);
        goto OQvi1;
        fVJla:
        ini_set("\155\145\x6d\x6f\x72\171\137\x6c\x69\x6d\151\164", "\x2d\61");
        goto k5Ve1;
        ws1hI:
        valid_permission($permissionArr[$type], 4);
        goto psqMA;
        X6Z_l:
        $file_path = "\164\145\x6d\x70" . DS . "\145\170\160\x6f\x72\x74" . DS . get_company("\151\x64");
        goto dvksN;
        v2vzb:
        if (get_user_data("\x72\x6f\154\x65\x43\x6f\144\x65") != "\x41") {
            goto vEVhx;
            vEVhx:
            $this->response->error("\x20\x59\x6f\x75\40\144\x6f\40\156\x6f\164\40\150\x61\x76\145\40\x70\x65\x72\155\x69\x73\x73\x69\x6f\156\40\x74\157\x20\x61\x63\143\x65\x73\x73\40\145\x78\x70\x6f\162\164\40");
            goto mtskm;
            mtskm:
            $this->response->write();
            goto GGh42;
            GGh42:
            return false;
            goto K_4Dz;
            K_4Dz:
        }
        goto BWruV;
        dvksN:
        if (!is_dir($file_path)) {
            mkdir($file_path, 0755, TRUE);
        }
        goto qdK5w;
        qdK5w:
        $contacts = $type == "\x43" ? "\143\165\x73\x74\x6f\155\145\162" : ($type == "\x50" ? "\x70\x72\157\152\x65\143\164" : "\x73\x75\160\160\154\x69\145\x72");
        goto n2iBx;
        OQvi1:
        activity_log(array("\164\111\144" => 0, "\x61\x45\x76\x65\156\164" => '', "\141\x56\x61\x6c\165\145" => $type == "\x43" ? "\105\x78\160\x6f\x72\x74\x65\144\x20\103\165\x73\164\x6f\155\x65\x72\x73" : ($type == "\x52" ? "\x45\x78\x70\157\x72\164\145\144\40\123\x61\x6c\145\x73\x20\122\x65\160" : "\x45\170\x70\x6f\162\164\145\144\x20\x53\165\x70\x70\154\151\145\x72\163"), "\x74\x79\x70\x65" => "\x43\x54"));
        goto bdNUm;
        BWruV:
        ini_set("\x6d\141\x78\x5f\145\170\145\143\165\164\151\x6f\x6e\137\x74\x69\x6d\145", 0);
        goto fVJla;
        LG2B4:
        $head = array_keys($result[0]);
        goto UbVPE;
        psqMA:
        $content = '';
        goto LEkFJ;
        WYtnB:
    }
    function import($csType = "\103", $overwrite = false, $isxml = 0)
    {
        goto euV6Q;
        IqPDw:
        $this->response->success(lang("\x53\x55\103\x43\105\x53\x53\137\111\115\120\x4f\122\124"));
        goto rSmUq;
        WMXZl:
        if ($isxml) {
            $params["\170\155\x6c\137\151\155\160\x6f\162\x74"] = $params["\146\151\154\x65\137\x64\141\164\x61"];
            unset($params["\146\x69\x6c\x65\137\x64\x61\x74\141"]);
        }
        goto SZEBF;
        kRwxx:
        if (!empty($import["\151\x6e\x76\x61\154\151\x64\163\x77\151\164\143\150\x63\157\x6e\x74\x61\143\x74"])) {
            goto hYsrG;
            hYsrG:
            $this->response->error(implode("\54", $import["\151\x6e\x76\141\x6c\151\x64\x73\x77\x69\164\143\x68\143\x6f\x6e\x74\x61\x63\x74"]) . "\x43\157\x6e\x74\x61\x63\164\x73\40\x63\141\x6e\x6e\x6f\x74\x20\142\x65\x20\x73\x77\151\x74\143\x68\145\144\41");
            goto H5U5C;
            w1AW8:
            return false;
            goto q4lWh;
            H5U5C:
            $this->response->write();
            goto w1AW8;
            q4lWh:
        }
        goto XrGe9;
        v46dy:
        $permissionArr = array("\103" => "\x4d\x4e\103\x55\123", "\123" => "\x4d\x4e\123\x55\x50", "\x52" => "\x4d\x4e\123\101\x52", "\x42" => "\115\116\103\125\123", "\x4c" => "\115\x4e\103\125\x53", "\104" => "\x4d\116\122\x42\x59", "\x46" => "\x4d\116\103\x55\123", "\x50" => "\x50\x52\x4f");
        goto bN09r;
        HccxG:
        if (!empty($import["\151\156\x76\x61\x6c\x69\x64\x47\x73\164\x43\x6e\164"])) {
            goto xlC6T;
            xlC6T:
            $this->response->error(implode("\x2c", $import["\151\x6e\x76\x61\154\x69\x64\107\163\x74\103\x6e\x74"]) . "\x20\x63\x6f\x6e\x74\x61\151\156\x73\x20\151\156\x76\x61\x6c\x69\x64\40\147\163\x74\x69\x6e\40\162\145\x63\157\162\144");
            goto fh4bG;
            CtWwt:
            return false;
            goto FFYK1;
            fh4bG:
            $this->response->write();
            goto CtWwt;
            FFYK1:
        }
        goto kRwxx;
        rSmUq:
        $this->response->write();
        goto ClQS3;
        zDVyd:
        $file_data = $this->attachmentModel->upload_file("\x69\155\x70\157\162\164");
        goto u_4vL;
        bN09r:
        valid_permission($permissionArr[$csType], 4);
        goto zDVyd;
        XrGe9:
        if (!$import) {
            goto pf9hV;
            pf9hV:
            $this->response->error(lang("\111\115\x50\117\122\x54\137\105\122\122\117\122"));
            goto sjgu5;
            QOiOn:
            return false;
            goto JjXfE;
            sjgu5:
            $this->response->write();
            goto QOiOn;
            JjXfE:
        }
        goto IqPDw;
        ebFhe:
        $this->load->model("\141\x74\x74\141\x63\150\x6d\145\x6e\164\115\x6f\144\145\154");
        goto EvsjG;
        u_4vL:
        if (empty($file_data) && isset($data["\144\x62\144\162\x69\x76\145\x72"])) {
            goto tRSKD;
            rlHYR:
            $this->form_validation->set_rules("\x70\x6f\x72\x74", "\124\x61\x6c\154\171\x20\x50\x6f\x72\164", "\164\x72\x69\155\174\x72\x65\161\x75\151\162\x65\x64");
            goto D5DtL;
            IVSIG:
            $this->form_validation->set_rules("\144\x62\x64\x72\151\x76\x65\162", "\124\141\154\x6c\171\40\104\102\x20\104\x72\151\x76\145\x72", "\164\162\151\x6d\174\x72\145\x71\165\151\162\x65\x64");
            goto PTH7j;
            D5DtL:
            if ($this->form_validation->run() == FALSE) {
                goto X4I5L;
                jYVt9:
                return false;
                goto EB4dP;
                WWW_h:
                $this->response->write();
                goto jYVt9;
                X4I5L:
                $this->response->error(validation_errors());
                goto WWW_h;
                EB4dP:
            }
            goto s2lzq;
            tRSKD:
            if (!function_exists("\157\144\142\143\x5f\143\x6f\x6e\156\145\x63\164")) {
                goto U1QZa;
                naCrQ:
                return false;
                goto PwuZY;
                iQq3A:
                $this->response->write();
                goto naCrQ;
                U1QZa:
                $this->response->error(lang("\117\x44\102\103\137\105\122\122\x4f\x52"));
                goto iQq3A;
                PwuZY:
            }
            goto VaOBL;
            VaOBL:
            $this->load->library("\146\157\162\155\137\x76\141\154\151\x64\x61\164\151\x6f\156");
            goto IVSIG;
            PTH7j:
            $this->form_validation->set_rules("\x68\x6f\163\164\x6e\x61\155\145", "\x54\141\154\154\x79\x20\150\157\x73\164\156\141\155\x65", "\164\162\151\155\x7c\x72\x65\161\x75\151\162\145\144");
            goto rlHYR;
            s2lzq:
        }
        goto h6qY1;
        VUs36:
        ini_set("\155\x65\155\157\x72\171\x5f\154\151\155\151\164", "\55\x31");
        goto ebFhe;
        h6qY1:
        $params = array("\x63\163\124\171\160\145" => $csType, "\146\x69\x6c\x65\x5f\x64\x61\x74\x61" => !empty($file_data[0]) ? $file_data[0] : $data, "\x6f\166\x65\162\x77\162\x69\x74\x65" => $overwrite);
        goto WMXZl;
        z9myH:
        return true;
        goto ahlHN;
        ClQS3:
        activity_log(array("\164\111\144" => 0, "\x61\x45\166\145\x6e\x74" => '', "\141\126\x61\154\x75\145" => $csType == "\x43" ? "\111\x6d\160\157\x72\164\x65\x64\40\103\x75\163\x74\157\x6d\145\162\163" : ($csType == "\x52" ? "\111\x6d\x70\x6f\162\x74\x65\x64\40\123\141\x6c\x65\163\x20\122\145\160" : "\111\155\x70\157\162\164\x65\x64\x20\x53\x75\160\x70\154\151\x65\162\x73"), "\x74\171\x70\x65" => "\103\124"));
        goto z9myH;
        SZEBF:
        $import = $this->contactsModel->import($params);
        goto HccxG;
        euV6Q:
        if (get_user_data("\x72\x6f\x6c\145\103\157\x64\x65") != "\101") {
            goto JNBGD;
            s8awN:
            return false;
            goto coT92;
            JNBGD:
            $this->response->error("\40\x59\157\165\40\144\157\x20\156\x6f\164\x20\150\141\x76\x65\40\160\145\162\x6d\151\x73\x73\x69\157\156\x20\x74\157\x20\141\143\143\145\x73\x73\x20\x69\x6d\160\x6f\x72\x74\x20");
            goto fEcBi;
            fEcBi:
            $this->response->write();
            goto s8awN;
            coT92:
        }
        goto VUs36;
        EvsjG:
        $_POST = $data = $this->request->post();
        goto v46dy;
        ahlHN:
    }
    function export_file($params, $export_type = "\143\x73\x76")
    {
        goto pMSCz;
        leUOv:
        HH_lO:
        goto tTFZ7;
        pMSCz:
        ini_set("\155\145\155\x6f\x72\x79\x5f\x6c\151\155\151\164", "\55\61");
        goto A9swH;
        wpHoW:
        $this->load->helper("\x64\157\x77\156\x6c\157\141\144");
        goto X0Uz_;
        A9swH:
        ini_set("\155\141\170\x5f\145\170\x65\143\x75\x74\x69\x6f\x6e\x5f\x74\151\x6d\145", -1);
        goto PIFym;
        IUnMl:
        $items = !empty($params["\x69\164\x65\x6d\163"]) ? $params["\151\x74\x65\155\163"] : array();
        goto wpHoW;
        BTHSQ:
        $file_path = "\x74\x65\x6d\x70" . DS . "\x65\170\160\x6f\x72\164" . DS . get_company("\x69\x64");
        goto VTnak;
        VTnak:
        if (!is_dir($file_path)) {
            mkdir($file_path, 0755, TRUE);
        }
        goto hOnQH;
        hOnQH:
        switch ($export_type) {
            case "\160\144\x66":
                goto znodP;
                ABgTg:
                $content = $this->parser->parse("\x65\170\160\157\x72\164\57\x72\145\160\157\162\x74\137\164\x72\141\156\x73\x61\x63\x74\151\157\x6e\x73\56\160\x68\x70", $params, true);
                goto U4qxN;
                i70l6:
                $this->load->clear_vars();
                goto ABgTg;
                o13gx:
                $mpdf->autoScriptToLang = true;
                goto Hur3A;
                DvxTD:
                $mpdf->Output(FCPATH . $file_path, "\x46");
                goto sqVz3;
                sqVz3:
                goto HH_lO;
                goto zERhz;
                WjXAg:
                $mpdf->AddPage('', '', '', '', '');
                goto DA1d3;
                JAx0R:
                $mpdf = new \Mpdf\Mpdf(["\157\162\x69\x65\x6e\x74\x61\164\151\157\x6e" => "\120", "\x66\157\x72\155\141\164" => "\x41\x34", "\x6d\157\144\x65" => "\145\x6e", "\x6d\157\144\145" => "\x55\x54\x46\x2d\x38", "\144\x65\x66\x61\165\154\164\x5f\146\x6f\x6e\164\137\163\x69\172\145" => 9, array(5, 5, 8, 8)]);
                goto hi9tq;
                JYypz:
                $headerFooterContent = "\74\x64\151\x76\x20\x61\x6c\151\147\x6e\75\x22\x72\x69\147\x68\x74\x22\76\x7b\x50\101\x47\105\x4e\x4f\175\x20\x2f\x20\x7b\x6e\142\x7d\x3c\57\144\151\166\x3e";
                goto fra3a;
                znodP:
                $this->load->library("\x70\x61\162\163\145\162");
                goto dHWGU;
                m3PqW:
                ini_set("\x6d\x65\155\x6f\x72\x79\x5f\154\151\x6d\151\x74", "\x2d\x31");
                goto JAx0R;
                fra3a:
                $oddEvenConfiguration = ["\x4c" => ["\143\x6f\156\x74\x65\x6e\x74" => ''], "\103" => ["\143\157\156\x74\145\156\164" => ''], "\122" => ["\x63\x6f\156\164\x65\156\x74" => $headerFooterContent], "\154\x69\156\145" => 1];
                goto nC5Oy;
                DA1d3:
                $mpdf->SetFooter($headerFooterConfiguration);
                goto mcKTs;
                hGgEH:
                $mpdf->autoArabic = true;
                goto f0vUo;
                Hur3A:
                $mpdf->baseScript = 1;
                goto F2EDj;
                ZTY0K:
                $mpdf->SetDisplayMode("\x72\x65\141\154");
                goto o13gx;
                mcKTs:
                $mpdf->setHeader("\x7b\x50\101\107\105\116\117\x7d\40\x2f\x20\x7b\156\142\175");
                goto i70l6;
                hi9tq:
                $mpdf->setAutoTopMargin = "\163\x74\162\145\164\x63\150";
                goto m51Lk;
                dHWGU:
                $file_path .= DS . $file_name . "\x2e\x70\144\x66";
                goto JYypz;
                f0vUo:
                $mpdf->autoLangToFont = true;
                goto WjXAg;
                M098J:
                require_once APPPATH . "\164\x68\x69\x72\x64\x5f\x70\141\162\x74\171\57\155\x70\144\146\x2f\141\x75\x74\x6f\154\x6f\x61\x64\56\160\150\160";
                goto m3PqW;
                F2EDj:
                $mpdf->autoVietnamese = true;
                goto hGgEH;
                m51Lk:
                $mpdf->setAutoBottomMargin = "\163\164\x72\x65\x74\143\x68";
                goto ZTY0K;
                U4qxN:
                $mpdf->WriteHTML(html_entity_decode($content));
                goto DvxTD;
                nC5Oy:
                $headerFooterConfiguration = ["\157\144\x64" => $oddEvenConfiguration, "\x65\166\x65\156" => $oddEvenConfiguration];
                goto M098J;
                zERhz:
        }
        goto iQZfr;
        PIFym:
        $params["\x74\171\x70\145"] = !empty($params["\x74\x79\x70\x65"]) ? $params["\x74\x79\160\145"] : "\x64\x65\x66\141\165\154\x74";
        goto j3pUq;
        j3pUq:
        $content = '';
        goto IUnMl;
        X0Uz_:
        $file_name = $params["\x66\151\x6c\x65\x5f\156\x61\155\145"];
        goto BTHSQ;
        iQZfr:
        hlpX7:
        goto leUOv;
        tTFZ7:
        return $file_path;
        goto cCk7R;
        cCk7R:
    }
    public function save_branchAccount()
    {
        goto KCcmg;
        TyDjP:
        return false;
        goto ypKwl;
        oAyMH:
        if (!empty($result)) {
            goto yQ2WR;
            RVkun:
            $this->response->write();
            goto ni2r4;
            ni2r4:
            return true;
            goto xzGFG;
            yQ2WR:
            $this->response->success("\x53\125\x43\x43\105\x53\123\x5f\123\x41\126\x45");
            goto RVkun;
            xzGFG:
        }
        goto EYj8y;
        EYj8y:
        $this->response->write();
        goto TyDjP;
        pPtQH:
        $result = $this->contactsModel->save_branchAccount($data);
        goto oAyMH;
        KCcmg:
        $_POST = $data = $this->request->post();
        goto pPtQH;
        ypKwl:
    }
    public function get_branchAccount()
    {
        goto cRRc4;
        cRRc4:
        $_POST = $data = $this->request->post();
        goto zprWD;
        SHfOy:
        return false;
        goto XPzmn;
        zprWD:
        $result = $this->contactsModel->get_branchAccount($data);
        goto woc91;
        woc91:
        $this->response->set_data("\x69\x74\145\155\163", $result["\151\164\x65\155\x73"], true);
        goto C9vj4;
        C9vj4:
        $this->response->write();
        goto SHfOy;
        XPzmn:
    }
    public function credit_limit()
    {
        goto bC1hE;
        F23IZ:
        $this->response->set_data("\151\164\x65\155\x73", $result["\151\164\x65\x6d\x73"], true);
        goto a_lS6;
        a_lS6:
        $this->response->write();
        goto zM9vO;
        CQL7e:
        $result = $this->contactsModel->get_credit_limt($data);
        goto F23IZ;
        bC1hE:
        $_POST = $data = $this->request->post();
        goto CQL7e;
        zM9vO:
        return false;
        goto veIb1;
        veIb1:
    }
    public function contact_credit_limit()
    {
        goto pCVvX;
        pCVvX:
        $_POST = $data = $this->request->post();
        goto kSzLQ;
        PB07O:
        $this->response->write();
        goto v3o9O;
        DXLbb:
        $this->response->set_data("\151\164\145\x6d\x73", $result["\x69\164\x65\x6d\163"], true);
        goto PB07O;
        v3o9O:
        return false;
        goto g7Gcq;
        kSzLQ:
        $result = $this->contactsModel->get_contact_credit_limt($data);
        goto DXLbb;
        g7Gcq:
    }
    public function get_credit_limit()
    {
        goto gjG3J;
        gjG3J:
        $_POST = $data = $this->request->post();
        goto m1cRA;
        bNcNL:
        return false;
        goto GXun1;
        Ryw6S:
        $this->response->set_data("\151\164\x65\x6d\163", $result["\x69\164\145\x6d\x73"], true);
        goto xPoiV;
        xPoiV:
        $this->response->write();
        goto bNcNL;
        m1cRA:
        $result = $this->contactsModel->get_Single_credit_limt($data);
        goto Ryw6S;
        GXun1:
    }
    public function credit_limit_save()
    {
        goto RHKWQ;
        zrPwP:
        $result = $this->contactsModel->save_credit_limit($data);
        goto a_wTL;
        RHKWQ:
        $_POST = $data = $this->request->post();
        goto zrPwP;
        a_wTL:
        if (!empty($result)) {
            goto knkBf;
            pvxBa:
            $this->response->write();
            goto iJmyw;
            knkBf:
            $this->response->success("\123\125\103\103\x45\123\123\x5f\x53\101\126\105");
            goto pvxBa;
            iJmyw:
            return true;
            goto oZvwr;
            oZvwr:
        }
        goto g02xE;
        g02xE:
        $this->response->write();
        goto qdNJX;
        qdNJX:
        return false;
        goto ENpS4;
        ENpS4:
    }
    function credit_limit_delete($id = '')
    {
        $ret = $this->contactsModel->delete_credit_limt($id);
        if ($ret === true) {
            goto AaBB_;
            nPb0i:
            return true;
            goto uR4i0;
            Tacmc:
            $this->response->write();
            goto nPb0i;
            AaBB_:
            $this->response->success("\x44\x45\114\105\x54\105\137\x53\x55\x43\103\x45\x53\123");
            goto Tacmc;
            uR4i0:
        } else {
            goto YRiem;
            YRiem:
            $this->response->error($this->contactsModel->message);
            goto PVn5X;
            YzOa0:
            $this->response->write();
            goto Iaw63;
            Iaw63:
            return false;
            goto bb1Z4;
            PVn5X:
            if ($ret) {
                $this->response->set_data("\x64\x61\164\x61", $ret);
            }
            goto YzOa0;
            bb1Z4:
        }
    }
    function save_salerate()
    {
        goto TaREJ;
        pHK8M:
        $this->response->write();
        goto KUow0;
        mxa__:
        if (!empty($result)) {
            goto Wg2ON;
            xPDkC:
            $this->response->write();
            goto GM3Au;
            GM3Au:
            return true;
            goto t9efN;
            Wg2ON:
            $this->response->success("\123\125\x43\103\105\123\x53\x5f\x53\101\126\x45");
            goto xPDkC;
            t9efN:
        }
        goto pHK8M;
        KUow0:
        return false;
        goto Y1igZ;
        Lojv6:
        $result = $this->contactsModel->save_salerate($data);
        goto mxa__;
        TaREJ:
        $_POST = $data = $this->request->post();
        goto Lojv6;
        Y1igZ:
    }
    function getLocations()
    {
        goto UDwLb;
        kbSRL:
        $this->response->write();
        goto DMOU7;
        Cz0m5:
        if ($result) {
            $this->response->set_data("\151\x74\x65\155\163", $result);
        }
        goto kbSRL;
        TYElE:
        $result = $this->contactsModel->getContactLocations($data);
        goto Cz0m5;
        DMOU7:
        return true;
        goto PXkAP;
        UDwLb:
        $data = $this->request->post();
        goto TYElE;
        PXkAP:
    }
    public function unique_displayname()
    {
        goto zgKNr;
        ap0md:
        if ($result) {
            $this->response->set_data("\151\x73\x55\x6e\151\161\x75\145", 1);
        } else {
            $this->response->set_data("\151\x73\125\156\151\161\x75\145", 0);
        }
        goto Ia2RD;
        zgKNr:
        $data = $this->request->post();
        goto zZ_LM;
        jmE9_:
        return true;
        goto t5spb;
        Ia2RD:
        $this->response->write();
        goto jmE9_;
        zZ_LM:
        $result = $this->contactsModel->get_unique_displayname($data);
        goto ap0md;
        t5spb:
    }
    public function ratesheet()
    {
        goto EA3tm;
        zTVHs:
        $this->response->set_data("\x72\141\164\x65\137\163\150\x65\145\x74\163", $rate_sheets);
        goto NpF44;
        JvqOe:
        return true;
        goto afWnc;
        EA3tm:
        $data = $this->request->post();
        goto yHZTs;
        NpF44:
        $this->response->write();
        goto JvqOe;
        yHZTs:
        $rate_sheets = $this->contactsModel->get_rate_sheets();
        goto zTVHs;
        afWnc:
    }
}
