<?php
/*
Generated by OutputBooks Team
*/

defined("\x42\101\123\x45\120\x41\x54\x48") or exit("\116\157\x20\x64\x69\x72\145\143\x74\x20\163\x63\162\x69\160\164\40\x61\143\x63\x65\x73\163\40\x61\154\x6c\x6f\x77\145\x64");
class Bom extends MY_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->model("\x62\x6f\155\115\x6f\x64\x65\x6c");
    }
    public function listing($page = 1)
    {
        goto ZN689;
        RSUvC:
        $this->response->set_data("\x69\164\x65\x6d\163", $result, true);
        goto uRigh;
        iiVbo:
        $data["\160\141\x67\x65"] = !empty($data["\160\x61\x67\x65"]) ? $data["\160\141\147\145"] : $page;
        goto HiKEJ;
        uRigh:
        $this->response->write();
        goto YyXlK;
        HiKEJ:
        $result = $this->bomModel->getlist($data);
        goto RSUvC;
        ZN689:
        valid_permission("\x4d\x4e\102\x4f\x4d", 1);
        goto n6aC0;
        n6aC0:
        $data = $this->request->post();
        goto iiVbo;
        YyXlK:
        return true;
        goto r0VpU;
        r0VpU:
    }
    public function details($id = '')
    {
        goto KkXZM;
        Cuj2y:
        $this->response->set_data($details);
        goto WnEKZ;
        rV3Cz:
        $details = $this->bomModel->get_details($data);
        goto EZf_q;
        KAzet:
        if (!empty($id)) {
            $data["\151\144"] = $id;
        }
        goto rV3Cz;
        WnEKZ:
        $this->response->write();
        goto EhWBs;
        KkXZM:
        $data = $this->request->post();
        goto KAzet;
        EZf_q:
        if (empty($details)) {
            goto vZWa7;
            vZWa7:
            $this->response->success("\x4e\157\40\x44\141\164\x61\x20\106\x6f\x75\x6e\144");
            goto vchut;
            xw_pf:
            return false;
            goto MMJfS;
            vchut:
            $this->response->write();
            goto xw_pf;
            MMJfS:
        }
        goto Cuj2y;
        EhWBs:
        return true;
        goto JVMb2;
        JVMb2:
    }
    public function save()
    {
        goto trA0V;
        lI0Ye:
        $this->response->write();
        goto iLvcd;
        cBgPJ:
        $this->load->library("\146\x6f\162\155\137\166\141\154\x69\x64\141\164\151\x6f\x6e");
        goto IXPm9;
        t3saj:
        if ($this->form_validation->run() == FALSE) {
            goto Wuj36;
            Wuj36:
            $this->response->error(validation_errors());
            goto A1pks;
            A1pks:
            $this->response->write();
            goto nPXk7;
            nPXk7:
            return false;
            goto mpEJJ;
            mpEJJ:
        }
        goto ch08u;
        trA0V:
        $_POST = $data = $this->request->post();
        goto cBgPJ;
        iLvcd:
        return true;
        goto a8iKo;
        ch08u:
        if ($bomId = $this->bomModel->save($data)) {
            $this->response->success("\x53\x55\x43\x43\105\x53\123\137\123\x41\126\x45");
            $this->response->set_data("\x69\144", $bomId);
        }
        goto lI0Ye;
        IXPm9:
        $this->form_validation->set_rules("\142\157\x6d\x4e\x61\155\145", "\102\x69\154\x6c\40\117\146\x20\115\x61\164\145\x72\x69\141\x6c\40\156\x61\x6d\x65", "\164\162\151\155\x7c\x72\145\x71\165\151\x72\x65\144\174\165\x6e\151\161\x75\145\x65\x5f\164\x6f\x5f\x63\x6f\155\x70\x61\156\171\x5b\x62\x6f\155\x2e\x62\157\x6d\x4e\x61\155\145\x5d");
        goto t3saj;
        a8iKo:
    }
    public function delete($id)
    {
        goto l7q1E;
        ujrya:
        if ($res) {
            goto RuNjK;
            avG4o:
            $this->response->write();
            goto s1dND;
            RuNjK:
            $this->response->success("\x44\x65\x6c\x65\x74\x65\144\x20\123\x75\143\x63\x65\x73\163\x66\165\154\154\171");
            goto avG4o;
            s1dND:
            return true;
            goto vnKnz;
            vnKnz:
        }
        goto siGSo;
        siGSo:
        $this->response->error();
        goto INCzY;
        AUSyl:
        return false;
        goto AFZB5;
        INCzY:
        $this->response->write();
        goto AUSyl;
        l7q1E:
        $res = $this->bomModel->delete($id);
        goto ujrya;
        AFZB5:
    }
    public function mfg_listing($page = 1)
    {
        goto ZInwh;
        QXZJg:
        return true;
        goto kjg63;
        l1vwd:
        $result = $this->bomModel->mfg_listing($data);
        goto a9Hvn;
        V7YrE:
        $data = $this->request->post();
        goto U7Nfm;
        tW7pX:
        $this->response->write();
        goto QXZJg;
        ZInwh:
        if (!get_company("\151\x73\127\141\162\145\110\x6f\x75\x73\145")) {
            valid_permission("\x4d\116\x4d\106\107", 1);
        }
        goto V7YrE;
        ZxXLa:
        $this->response->set_data("\x69\x74\x65\x6d\163", $result, true);
        goto tW7pX;
        a9Hvn:
        if (!empty($data["\164\x79\x70\145"])) {
            goto uhL9d;
            UlA_N:
            $results["\x68\145\x61\x64\x69\156\x67"] = array("\x73\104\141\164\x65" => array("\156\x61\x6d\x65" => "\x44\x61\164\145", "\x77\151\144" => "\x31\65\45"), "\x73\164\x4e\x6f" => array("\x6e\141\x6d\x65" => "\116\157", "\x77\151\x64" => "\62\65\x25"), "\142\x6f\x6d\116\141\155\145" => array("\156\x61\155\145" => "\x42\x4f\x4d\x20\116\x61\x6d\145", "\x77\151\x64" => "\x32\63\x25"), "\x63\x6f\156\x73\137\161\164\x79" => array("\156\141\155\145" => "\x43\157\x6e\163\x20\x51\164\171", "\167\151\144" => "\62\x35\x25"), "\x63\157\156\163\x5f\141\155\x74" => array("\156\141\155\145" => "\103\157\x6e\163\x20\x41\155\x74", "\x77\151\x64" => "\x31\x33\x25"), "\x70\162\144\x6e\x5f\161\164\171" => array("\156\x61\155\x65" => "\120\162\x64\x6e\40\x51\164\171", "\167\x69\x64" => "\61\x35\45"), "\160\x72\x64\x6e\137\x61\x6d\x74" => array("\x6e\x61\155\x65" => "\120\x72\x64\x6e\x20\x52\x61\164\x65", "\x77\151\144" => "\61\x33\x25"), "\165\x6e\x69\x74\x5f\162\x61\x74\x65" => array("\x6e\141\155\145" => "\x55\x6e\x69\164\40\122\x61\x74\x65", "\167\151\144" => "\x31\63\x25"));
            goto dQ22f;
            IXkVk:
            if (!empty($result)) {
                foreach ($result as $key => $val) {
                    goto NGFHz;
                    NGFHz:
                    $val["\163\x44\x61\164\x65"] = format_date($val["\x73\104\x61\164\145"]);
                    goto wV3oB;
                    cNk5c:
                    if (!empty($val["\x75\x6e\151\164\137\x72\x61\x74\145"])) {
                        $val["\x75\x6e\151\x74\x5f\x72\141\x74\x65"] = IND_money_format(abs($val["\x75\156\151\x74\x5f\162\x61\164\145"]));
                    }
                    goto rWLI3;
                    rWLI3:
                    $result[$key] = $val;
                    goto uqSWH;
                    uqSWH:
                    QY8pH:
                    goto tsxm2;
                    wV3oB:
                    if (!empty($val["\143\157\156\163\x5f\x71\x74\x79"])) {
                        $val["\x63\157\x6e\x73\137\x71\164\x79"] = floatval(abs($val["\143\157\x6e\x73\x5f\161\164\171"]));
                    }
                    goto BWx0W;
                    BWx0W:
                    if (!empty($val["\x70\x72\x64\156\x5f\161\x74\x79"])) {
                        $val["\160\x72\144\x6e\x5f\x71\x74\171"] = floatval(abs($val["\x70\x72\x64\x6e\x5f\x71\164\171"]));
                    }
                    goto MHe73;
                    MHe73:
                    if (!empty($val["\143\157\x6e\163\x5f\x61\155\164"])) {
                        $val["\143\157\x6e\x73\137\141\155\x74"] = IND_money_format(abs($val["\143\157\x6e\163\137\x61\x6d\164"]));
                    }
                    goto xxQUU;
                    xxQUU:
                    if (!empty($val["\160\x72\144\156\x5f\141\x6d\164"])) {
                        $val["\160\162\144\156\137\141\155\164"] = $val["\x63\x6f\x6e\x73\137\x61\155\x74"];
                    }
                    goto cNk5c;
                    tsxm2:
                }
                pDTOQ:
            }
            goto UlA_N;
            I_1wv:
            $this->response->set_data("\x75\x72\x6c", $file_name);
            goto PiMGm;
            dQ22f:
            $results["\x66\151\x6c\x65\137\x6e\x61\155\x65"] = "\x6d\x66\147";
            goto CQEbp;
            xI0z1:
            if (!empty($data["\x74\x6f"])) {
                $results["\x74\157\x5f\x64\141\x74\145"] = $data["\164\x6f"];
            }
            goto QcqrG;
            CQEbp:
            $results["\163\151\144\x65\110\145\x61\x64\x65\x72"] = "\115\x61\x6e\165\146\x61\143\164\x75\162\151\x6e\147\40\112\x6f\165\162\x6e\x61\x6c";
            goto IFmXk;
            tgW5x:
            $this->load->model("\162\145\160\x6f\x72\164\57\x45\170\x70\157\162\x74\115\157\x64\145\154", "\x45\170\160\x6f\162\164\x4d\x6f\144\145\x6c");
            goto cuzGB;
            PiMGm:
            $this->response->write();
            goto gI3yN;
            sMfUq:
            $results["\x74\171\x70\x65"] = '';
            goto K96Kh;
            gI3yN:
            return true;
            goto RQ5Gx;
            QcqrG:
            $results["\146\x69\154\145\x5f\156\141\x6d\x65"] = "\x6d\x66\x67\x6a\157\165\x72\156\141\x6c";
            goto sMfUq;
            K96Kh:
            $results["\151\x74\x65\x6d\x73"] = $result;
            goto tgW5x;
            uhL9d:
            valid_permission("\115\116\x4d\106\x47", 4);
            goto IXkVk;
            cuzGB:
            $file_name = $this->ExportModel->export_file($results, $data["\164\x79\x70\x65"]);
            goto I_1wv;
            IFmXk:
            if (!empty($data["\146\x72\x6f\x6d"])) {
                $results["\x66\162\x6f\155\137\x64\141\164\x65"] = $data["\146\162\157\x6d"];
            }
            goto xI0z1;
            RQ5Gx:
        }
        goto ZxXLa;
        U7Nfm:
        $data["\160\x61\x67\x65"] = !empty($data["\x70\x61\147\x65"]) ? $data["\160\141\147\145"] : $page;
        goto l1vwd;
        kjg63:
    }
    public function mfg_info()
    {
        goto YuXvc;
        zQnkI:
        return true;
        goto Yqaji;
        YuXvc:
        $info = $this->bomModel->mfg_info();
        goto ooHzq;
        sbVBx:
        $this->response->write();
        goto zQnkI;
        ooHzq:
        if (empty($info)) {
            goto unVIw;
            unVIw:
            $this->response->error("\105\162\x72\x6f\x72");
            goto kbeiN;
            ZTHwX:
            return false;
            goto WzzGE;
            kbeiN:
            $this->response->write();
            goto ZTHwX;
            WzzGE:
        }
        goto NDgEF;
        NDgEF:
        $this->response->set_data($info);
        goto sbVBx;
        Yqaji:
    }
    public function mfg_details($id)
    {
        goto eC9sO;
        eC9sO:
        $details = $this->bomModel->mfg_details($id);
        goto eT5m1;
        CShyl:
        $this->load->model("\151\164\x65\155\163\x4d\x6f\144\x65\x6c");
        goto bkwQS;
        bkwQS:
        $info = $this->itemsModel->stk_series($id);
        goto snCb5;
        p2qLt:
        $this->response->set_data($details);
        goto CShyl;
        d3jlL:
        return true;
        goto TNYS4;
        L7hse:
        $this->response->write();
        goto d3jlL;
        eT5m1:
        if (empty($details)) {
            goto oN8xN;
            oN8xN:
            $this->response->success("\x4e\157\x20\x44\x61\164\141\x20\106\157\x75\156\x64");
            goto GS4c2;
            xtNdV:
            return false;
            goto y1_O1;
            GS4c2:
            $this->response->write();
            goto xtNdV;
            y1_O1:
        }
        goto p2qLt;
        snCb5:
        $this->response->set_data("\x73\x65\162\x69\x65\163", $info);
        goto L7hse;
        TNYS4:
    }
    public function mfg_save()
    {
        goto A2UVP;
        PW1Xl:
        $this->response->write();
        goto CUOxL;
        A2UVP:
        $_POST = $data = $this->request->post();
        goto lrpsV;
        jhH6G:
        return true;
        goto scXOp;
        Zu31U:
        $this->response->success("\x53\x55\x43\103\x45\x53\x53\137\x53\101\x56\x45");
        goto OhCRZ;
        OhCRZ:
        $this->response->set_data($retData);
        goto PW1Xl;
        CUOxL:
        activity_log(array("\164\111\x64" => 0, "\141\x45\166\145\x6e\x74" => isset($data["\151\x64"]) && $data["\x69\144"] ? "\105" : "\x41", "\x61\x56\141\154\x75\x65" => "\x4d\141\156\165\146\141\143\x74\x75\x72\151\156\147\x20\112\x6f\x75\162\x6e\141\154\x20" . (isset($data["\163\x74\x4e\x6f"]) ? $data["\x73\164\116\x6f"] : ''), "\x74\x79\x70\x65" => "\x4d\x46\107"));
        goto jhH6G;
        lrpsV:
        if (!($retData = $this->bomModel->mfg_save($data))) {
            goto RlnBW;
            RlnBW:
            $this->response->error($this->bomModel->message);
            goto DhDbt;
            DhDbt:
            $this->response->write();
            goto sH8u4;
            sH8u4:
            return false;
            goto cDnzr;
            cDnzr:
        }
        goto Zu31U;
        scXOp:
    }
    public function mfg_delete($id)
    {
        goto nx91f;
        n5IqT:
        $info = $this->bomModel->mfg_info($id);
        goto BSrXG;
        XnK5t:
        return false;
        goto nPoRh;
        nx91f:
        $res = $this->bomModel->mfg_delete($id);
        goto n5IqT;
        BSrXG:
        if ($res) {
            goto sxbf3;
            sxbf3:
            $this->response->success("\104\x65\x6c\145\x74\145\x64\x20\x53\165\143\143\145\163\x73\x66\165\154\x6c\x79");
            goto g1Izw;
            oC4rB:
            if (!empty($info) && !empty($info["\x73\164\116\x6f"])) {
                activity_log(array("\164\x49\x64" => 0, "\x61\x45\x76\145\156\x74" => "\104", "\141\126\x61\x6c\165\x65" => "\115\141\156\165\146\x61\x63\164\x75\162\x69\x6e\147\40\x4a\157\165\x72\x6e\x61\x6c\x20" . $info["\x73\x74\116\157"], "\x74\171\160\145" => "\x4d\x46\107"));
            }
            goto sJtF9;
            g1Izw:
            $this->response->write();
            goto oC4rB;
            sJtF9:
            return true;
            goto yovWO;
            yovWO:
        }
        goto xDU3P;
        hBS1j:
        $this->response->write();
        goto XnK5t;
        xDU3P:
        $this->response->error();
        goto hBS1j;
        nPoRh:
    }
    public function bundle_listing($page = 1)
    {
        goto KxXHB;
        KxXHB:
        $data = $this->request->post();
        goto Ncr9r;
        fnSiL:
        $result = $this->bomModel->bundle_listing($data);
        goto B8DXK;
        rkYVl:
        $this->response->write();
        goto e_U2H;
        e_U2H:
        return true;
        goto Y9IyO;
        Ncr9r:
        $data["\160\141\x67\145"] = !empty($data["\x70\x61\147\145"]) ? $data["\160\x61\x67\x65"] : $page;
        goto fnSiL;
        B8DXK:
        $this->response->set_data("\151\x74\x65\x6d\x73", $result, true);
        goto rkYVl;
        Y9IyO:
    }
    public function bundle_details($id)
    {
        goto qAW91;
        qAW91:
        $details = $this->bomModel->bundle_details($id);
        goto KDoQp;
        QLyCo:
        $this->response->set_data("\144\x65\x74\x61\x69\154", $details);
        goto AOfCp;
        AOfCp:
        $this->response->write();
        goto LysaL;
        KDoQp:
        if (empty($details)) {
            goto kXsXa;
            Cx7g1:
            return false;
            goto lD39Q;
            DSbEE:
            $this->response->write();
            goto Cx7g1;
            kXsXa:
            $this->response->success("\116\157\40\x44\141\x74\141\40\106\157\x75\x6e\x64");
            goto DSbEE;
            lD39Q:
        }
        goto QLyCo;
        LysaL:
        return true;
        goto wEnH2;
        wEnH2:
    }
    public function bundle_save()
    {
        goto Pl92M;
        FY90Q:
        $this->load->library("\x66\x6f\x72\155\137\x76\141\154\151\x64\x61\x74\x69\157\156");
        goto lqGKo;
        CtDwc:
        if ($this->form_validation->run() == FALSE) {
            goto Cc7QB;
            FRYg2:
            $this->response->write();
            goto jwaYG;
            jwaYG:
            return false;
            goto C2DLY;
            Cc7QB:
            $this->response->error(validation_errors());
            goto FRYg2;
            C2DLY:
        }
        goto SJNhe;
        SJNhe:
        if ($bomId = $this->bomModel->bundle_save($data)) {
            $this->response->success("\123\125\103\103\x45\123\x53\x5f\123\101\x56\x45");
            $this->response->set_data("\151\144", $bomId);
        }
        goto FCgzJ;
        NKKGq:
        return true;
        goto i8hoL;
        Pl92M:
        $_POST = $data = $this->request->post();
        goto FY90Q;
        FCgzJ:
        $this->response->write();
        goto NKKGq;
        lqGKo:
        $this->form_validation->set_rules("\x62\157\x6d\116\x61\155\x65", "\102\151\x6c\154\40\117\146\40\x4d\x61\x74\x65\x72\x69\x61\154\x20\x6e\x61\x6d\145", "\x74\x72\x69\155\174\x72\x65\x71\165\151\162\145\x64\174\x75\156\x69\x71\x75\x65\145\x5f\164\157\x5f\143\157\x6d\160\x61\156\171\133\x62\x6f\155\x2e\142\157\x6d\116\141\x6d\145\x5d");
        goto CtDwc;
        i8hoL:
    }
    public function bundle_delete($id)
    {
        goto CLDWd;
        CLDWd:
        $res = $this->bomModel->bundle_delete($id);
        goto sDfW1;
        HdRzZ:
        return false;
        goto MHaVg;
        sDfW1:
        if ($res) {
            goto Et0m6;
            z5iio:
            return true;
            goto P0xKE;
            ESvT0:
            $this->response->write();
            goto z5iio;
            Et0m6:
            $this->response->success("\x44\x65\x6c\x65\164\x65\144\x20\x53\x75\143\x63\x65\x73\x73\x66\x75\154\154\171");
            goto ESvT0;
            P0xKE:
        }
        goto GLJcO;
        QrPlN:
        $this->response->write();
        goto HdRzZ;
        GLJcO:
        $this->response->error();
        goto QrPlN;
        MHaVg:
    }
}
