<?php
/*
Generated by OutputBooks Team
*/

defined("\102\x41\123\105\120\101\124\110") or exit("\116\x6f\40\x64\x69\162\x65\x63\x74\40\163\x63\x72\x69\160\x74\x20\x61\x63\x63\145\x73\163\40\x61\x6c\154\157\x77\x65\144");
class Category extends MY_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->model("\x63\x61\x74\145\x67\157\x72\x79\x4d\x6f\144\x65\x6c");
    }
    public function index()
    {
        $this->load->page("\x68\157\x6d\145");
    }
    public function listing()
    {
        goto Qwt2N;
        Aifhj:
        if (!empty($postData) && $postData["\164\x79\160\x65"] == "\x42") {
            $categories = $this->categoryModel->get_brand_items($postData);
        } else {
            $categories = $this->categoryModel->get_list('', $postData);
        }
        goto hG1Qu;
        xyfwG:
        $this->response->success();
        goto hgrVl;
        hgrVl:
        if (!empty($categories)) {
            $this->response->set_data("\151\x74\145\155\163", $categories);
        }
        goto dgPsv;
        Qwt2N:
        $postData = $this->request->post();
        goto Aifhj;
        dgPsv:
        $this->response->write();
        goto YXEXK;
        YXEXK:
        return true;
        goto PQbqG;
        hG1Qu:
        if (!empty($postData) && $postData["\x74\171\160\x65"] == "\x43\x42") {
            goto sz9OK;
            RaPx6:
            $categories = array_merge($cat, $brand);
            goto XdLPc;
            DntVn:
            $cat = $this->categoryModel->get_list('', $postData);
            goto RaPx6;
            sz9OK:
            $brand = $this->categoryModel->get_brand_items($postData);
            goto DntVn;
            XdLPc:
        }
        goto xyfwG;
        PQbqG:
    }
    public function details($catId = 0)
    {
        goto FRC3O;
        FRC3O:
        if (empty($catId)) {
            goto FhP0x;
            Uzuae:
            return false;
            goto c0GoF;
            FhP0x:
            $this->response->error("\111\x4e\126\101\114\111\104\x5f\x52\x45\x51\125\x45\123\124");
            goto pgaW9;
            pgaW9:
            $this->response->write();
            goto Uzuae;
            c0GoF:
        }
        goto Vg4ji;
        SKLws:
        if (!empty($result)) {
            $this->response->set_data("\x63\x61\x74\145\x67\157\x72\171", $result);
        }
        goto I_s1E;
        gt334:
        $this->response->write();
        goto wSe4d;
        TqnCw:
        $this->response->success();
        goto SKLws;
        Vg4ji:
        $result = $this->categoryModel->get_details($catId);
        goto m2pRz;
        m2pRz:
        $attributes = $this->categoryModel->get_attributes($catId);
        goto TqnCw;
        I_s1E:
        if (!empty($attributes) && !empty($attributes["\141\164\164\x72\x69\142\x75\x74\145\x73"])) {
            $attributes["\x61\x74\x74\162\151\142\x75\x74\145\163"] = explode("\54", $attributes["\141\164\164\162\x69\x62\165\x74\x65\163"]);
            $this->response->set_data($attributes);
        }
        goto gt334;
        wSe4d:
        return true;
        goto nso6F;
        nso6F:
    }
    public function items($catId = 0)
    {
        goto zgv8j;
        Y8hWY:
        $categoryDetails = $this->categoryModel->get_items($catId);
        goto D9scD;
        D9scD:
        $this->response->success();
        goto cpiYc;
        eneoK:
        $this->response->write();
        goto aCLnT;
        cpiYc:
        if (!empty($categoryDetails)) {
            $this->response->set_data($categoryDetails);
        }
        goto eneoK;
        aCLnT:
        return true;
        goto G_3I6;
        zgv8j:
        if (empty($catId)) {
            goto bMFN2;
            cBekd:
            $this->response->write();
            goto Q4gGk;
            Q4gGk:
            return false;
            goto WJ7Xx;
            bMFN2:
            $this->response->error("\x49\x4e\x56\101\x4c\x49\x44\137\122\x45\x51\x55\105\123\124");
            goto cBekd;
            WJ7Xx:
        }
        goto Y8hWY;
        G_3I6:
    }
    public function save()
    {
        goto WOd4K;
        THauB:
        return true;
        goto gsKat;
        QEGef:
        if (!($catId = $this->categoryModel->save($postData))) {
            goto K2XMB;
            p1BPt:
            $this->response->write();
            goto PIOjg;
            K2XMB:
            $this->response->error($this->categoryModel->message ? $this->categoryModel->message : "\x49\x4e\126\101\x4c\111\104\137\122\105\x51\125\x45\123\x54");
            goto p1BPt;
            PIOjg:
            return false;
            goto fTerG;
            fTerG:
        }
        goto H7ynf;
        GEeG0:
        $this->response->write();
        goto THauB;
        tGZSl:
        if (!empty($postData) && !empty($postData["\164\x79\160\x65"]) && empty($postData["\151\x64"])) {
            goto Oxr7v;
            NA2Yy:
            if ($this->form_validation->run() == FALSE) {
                goto Eiwft;
                lQ6yv:
                return false;
                goto g99XY;
                Eiwft:
                $this->response->error(validation_errors());
                goto pnEjo;
                pnEjo:
                $this->response->write();
                goto lQ6yv;
                g99XY:
            }
            goto qOtVW;
            sc_DF:
            $this->form_validation->set_rules("\156\141\x6d\145", "\x42\x72\141\156\144\57\x43\141\164\145\147\157\x72\x79\x20\116\x61\x6d\x65", "\x74\x72\x69\x6d\174\x72\145\161\x75\x69\x72\145\x64\174\x75\156\x69\161\165\x65\x65\x5f\164\157\x5f\143\x6f\155\160\x61\156\171\x5b\x63\141\164\x65\147\x6f\162\x79\x2e\156\x61\x6d\x65\x5d");
            goto NA2Yy;
            Oxr7v:
            $this->load->library("\x66\x6f\162\155\137\x76\141\154\151\144\141\164\x69\157\x6e");
            goto sc_DF;
            qOtVW:
        }
        goto oD1Hy;
        hdo4B:
        $this->response->set_data("\151\144", $catId);
        goto GEeG0;
        oD1Hy:
        if (empty($postData)) {
            goto M6x8S;
            M6x8S:
            $this->response->error("\111\116\x56\x41\114\111\104\137\x52\105\x51\x55\x45\x53\124");
            goto MvaWP;
            e473n:
            return false;
            goto hl3xQ;
            MvaWP:
            $this->response->write();
            goto e473n;
            hl3xQ:
        }
        goto QEGef;
        WOd4K:
        $_POST = $postData = $this->request->post();
        goto tGZSl;
        H7ynf:
        $this->response->success('');
        goto hdo4B;
        gsKat:
    }
    public function delete($catId = '', $type = "\103")
    {
        goto HAj2u;
        HAj2u:
        if (empty($catId)) {
            goto WAvOq;
            WAvOq:
            $this->response->error("\111\x4e\x56\x41\114\111\x44\x5f\122\105\121\125\x45\123\124");
            goto e1Agh;
            tyxuR:
            return false;
            goto KvSwM;
            e1Agh:
            $this->response->write();
            goto tyxuR;
            KvSwM:
        }
        goto cQE8D;
        cQE8D:
        if ($this->categoryModel->delete($catId, $type)) {
            $this->response->success("\104\105\x4c\105\124\x45\137\x53\x55\103\103\105\123\x53");
        } else {
            $this->response->error($this->categoryModel->message ? $this->categoryModel->message : "\104\x45\114\105\124\x45\137\x45\x52\122\117\x52");
        }
        goto axDP7;
        axDP7:
        $this->response->write();
        goto uRo91;
        uRo91:
        return true;
        goto tS2WD;
        tS2WD:
    }
    public function additems()
    {
        goto lqDrn;
        SXNQV:
        $result = $this->categoryModel->addItems($postData);
        goto Mz64Q;
        Mz64Q:
        $this->response->write();
        goto ed1iY;
        lqDrn:
        $postData = $this->request->post();
        goto DGM62;
        ed1iY:
        return true;
        goto nH2Lm;
        DGM62:
        if (empty($postData)) {
            goto Fo8bT;
            Fo8bT:
            $this->response->error("\111\x4e\x56\101\x4c\111\x44\x5f\x52\x45\121\125\105\123\124");
            goto T14F0;
            T14F0:
            $this->response->write();
            goto H0OjO;
            H0OjO:
            return false;
            goto xnO6j;
            xnO6j:
        }
        goto SXNQV;
        nH2Lm:
    }
    public function additem()
    {
        goto eOXkc;
        quH6T:
        return true;
        goto SbigR;
        eOXkc:
        $postData = $this->request->post();
        goto g77vk;
        KlOpS:
        $result = $this->categoryModel->addItem($postData);
        goto U1kiw;
        g77vk:
        if (empty($postData)) {
            goto bDzOa;
            zAaTt:
            $this->response->write();
            goto beNTk;
            beNTk:
            return false;
            goto KL0ld;
            bDzOa:
            $this->response->error("\x49\116\126\x41\x4c\111\104\137\x52\105\121\125\x45\123\x54");
            goto zAaTt;
            KL0ld:
        }
        goto KlOpS;
        U1kiw:
        $this->response->write();
        goto quH6T;
        SbigR:
    }
    public function removeitem()
    {
        goto hubLD;
        ZvWRc:
        if (empty($postData)) {
            goto xdb2D;
            xdb2D:
            $this->response->error("\x49\x4e\x56\101\x4c\x49\x44\137\x52\105\x51\x55\x45\x53\124");
            goto OhiXl;
            OhiXl:
            $this->response->write();
            goto OTzmw;
            OTzmw:
            return false;
            goto kz9Yi;
            kz9Yi:
        }
        goto xRSKx;
        Amqg0:
        return true;
        goto Rtx54;
        lxS8F:
        $this->response->write();
        goto Amqg0;
        xRSKx:
        $result = $this->categoryModel->removeItem($postData);
        goto lxS8F;
        hubLD:
        $postData = $this->request->post();
        goto ZvWRc;
        Rtx54:
    }
    public function saveorder()
    {
        goto efFeD;
        FugOA:
        if (!empty($result)) {
            $this->response->success("\x4f\162\144\x65\162\40\163\x61\x76\145\x64\x20\163\x75\x63\x63\x65\x73\x73\146\x75\154\154\x79");
        }
        goto YDjxr;
        efFeD:
        $postData = $this->request->post();
        goto uSdQ_;
        uSdQ_:
        if (empty($postData)) {
            goto B3LDh;
            b0jBz:
            return false;
            goto Jipt_;
            HR166:
            $this->response->write();
            goto b0jBz;
            B3LDh:
            $this->response->error("\111\116\x56\101\114\x49\104\x5f\122\105\121\x55\105\x53\x54");
            goto HR166;
            Jipt_:
        }
        goto goJiL;
        LKvmV:
        $this->response->write();
        goto GyMQn;
        GyMQn:
        return true;
        goto ESBr_;
        YDjxr:
        if (empty($result)) {
            goto fDfdY;
            l5mUG:
            return false;
            goto A6WAN;
            sQYT7:
            $this->response->write();
            goto l5mUG;
            fDfdY:
            $this->response->error("\111\x4e\126\x41\x4c\x49\x44\137\x52\x45\x51\125\x45\x53\x54");
            goto sQYT7;
            A6WAN:
        }
        goto LKvmV;
        goJiL:
        $result = $this->categoryModel->saveorder($postData);
        goto FugOA;
        ESBr_:
    }
    public function ecom_details($catId = 0)
    {
        goto Opccr;
        Kfj30:
        if (!empty($result)) {
            $this->response->set_data("\151\x74\x65\x6d\x73", $result);
        }
        goto pPghE;
        mBDZB:
        return true;
        goto vfH1c;
        Opccr:
        if (strpos(get_company("\163\141\154\115\157\144\103\x6f\x64\x65\163"), "\x45\103") === FALSE) {
            goto JZDff;
            JZDff:
            $this->response->error("\111\x4e\x56\x41\x4c\111\104\137\122\x45\x51\x55\x45\123\124");
            goto ufPnY;
            ufPnY:
            $this->response->write();
            goto YIB3Y;
            YIB3Y:
            return false;
            goto w2ggs;
            w2ggs:
        }
        goto GEQjL;
        pPghE:
        $this->response->write();
        goto mBDZB;
        GEQjL:
        if (empty($catId)) {
            goto a2GBs;
            a2GBs:
            $this->response->error("\x49\x4e\126\x41\114\x49\104\x5f\122\105\121\125\x45\x53\124");
            goto dvoVG;
            NS9Bc:
            return false;
            goto hYKRO;
            dvoVG:
            $this->response->write();
            goto NS9Bc;
            hYKRO:
        }
        goto cEimk;
        cEimk:
        $result = $this->categoryModel->get_ecom_details($catId);
        goto kXT3w;
        kXT3w:
        $this->response->success();
        goto Kfj30;
        vfH1c:
    }
    public function save_ecom_details()
    {
        goto y4JO0;
        fE0RM:
        $this->response->write();
        goto L66d3;
        z7Sen:
        $this->response->set_data("\x69\144", $postData["\143\x61\x74\145\x67\x6f\x72\x79\x49\144"]);
        goto fE0RM;
        HT8q7:
        if (!($detail = $this->categoryModel->save_ecom_details($postData))) {
            goto rHSck;
            rHSck:
            $this->response->error($this->categoryModel->message ? $this->categoryModel->message : "\x49\x4e\x56\x41\x4c\x49\x44\137\122\105\121\x55\105\x53\x54");
            goto HtBIs;
            HtBIs:
            $this->response->write();
            goto JAE_l;
            JAE_l:
            return false;
            goto Mj0kf;
            Mj0kf:
        }
        goto z7Sen;
        jg9kF:
        if (empty($postData)) {
            goto h_ztR;
            AlNna:
            return false;
            goto zDu2I;
            eHa_A:
            $this->response->write();
            goto AlNna;
            h_ztR:
            $this->response->error("\111\x4e\x56\101\114\x49\x44\137\122\x45\121\125\105\123\x54");
            goto eHa_A;
            zDu2I:
        }
        goto HT8q7;
        L66d3:
        return true;
        goto I1vsD;
        y4JO0:
        if (strpos(get_company("\163\141\154\115\x6f\144\x43\x6f\x64\145\163"), "\105\103") === FALSE) {
            goto G96b0;
            G96b0:
            $this->response->error("\111\116\x56\101\x4c\111\x44\x5f\122\105\121\125\x45\x53\x54");
            goto nMWYr;
            rla7o:
            return false;
            goto D0UzY;
            nMWYr:
            $this->response->write();
            goto rla7o;
            D0UzY:
        }
        goto M7e8N;
        M7e8N:
        $postData = $this->request->post();
        goto jg9kF;
        I1vsD:
    }
    public function ecomimagedelete($id = 0, $imageCode = "\x43\101\124")
    {
        goto e_3un;
        Mvoti:
        if (empty($id)) {
            goto OrMkl;
            OrMkl:
            $this->response->error("\111\116\x56\101\x4c\111\104\137\122\105\x51\x55\x45\123\124");
            goto fWsnp;
            tNU36:
            return false;
            goto oY25f;
            fWsnp:
            $this->response->write();
            goto tNU36;
            oY25f:
        }
        goto kS0kf;
        goOtn:
        return true;
        goto OC0fn;
        beyPW:
        $this->response->write($res);
        goto goOtn;
        e_3un:
        if (strpos(get_company("\163\x61\x6c\115\157\x64\x43\157\x64\x65\163"), "\x45\x43") === FALSE) {
            goto J6fg1;
            v7NmM:
            $this->response->write();
            goto pqqul;
            J6fg1:
            $this->response->error("\111\116\126\101\114\111\104\x5f\x52\x45\121\x55\105\123\x54");
            goto v7NmM;
            pqqul:
            return false;
            goto NRLA_;
            NRLA_:
        }
        goto Mvoti;
        kS0kf:
        $res = $this->categoryModel->ecomimagedelete($id, $imageCode);
        goto beyPW;
        OC0fn:
    }
    public function save_pos_details()
    {
        goto TDOSf;
        TDOSf:
        $postData = $this->request->post();
        goto oTaZS;
        oTaZS:
        if (empty($postData)) {
            goto I_faP;
            I_faP:
            $this->response->error("\x49\x4e\126\x41\114\x49\104\x5f\122\105\121\125\x45\123\124");
            goto TRf1j;
            Cinai:
            return false;
            goto Q_pNX;
            TRf1j:
            $this->response->write();
            goto Cinai;
            Q_pNX:
        }
        goto Sj95I;
        fpILE:
        $this->response->write($res);
        goto RDYqn;
        RDYqn:
        return true;
        goto jZ0eV;
        Sj95I:
        $res = $this->categoryModel->save_pos_details($postData);
        goto fpILE;
        jZ0eV:
    }
}
