<?php
/*
Generated by OutputBooks Team
*/

defined("\x42\101\x53\105\x50\x41\124\x48") or exit("\116\157\x20\144\x69\x72\145\x63\x74\x20\163\x63\x72\151\160\164\40\141\x63\143\145\163\163\x20\141\154\x6c\157\x77\145\144");
class UpdateModel extends MY_Model
{
    public $message = '';
    private $_release_url = "\x68\x74\x74\x70\72\x2f\x2f\167\x77\x77\x2e\x6f\165\x74\160\165\164\142\x6f\x6f\153\163\x2e\x63\x6f\155\x2f\x72\x65\x6c\x65\141\163\x65\x2f";
    private $backup_dir = '';
    private $temp_dir = '';
    private $isCloud = false;
    public $plugin = '';
    public $filePrefix = "\117\165\x74\160\x75\164\102\157\x6f\153\163\55\x50\141\164\x63\x68\55\166";
    public $curVersion = '';
    public $fcPath = '';
    function __construct()
    {
        goto TuD01;
        TuD01:
        parent::__construct();
        goto smC99;
        To42Z:
        $this->fcPath = FCPATH;
        goto e8qiJ;
        e8qiJ:
        $this->cId = get_company("\151\x64");
        goto LTxww;
        smC99:
        $this->curVersion = OB_VERSION;
        goto To42Z;
        LTxww:
        $this->temp_dir = TMP_PATH;
        goto oyV6x;
        oyV6x:
        $this->isCloud = isCloud();
        goto YOtJf;
        YOtJf:
    }
    public function get_actkey()
    {
        goto sF3nN;
        ir_UQ:
        $result = $this->db->select("\141\143\164\x4b\145\171")->from("\141\x63\x74\x69\x76\x61\164\x69\x6f\x6e\x6b\x65\171")->where(array("\x75\111\144" => $uId, "\141\x63\x74\113\145\171\40\x21\75\40" => ''))->get()->row_array();
        goto KSnFh;
        KSnFh:
        if (!empty($result) && !empty($result["\x61\x63\x74\113\x65\171"])) {
            return $result["\x61\x63\164\113\x65\171"];
        }
        goto arwLy;
        arwLy:
        return '';
        goto zzBno;
        sF3nN:
        $uId = get_user_data("\x70\x72\x69\x6d\x55\x73\x65\x72\151\x64", true);
        goto ir_UQ;
        zzBno:
    }
    public function activate()
    {
        goto rm3D0;
        JVEl2:
        $licenseKey = get_user_data("\154\x69\143\x65\156\163\x65\x4b\x65\171", true);
        goto HmA4v;
        zHIYh:
        $res = $this->ob_license->activate($licenseKey);
        goto d0AR1;
        d0AR1:
        if ($res === false) {
            goto W5bDL;
            W5bDL:
            $ret["\162\145\x71\113\x65\171"] = $this->ob_license->reqKey;
            goto aIk0U;
            aIk0U:
            $ret["\141\143\x74\125\162\x6c"] = $this->ob_license->actUrl;
            goto ofW_P;
            ofW_P:
            $this->message = $this->ob_license->message;
            goto SRTNt;
            SRTNt:
        } else {
            goto cHnS3;
            cHnS3:
            $actKey = $res;
            goto gHSnn;
            R4032:
            $id = $this->activationkey_table->save($actData);
            goto TC6Js;
            b3wjl:
            $this->load->library("\141\x63\164\151\x76\x61\x74\151\157\x6e\153\x65\x79\x5f\164\141\x62\x6c\145");
            goto R4032;
            gHSnn:
            $ret["\x61\143\164\x4b\x65\171"] = $actKey;
            goto PFVLA;
            PFVLA:
            $uId = get_company("\x70\x72\151\155\125\163\145\x72\x69\144", true);
            goto ipT3o;
            ipT3o:
            $actData = array("\165\111\144" => $uId, "\x61\x63\164\x4b\x65\171" => $actKey);
            goto b3wjl;
            TC6Js:
        }
        goto j3x7B;
        BLVEN:
        if (!empty($actKey)) {
            $isActive = $this->ob_license->is_activated($licenseKey, $actKey);
            if ($isActive) {
                $this->message = "\104\x65\166\x69\x63\x65\40\x61\154\162\x65\141\144\171\x20\141\143\x74\151\166\x65\x2e";
                return false;
            }
        }
        goto zHIYh;
        XFJgv:
        $this->load->library("\157\142\x5f\x6c\x69\x63\x65\156\x73\x65");
        goto JVEl2;
        HmA4v:
        $actKey = $this->get_actkey();
        goto BLVEN;
        rm3D0:
        $ret = array();
        goto XFJgv;
        j3x7B:
        return $ret;
        goto IQqq3;
        IQqq3:
    }
    public function get_latest($isBeta = 0)
    {
        goto nMmkU;
        c3bdr:
        $lk = get_user_data("\154\151\143\145\156\x73\145\x4b\x65\x79");
        goto rBVH4;
        gq6S4:
        if (empty($content)) {
            $this->message .= "\126\145\162\x73\x69\157\x6e\40\x75\x72\x6c\40\162\x65\164\165\x72\156\x20\145\155\160\164\x79\56";
            return false;
        }
        goto l0Xfu;
        SO36U:
        $output = $this->download_curl($url, array("\154\153" => $lk));
        goto cqF0C;
        z3m3c:
        if (!empty($output)) {
            if (is_file($output)) {
                $content = @file_get_contents($output);
            } else {
                $content = $output;
            }
        }
        goto gq6S4;
        l0Xfu:
        return $content;
        goto oGRKj;
        nMmkU:
        $this->message = '';
        goto d6dtP;
        Wxkks:
        if ($this->plugin) {
            $url .= "\x70\x6c\165\147\x69\156\75" . $this->plugin . "\46";
        }
        goto c3bdr;
        d6dtP:
        $url = $this->_release_url . "\x69\x6e\x64\145\x78\56\160\x68\160\77" . ($isBeta ? "\x62\145\164\x61\x3d\x31\x26" : '');
        goto Wxkks;
        cqF0C:
        $content = '';
        goto z3m3c;
        rBVH4:
        if (empty($lk)) {
            $this->message .= "\x4c\x69\143\x65\x6e\x73\x65\x20\113\145\x79\40\115\x69\x73\163\x69\x6e\147\56";
            return false;
        }
        goto SO36U;
        oGRKj:
    }
    public function get_latest_local()
    {
        goto bbsvo;
        bbsvo:
        $zipList = glob($this->temp_dir . $this->filePrefix . "\52\x2e\172\x69\160");
        goto jeLTF;
        RQPOF:
        $this->message = "\x4e\x6f\x20\x6e\145\167\40\x76\x65\x72\163\x69\157\x6e\40\x66\157\x75\x6e\144\x20\x69\156\x20\154\157\x63\141\154";
        goto x98f_;
        jeLTF:
        if (count($zipList) > 0) {
            goto MD498;
            MD498:
            $zipList = array_reverse($zipList);
            goto sp6Q6;
            wanPQ:
            $v = str_replace(array($this->filePrefix, "\x2e\x7a\151\x70"), '', $fileName);
            goto lwH5R;
            fMCyl:
            $fileName = basename($file);
            goto wanPQ;
            lwH5R:
            if (version_compare($v, $this->curVersion) > 0) {
                return $v;
            }
            goto F1doL;
            sp6Q6:
            $file = $zipList[0];
            goto fMCyl;
            F1doL:
        }
        goto RQPOF;
        x98f_:
        return false;
        goto JKvUR;
        JKvUR:
    }
    public function update_obooks_local($v = '', $skipBackup = false)
    {
        goto jpzs9;
        jpzs9:
        ini_set("\155\145\x6d\157\x72\171\137\x6c\x69\155\151\164", "\x2d\x31");
        goto y_T1s;
        FVkfd:
        $file = $this->temp_dir . $this->filePrefix . $v . "\x2e\x7a\x69\160";
        goto FEibd;
        FEibd:
        if (!is_file($file)) {
            $this->message = "\x50\x61\164\x63\x68\x20\156\157\x74\x20\x66\x6f\x75\156\144\40\146\157\162\x20" . $v;
            return false;
        }
        goto iT6Vh;
        y_T1s:
        set_time_limit(0);
        goto sLWfO;
        sLWfO:
        if (!$v && !($v = $this->get_latest_local())) {
            return;
        }
        goto FVkfd;
        iT6Vh:
        return $this->after_download($file, $skipBackup);
        goto tM2B6;
        tM2B6:
    }
    public function update_obooks($v = '', $skipBackup = false)
    {
        goto hc2Rv;
        GXU3n:
        if (version_compare($v, $this->curVersion) <= 0) {
            $this->message = "\x41\154\162\x65\141\x64\x79\x20\125\x70\164\157\x20\104\x61\164\145\x2e";
            return false;
        }
        goto BW_yk;
        Ofwcg:
        return $this->after_download($file, $skipBackup);
        goto rwWKK;
        k4LSr:
        if (!$v) {
            $v = $this->get_latest();
        }
        goto GXU3n;
        BW_yk:
        $file = $this->download_patch($v);
        goto Ofwcg;
        QoQV5:
        set_time_limit(0);
        goto k4LSr;
        hc2Rv:
        ini_set("\155\145\x6d\157\x72\x79\x5f\154\151\155\x69\164", "\x2d\x31");
        goto QoQV5;
        rwWKK:
    }
    private function after_download($file, $skipBackup = false)
    {
        goto epfQD;
        epfQD:
        if (!$file) {
            $this->message = "\x4e\145\x77\x20\166\x65\x72\x73\151\157\x6e\40\x66\x69\154\145\40\x6e\x6f\x74\x20\x66\157\165\156\x64\56";
            return false;
        }
        goto DVbtO;
        DVbtO:
        try {
            goto FEVjM;
            L2aeq:
            $this->directory_copy($srcPath, $this->fcPath);
            goto pmSsA;
            FEVjM:
            $srcPath = $this->extract($file);
            goto MAQbs;
            UFti9:
            $this->update_db($srcPath . "\57\144\141\x74\x61\142\x61\x73\x65\x2e\160\x68\x70");
            goto L2aeq;
            MAQbs:
            if (!$skipBackup && !$this->backup()) {
                $this->message .= "\x42\x61\143\x6b\x75\160\x20\106\x61\x69\154\x65\144\x2e";
                return false;
            }
            goto UFti9;
            pmSsA:
            $this->delete_files($srcPath, true);
            goto YjFgF;
            YjFgF:
            @rmdir($srcPath);
            goto JnNV_;
            JnNV_:
            unlink($file);
            goto NnptR;
            NnptR:
        } catch (Exception $e) {
            $this->message .= $e->getMessage();
            return false;
        }
        goto mdmas;
        mdmas:
        return true;
        goto rhBPX;
        rhBPX:
    }
    private function download_patch($v = '')
    {
        goto OPLtT;
        OPLtT:
        $fileName = $this->filePrefix . $v . "\x2e\x7a\x69\160";
        goto IkccY;
        Qp54v:
        $patch_url .= defined("\123\110\x41\122\x45\104\137\110\x4f\123\124") ? "\163\x68\141\x72\x65\x64\x3d\61\46" : '';
        goto XVnj6;
        f9N8W:
        $patch_url .= "\165\x75\151\x64\x3d" . $uuid . "\x26";
        goto AEB6B;
        Qwg_1:
        $uid = get_user_data("\160\162\151\155\125\163\145\x72\x69\144");
        goto YNz1q;
        YNz1q:
        $patch_url = $this->_release_url . "\151\156\x64\x65\170\x2e\x70\x68\160\77";
        goto qf15r;
        AEB6B:
        if ($this->plugin) {
            $patch_url .= "\160\x6c\165\147\151\x6e\x3d" . $this->plugin . "\x26";
        }
        goto q2R8M;
        XVnj6:
        $patch_url .= "\x75\x69\x64\x3d" . $uid . "\46";
        goto f9N8W;
        q2R8M:
        return $this->download_curl($patch_url, null, $fileName);
        goto ZykMG;
        IkccY:
        $this->load->library("\x6f\x62\137\x6c\151\x63\145\156\163\145");
        goto y1qbV;
        y1qbV:
        $uuid = $this->ob_license->get_uuid();
        goto Qwg_1;
        qf15r:
        $patch_url .= "\x76\75" . $v . "\46";
        goto Qp54v;
        ZykMG:
    }
    private function download_curl($url = '', $post = null, $file = '', $output = '')
    {
        goto HZadK;
        TXy5q:
        $result = curl_exec($ch);
        goto GvUDE;
        HZadK:
        if (empty($url)) {
            return false;
        }
        goto qJZvz;
        apagt:
        if ($file) {
            return $output;
        }
        goto UqiR0;
        AEzP6:
        $curlOpt = array(CURLOPT_HTTPHEADER => array("\x43\x61\143\150\145\55\103\157\x6e\x74\162\x6f\154\72\x20\156\157\55\143\141\x63\150\145", "\x43\x6f\156\156\145\x63\164\x69\157\156\72\40\153\145\x65\x70\55\141\154\151\166\145", "\x50\162\x61\147\155\x61\72\x20\x6e\157\x2d\143\x61\143\x68\145"), CURLOPT_USERAGENT => "\117\165\x74\160\x75\164\102\157\x6f\153\x73", CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_RETURNTRANSFER => true);
        goto l8Vsj;
        lkNza:
        if ($file) {
            fclose($fp);
        }
        goto Wfdmo;
        l8Vsj:
        if (!empty($post)) {
            $curlOpt[CURLOPT_POST] = true;
            $curlOpt[CURLOPT_POSTFIELDS] = $post;
        } else {
            if ($file) {
                goto M7p0G;
                cxJKq:
                $curlOpt[CURLOPT_FILE] = $fp;
                goto apOih;
                e43Bz:
                $curlOpt[CURLOPT_HTTPHEADER][] = "\103\157\156\164\145\x6e\164\x2d\124\x79\x70\x65\72\40\141\160\160\154\151\143\x61\164\x69\x6f\156\57\x78\x2d\x77\x77\x77\x2d\146\x6f\x72\x6d\x2d\x75\162\154\145\x6e\143\x6f\144\x65\144\73\40\143\150\141\x72\163\x65\164\75\x55\x54\x46\55\x38";
                goto cxJKq;
                M7p0G:
                $fp = fopen($output, "\167\53");
                goto e43Bz;
                apOih:
            }
        }
        goto nc46L;
        oAWp0:
        if (is_file($output)) {
            @unlink($output);
        }
        goto yboJg;
        qJZvz:
        if (empty($output)) {
            $output = $this->temp_dir . $file;
        }
        goto oAWp0;
        nc46L:
        curl_setopt_array($ch, $curlOpt);
        goto TXy5q;
        UqiR0:
        return $result;
        goto ZwC2b;
        yboJg:
        $ch = curl_init(str_replace("\40", "\45\x32\x30", $url));
        goto AEzP6;
        GvUDE:
        $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        goto okQRp;
        Wfdmo:
        if ($httpcode != 200) {
            goto ElZnG;
            lCVyN:
            @unlink($output);
            goto Nc9N_;
            ElZnG:
            $this->message .= @file_get_contents($output);
            goto lCVyN;
            Nc9N_:
            return false;
            goto FsqWK;
            FsqWK:
        }
        goto apagt;
        okQRp:
        curl_close($ch);
        goto lkNza;
        ZwC2b:
    }
    private function extract($file = '', $to = '')
    {
        goto OvsE1;
        gRCBT:
        if (!$to) {
            $to = $this->temp_dir . "\x4f\x75\x74\160\x75\164\102\x6f\157\153\x73\x2d" . time();
        }
        goto ai96e;
        OLu9u:
        if ($zip->open($file) === true) {
            goto xLTxU;
            xLTxU:
            $zip->extractTo($to);
            goto iJWep;
            LSEeI:
            @chmod($to, 0777);
            goto kQuYI;
            iJWep:
            $zip->close();
            goto LSEeI;
            kQuYI:
            return $to;
            goto D_wLi;
            D_wLi:
        }
        goto XsI_4;
        ai96e:
        $zip = new ZipArchive();
        goto OLu9u;
        OvsE1:
        if (!$file) {
            return false;
        }
        goto gRCBT;
        XsI_4:
        return false;
        goto DMTKV;
        DMTKV:
    }
    private function directory_copy($srcdir = '', $dstdir = '')
    {
        goto sahii;
        RRhvy:
        if (!is_dir($dstdir)) {
            mkdir($dstdir, 0777, true);
        }
        goto qdXD3;
        Pi0wO:
        $dstdir = rtrim($dstdir, DS);
        goto RRhvy;
        wDByg:
        foreach ($dir_map as $object_key => $object_value) {
            if (is_numeric($object_key)) {
                copy($srcdir . DS . $object_value, $dstdir . DS . $object_value);
            } else {
                $this->directory_copy($srcdir . DS . $object_key, $dstdir . DS . $object_key);
            }
            et90Z:
        }
        goto sZSDq;
        sZSDq:
        QlDvr:
        goto qcBHY;
        qcBHY:
        return true;
        goto Z1xcG;
        e0RpZ:
        $srcdir = rtrim($srcdir, DS);
        goto Pi0wO;
        sahii:
        if (!$srcdir || !$dstdir) {
            return false;
        }
        goto e0RpZ;
        qdXD3:
        $dir_map = $this->directory_map($srcdir);
        goto wDByg;
        Z1xcG:
    }
    private function directory_map($source_dir, $directory_depth = 0, $hidden = FALSE)
    {
        if ($fp = @opendir($source_dir)) {
            goto UOi6h;
            NlTXZ:
            goto HXut9;
            goto GntUV;
            GntUV:
            G0fhA:
            goto qUdk8;
            UOi6h:
            $filedata = array();
            goto soc56;
            nXuf8:
            $source_dir = rtrim($source_dir, DS) . DS;
            goto fXsUz;
            QLcHS:
            if (!(FALSE !== ($file = readdir($fp)))) {
                goto G0fhA;
            }
            goto s6x60;
            WTg08:
            if (($directory_depth < 1 or $new_depth > 0) && @is_dir($source_dir . $file)) {
                $filedata[$file] = $this->directory_map($source_dir . $file . DS, $new_depth, $hidden);
            } else {
                $filedata[] = $file;
            }
            goto NlTXZ;
            s6x60:
            if (!trim($file, "\56") or $hidden == FALSE && $file[0] == "\x2e") {
                goto HXut9;
            }
            goto WTg08;
            fXsUz:
            HXut9:
            goto QLcHS;
            soc56:
            $new_depth = $directory_depth - 1;
            goto nXuf8;
            qUdk8:
            closedir($fp);
            goto Lij6p;
            Lij6p:
            return $filedata;
            goto eVdiE;
            eVdiE:
        }
        return FALSE;
    }
    private function delete_files($path, $del_dir = FALSE, $level = 0)
    {
        goto GjIY9;
        zi1MG:
        return TRUE;
        goto o7h50;
        gCuKW:
        pRKR8:
        goto MgSUt;
        uoCSd:
        goto KcEva;
        goto gCuKW;
        BFSXE:
        if (!($current_dir = @opendir($path))) {
            return FALSE;
        }
        goto Lz2GL;
        q5d5o:
        if ($filename != "\56" and $filename != "\x2e\x2e") {
            if (is_dir($path . DS . $filename)) {
                if (substr($filename, 0, 1) != "\x2e") {
                    $this->delete_files($path . DS . $filename, $del_dir, $level + 1);
                }
            } else {
                unlink($path . DS . $filename);
            }
        }
        goto uoCSd;
        MgSUt:
        @closedir($current_dir);
        goto imGVv;
        imGVv:
        if ($del_dir == TRUE and $level > 0) {
            return @rmdir($path);
        }
        goto zi1MG;
        Lz2GL:
        KcEva:
        goto flsQj;
        flsQj:
        if (!(FALSE !== ($filename = @readdir($current_dir)))) {
            goto pRKR8;
        }
        goto q5d5o;
        GjIY9:
        $path = rtrim($path, DS);
        goto BFSXE;
        o7h50:
    }
    public function get_backup_list()
    {
        goto l8i3A;
        l8i3A:
        $backup_list = scandir(BACKUP_PATH, 1);
        goto hrzm9;
        xx1C5:
        foreach ($backup_list as $val) {
            goto z6haY;
            z6haY:
            if ($val == "\56" || $val == "\56\56") {
                goto cYSkS;
            }
            goto rKtyJ;
            UTbWo:
            $list[] = array("\166\145\x72\x73\151\157\x6e" => $matches[1], "\x64\x61\164\145" => $matches[5]);
            goto XiqEO;
            SR8W9:
            if (empty($matches) || count($matches) != 6 || $matches[1] >= $this->curVersion) {
                goto cYSkS;
            }
            goto UTbWo;
            rKtyJ:
            preg_match("\57\136\117\x75\x74\x70\x75\x74\x42\157\157\x6b\163\55\142\x61\143\x6b\x75\160\x2d\50\50\x5c\144\53\51\x2e\x28\x5c\144\53\51\56\x28\x5c\144\x2b\51\51\55\50\56\52\x29\56\172\151\x70\57", $val, $matches);
            goto SR8W9;
            XiqEO:
            cYSkS:
            goto BuWqi;
            BuWqi:
        }
        goto oVQjh;
        hrzm9:
        $backup_file = "\117\165\164\x70\165\164\102\157\157\x6b\x73\x2d\142\x61\143\153\165\160\55" . $this->curVersion . "\x2d" . date("\x59\55\x6d\x2d\144\x2d\150\55\151\55\x73", time());
        goto KhLrc;
        QD6W5:
        return $list;
        goto IbLHu;
        KhLrc:
        $list = array();
        goto xx1C5;
        oVQjh:
        LCbFu:
        goto QD6W5;
        IbLHu:
    }
    private function get_backup_file($version = '')
    {
        goto IE0Xg;
        k0BXg:
        if (!empty($list) && $list[0]) {
            return basename($list[0]);
        }
        goto dlWkV;
        IE0Xg:
        $list = glob(BACKUP_PATH . "\x4f\165\x74\160\165\164\x42\x6f\x6f\x6b\163\55\x62\141\143\x6b\165\x70\x2d" . $version . "\52\x2e\x7a\151\x70");
        goto k0BXg;
        dlWkV:
        return false;
        goto qRdz3;
        qRdz3:
    }
    public function revert($version = '')
    {
        goto jr_kM;
        jr_kM:
        if (!$version) {
            $this->message = "\126\145\162\163\x69\x6f\x6e\40\155\x69\x73\163\x69\x6e\147\x2e";
            return false;
        }
        goto NZ7C9;
        NZ7C9:
        $fileName = $this->get_backup_file($version);
        goto vvpR0;
        dr4hs:
        $tmp_dir = TMP_PATH;
        goto sFMD5;
        vvpR0:
        if (!$fileName) {
            $this->message = "\x42\141\143\x6b\x75\160\x20\x66\x69\x6c\145\40\146\x6f\162\x20\166" . $version . "\40\x69\x73\40\156\x6f\x74\x20\145\170\151\x73\164\x2e";
            return false;
        }
        goto IhwBI;
        sFMD5:
        try {
            goto jf_gA;
            HO2y1:
            $to_folder = $tmp_dir . str_replace("\56\172\151\x70", '', $fileName);
            goto sHjLh;
            uQ_Tf:
            $this->directory_copy($to_folder, $this->fcPath);
            goto P4n28;
            YTQVR:
            unlink($tmp_dir . $fileName);
            goto wgdAR;
            jf_gA:
            copy($backup_dir . $fileName, $tmp_dir . $fileName);
            goto HO2y1;
            wgdAR:
            return true;
            goto C8oIB;
            P4n28:
            $this->delete_files($to_folder, true);
            goto EqFcn;
            EqFcn:
            @rmdir($to_folder);
            goto YTQVR;
            sHjLh:
            $this->extract($tmp_dir . $fileName, $to_folder);
            goto uQ_Tf;
            C8oIB:
        } catch (Exception $ex) {
            $this->message = $ex->getMessage();
            return false;
        }
        goto fl5jT;
        IhwBI:
        $backup_dir = BACKUP_PATH;
        goto dr4hs;
        fl5jT:
    }
    public function backup($type = "\106")
    {
        goto cUpSR;
        wRT7f:
        $sqlFile = $this->backup_db($this->fcPath, $type);
        goto aAmC5;
        aAmC5:
        $files_to_zip = array();
        goto S7Lk2;
        cUpSR:
        $backup_file = "\117\x75\x74\x70\x75\x74\x42\157\x6f\x6b\x73\x2d\x62\x61\143\153\165\160\x2d" . $this->curVersion . "\x2d" . date("\x59\x2d\x6d\x2d\x64\x2d\150\x2d\x69\x2d\163", time());
        goto ojzVN;
        S7Lk2:
        $exclude = array($this->fcPath . "\x61\x70\x70\x6c\151\143\x61\164\151\x6f\156\x2f\x6c\x6f\147\x73", $this->fcPath . "\x61\160\160\154\x69\x63\x61\164\x69\157\156\57\164\150\151\162\144\137\x70\x61\162\x74\x79\57\150\x74\155\154\62\x70\x64\x66", $this->fcPath . "\141\x70\160\x6c\151\x63\141\x74\151\157\x6e\57\x74\150\x69\162\144\x5f\160\141\x72\x74\x79\x2f\x6d\160\144\x66");
        goto RmWCQ;
        TPcNl:
        $this->directoryToArray($this->fcPath . "\141\x73\163\145\164\x73\57\x61\160\160", true, $files_to_zip);
        goto jWgQe;
        ojzVN:
        $backup_dir = BACKUP_PATH . $backup_file . DS;
        goto Zuyae;
        EKsX3:
        if ($result) {
            unlink($sqlFile);
            @rmdir($backup_dir);
        }
        goto QXoTz;
        RmWCQ:
        $this->directoryToArray($this->fcPath . "\x61\x70\x70\154\x69\x63\x61\x74\x69\x6f\x6e", true, $files_to_zip, $exclude);
        goto TPcNl;
        QXoTz:
        return $result;
        goto g0Rp2;
        K3NQK:
        $result = $this->create_zip($files_to_zip, BACKUP_PATH . $backup_file . "\56\172\x69\x70", false, $this->fcPath);
        goto EKsX3;
        jWgQe:
        $files_to_zip[] = $sqlFile;
        goto K3NQK;
        Zuyae:
        if (!is_dir($backup_dir)) {
            mkdir($backup_dir, 0777, true);
            $backup_dir = $backup_dir;
        }
        goto wRT7f;
        g0Rp2:
    }
    function directoryToArray($directory, $recursive, &$array_items, $exclude = null)
    {
        if ($handle = opendir($directory)) {
            goto FfHHT;
            Seme6:
            if ($file != "\56" && $file != "\56\56" && $file != "\x54\x68\x75\155\142\x73\56\144\x62" && $file != "\145\x72\x72\x6f\162\x5f\x6c\x6f\147") {
                if (is_dir($directory . "\57" . $file)) {
                    if ($exclude && in_array($directory . "\x2f" . $file, $exclude)) {
                        goto ZF0Yq;
                    }
                    if ($recursive) {
                        $this->directoryToArray($directory . "\x2f" . $file, $recursive, $array_items, $exclude);
                    }
                } else {
                    $file = $directory . "\x2f" . $file;
                    $array_items[] = preg_replace("\x2f\134\x2f\134\x2f\x2f\163\x69", "\57", $file);
                }
            }
            goto IyLh9;
            FfHHT:
            ZF0Yq:
            goto Atc0O;
            QwTjb:
            closedir($handle);
            goto n_iJ5;
            s5EF2:
            C0vvE:
            goto QwTjb;
            Atc0O:
            if (!(false !== ($file = readdir($handle)))) {
                goto C0vvE;
            }
            goto Seme6;
            IyLh9:
            goto ZF0Yq;
            goto s5EF2;
            n_iJ5:
        }
    }
    function create_zip($files = array(), $destination = '', $overwrite = false, $prefix = '')
    {
        goto mUQeQ;
        mUQeQ:
        if (file_exists($destination) && !$overwrite) {
            return false;
        }
        goto KdVoO;
        KdVoO:
        $valid_files = array();
        goto VRZqy;
        VRZqy:
        if (is_array($files)) {
            foreach ($files as $file) {
                if (file_exists($file)) {
                    $valid_files[] = $file;
                }
                GilQQ:
            }
            LS0Ym:
        }
        goto BtGJD;
        BtGJD:
        if (count($valid_files)) {
            goto nkqxS;
            nkqxS:
            $zip = new ZipArchive();
            goto sewph;
            klnK_:
            $zip->close();
            goto qgxSj;
            qgxSj:
            return file_exists($destination);
            goto jEQGF;
            sewph:
            if ($zip->open($destination, $overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) {
                return false;
            }
            goto G9l_x;
            KlhtG:
            pfi0e:
            goto klnK_;
            G9l_x:
            foreach ($valid_files as $file) {
                if ($prefix) {
                    $zip->addFile($file, str_replace($prefix, '', $file));
                } else {
                    $zip->addFile($file, $file);
                }
                An1YB:
            }
            goto KlhtG;
            jEQGF:
        } else {
            return false;
        }
        goto lntDL;
        lntDL:
    }
    public function backup_db($path = '', $type = "\x46")
    {
        goto oz2aU;
        AyzRA:
        $this->dumpDB($path . $fname, $type, $conn);
        goto GAFDL;
        GAFDL:
        if ($type == "\x57") {
            $this->update_ack("\104\102\40\x42\x61\x63\x6b\165\x70\x20\142\x79\x20\x63\x72\157\156\x20\x77\x65\145\153\x6c\x79\40\x62\x61\x63\x6b\165\x70\40", true);
        } else {
            $this->update_ack("\x44\x42\x20\102\x61\143\153\x75\160\40\x62\x79\40\x55\160\144\x61\x74\145\40\x53\143\162\x69\x70\164\40", true);
        }
        goto CW3Bg;
        L30jk:
        $conn = $this->db->db_connect();
        goto AyzRA;
        CW3Bg:
        return $path . $fname;
        goto TfEwG;
        oz2aU:
        $fname = $this->db->database . "\56\163\x71\154";
        goto L30jk;
        TfEwG:
    }
    public function dumpDB($file = '', $type = "\106", &$conn = null)
    {
        goto q6s2s;
        Ez1eN:
        @chmod($file, 0777);
        goto j1wiB;
        rAa7i:
        if (defined("\x41\x50\x50\x5f\x43\x4c\x44") && APP_CLD) {
            $ignoreTables[] = "\x6f\142\137\154\151\143\x65\156\x73\145\x6b\145\x79";
        }
        goto WQ0H5;
        eDKAI:
        $this->backup_procedures($conn, $this->db->database, $file);
        goto YTU7q;
        wdE9b:
        if ($type == "\127") {
            $ignoreTables[] = "\157\x62\x5f\x75\163\x65\x72\141\x63\x63\145\163\x73";
            $ignoreTables[] = "\157\x62\x5f\164\162\x61\156\x73\137\154\x6f\x67";
        }
        goto rAa7i;
        I0eo5:
        file_put_contents($file, "\x53\x45\124\x20\147\154\157\x62\141\154\40\x73\x71\x6c\137\155\157\x64\x65\x3d\47\47\x3b" . PHP_EOL . PHP_EOL, FILE_APPEND);
        goto fdLGy;
        Zh_wq:
        $ignoreTables = array("\157\x62\137\163\145\x73\x73\151\157\156\163", "\157\x62\137\143\x69\164\x69\145\x73", "\157\142\x5f\x65\x63\x5f\x73\x65\163\x73\x69\157\x6e\x73");
        goto wdE9b;
        WQ0H5:
        file_put_contents($file, "\55\55\x20\117\x75\164\x70\x75\x74\102\x6f\157\153\163\40\102\141\143\153\x75\x70" . PHP_EOL . PHP_EOL);
        goto I0eo5;
        Mw64Q:
        if (!($table = mysqli_fetch_row($query))) {
            goto zMqvK;
        }
        goto uy_nk;
        f4Fta:
        Mg4yO:
        goto Mw64Q;
        iJjaT:
        goto Mg4yO;
        goto GzHtn;
        Cbenj:
        file_put_contents($file, "\123\x45\124\40\x66\157\x72\145\x69\x67\156\x5f\x6b\145\171\137\143\150\x65\x63\x6b\x73\75\61\x3b" . PHP_EOL . PHP_EOL, FILE_APPEND);
        goto Ez1eN;
        fdLGy:
        file_put_contents($file, "\123\105\x54\x20\146\157\x72\x65\151\x67\156\137\x6b\x65\171\137\143\x68\x65\143\153\x73\x3d\x30\x3b" . PHP_EOL . PHP_EOL, FILE_APPEND);
        goto eDKAI;
        t9JbY:
        if (!$conn) {
            $conn = $this->db->db_connect();
        }
        goto Zh_wq;
        uy_nk:
        if (strpos($table[0], "\157\x62\x5f") !== false) {
            $this->backup_table($conn, $table[0], $ignoreTables, $file);
        }
        goto iJjaT;
        YTU7q:
        $query = mysqli_query($conn, "\123\110\117\127\40\x54\101\102\x4c\105\x53\73");
        goto f4Fta;
        q6s2s:
        if (!$file) {
            return false;
        }
        goto t9JbY;
        GzHtn:
        zMqvK:
        goto Cbenj;
        j1wiB:
    }
    private function backup_procedures(&$conn, $database = '', $file = '')
    {
        goto RRUGy;
        hZ1IR:
        if (!empty($file) && !empty($queryContent)) {
            file_put_contents($file, $queryContent . PHP_EOL, FILE_APPEND);
            return TRUE;
        }
        goto UydH5;
        TAVZj:
        $queryContent = '';
        goto SAbo1;
        SAbo1:
        if ($cnt > 0) {
            $queryContent .= "\x44\105\x4c\x49\x4d\x49\x54\105\x52\x20\x3b\73" . PHP_EOL;
        }
        goto vLhWG;
        Cq5Ar:
        goto b7cWn;
        goto Soh2q;
        RRUGy:
        $query = mysqli_query($conn, "\x53\105\x4c\x45\x43\124\x20\122\117\x55\124\x49\x4e\105\x5f\116\101\x4d\x45\x2c\x20\122\x4f\125\124\x49\x4e\105\x5f\124\x59\x50\x45\40\106\122\117\115\40\x69\x6e\x66\157\162\x6d\141\164\151\157\156\137\x73\143\150\x65\155\141\x2e\x52\117\x55\124\111\x4e\105\x53\40\x57\110\x45\x52\x45\x20\x52\x4f\125\124\111\x4e\105\137\x53\103\x48\105\x4d\101\75\42" . $database . "\42\x3b");
        goto i0cZQ;
        g7fPp:
        if (!($row = mysqli_fetch_assoc($query_create_procedure))) {
            goto Afdf6;
        }
        goto xDfwh;
        rN7r3:
        $queryContent .= PHP_EOL . "\x44\x52\x4f\120\40" . $procedure["\122\x4f\125\124\x49\x4e\x45\x5f\124\131\x50\x45"] . "\x20\111\106\40\105\130\x49\x53\x54\123\x20\140" . $procedure["\x52\117\125\x54\111\x4e\x45\137\x4e\101\x4d\x45"] . "\140\x3b\73" . PHP_EOL;
        goto AtiOz;
        UydH5:
        return $queryContent;
        goto H2JNA;
        xDfwh:
        switch ($procedure["\x52\117\125\x54\x49\x4e\x45\137\x54\131\120\105"]) {
            case "\x46\125\x4e\x43\124\111\x4f\x4e":
                if (!empty($row["\x43\162\145\141\164\145\x20\x46\165\156\x63\164\x69\x6f\156"])) {
                    $queryContent .= preg_replace("\57\x43\122\x45\101\x54\x45\40\x44\105\x46\x49\116\105\122\50\x2e\x2a\x29\x46\x55\116\103\124\x49\117\116\x20\x28\56\52\51\x2f", "\103\122\x45\101\x54\x45\40\x46\x55\116\103\124\x49\x4f\116\40\44\x32", $row["\x43\x72\145\141\164\x65\40\x46\x75\x6e\x63\x74\151\x6f\156"]) . "\73\x3b" . PHP_EOL;
                }
                goto nvBiO;
            case "\x50\122\117\103\x45\x44\x55\x52\105":
                if (!empty($row["\x43\x72\x65\141\x74\145\40\x50\x72\x6f\143\x65\x64\165\x72\x65"])) {
                    $queryContent .= preg_replace("\57\103\x52\105\101\124\105\40\x44\x45\x46\x49\x4e\x45\x52\50\56\52\51\120\x52\117\103\105\104\x55\122\x45\x20\x28\56\x2a\51\x2f", "\103\x52\x45\x41\124\x45\40\x50\122\117\x43\x45\x44\x55\122\105\40\44\x32", $row["\x43\x72\145\x61\164\x65\x20\120\x72\157\143\145\x64\x75\x72\145"]) . "\x3b\73" . PHP_EOL;
                }
                goto nvBiO;
            default:
                goto nvBiO;
        }
        goto NLhYn;
        I7ALY:
        iqYiF:
        goto YB9az;
        yyBDP:
        if (!($procedure = mysqli_fetch_assoc($query))) {
            goto iqYiF;
        }
        goto rN7r3;
        vLhWG:
        DUCz_:
        goto yyBDP;
        i0cZQ:
        $cnt = mysqli_num_rows($query);
        goto TAVZj;
        grLUt:
        $query_create_procedure = mysqli_query($conn, $query_create_procedure);
        goto c3SY8;
        AtiOz:
        $query_create_procedure = "\123\110\117\127\x20\103\122\x45\101\x54\105\x20" . $procedure["\x52\117\x55\x54\x49\116\105\x5f\124\x59\120\x45"] . "\40" . $database . "\56" . $procedure["\x52\117\125\124\111\x4e\105\137\116\101\x4d\105"] . '';
        goto grLUt;
        YB9az:
        if ($cnt > 0) {
            $queryContent .= "\104\x45\x4c\x49\x4d\x49\124\105\122\40\x3b" . PHP_EOL;
        }
        goto hZ1IR;
        NLhYn:
        SrJDp:
        goto sSPLj;
        sSPLj:
        nvBiO:
        goto Cq5Ar;
        vTNdL:
        goto DUCz_;
        goto I7ALY;
        c3SY8:
        b7cWn:
        goto g7fPp;
        Soh2q:
        Afdf6:
        goto vTNdL;
        H2JNA:
    }
    private function get_create_table(&$conn, $table = '')
    {
        goto P2Lot;
        D5hp2:
        $return .= "\104\122\x4f\x50\40\x54\x41\102\114\x45\x20\x49\x46\40\x45\130\x49\123\x54\123\40\140" . $table . "\x60\x3b" . PHP_EOL;
        goto RzWGY;
        XMeMf:
        return $return;
        goto ibhE1;
        Gz53V:
        $result = mysqli_fetch_assoc($query);
        goto vQVcs;
        RzWGY:
        $query = mysqli_query($conn, "\123\110\117\127\40\x43\122\105\101\x54\x45\x20\x54\101\x42\114\x45\40\x60" . $table . "\x60");
        goto Gz53V;
        vQVcs:
        $return .= str_replace("\103\122\105\101\124\x45\x20\124\x41\x42\114\x45\x20", "\103\122\105\x41\x54\x45\x20\x54\101\102\114\105\40\111\x46\x20\116\117\124\x20\105\130\x49\x53\124\x53\40", $result["\103\x72\145\141\164\x65\x20\x54\x61\142\x6c\x65"]) . "\73";
        goto XMeMf;
        IEyDU:
        $return .= "\55\55" . PHP_EOL . "\x2d\55\40" . $table . PHP_EOL . "\x2d\x2d" . PHP_EOL . PHP_EOL;
        goto D5hp2;
        P2Lot:
        $return = PHP_EOL;
        goto IEyDU;
        ibhE1:
    }
    private function escape($str, $conn)
    {
        if (is_array($str)) {
            $str = array_map(array(&$this, "\x65\163\143\x61\160\145"), $str, $conn);
            return $str;
        } elseif (is_string($str) or is_object($str) && method_exists($str, "\x5f\x5f\164\x6f\x53\x74\x72\151\156\147")) {
            return "\47" . $this->escape_str($str, $conn) . "\47";
        } elseif (is_bool($str)) {
            return $str === FALSE ? 0 : 1;
        } elseif ($str === NULL) {
            return "\x4e\x55\x4c\x4c";
        }
        return $str;
    }
    public function escape_str($str, $conn)
    {
        goto FDR5R;
        jchdL:
        return $str;
        goto kc9cs;
        fh3uM:
        $str = mysqli_real_escape_string($conn, $str);
        goto jchdL;
        FDR5R:
        if (is_array($str)) {
            goto pGAt1;
            L3Kdf:
            return $str;
            goto EM0lx;
            pGAt1:
            foreach ($str as $key => $val) {
                $str[$key] = mysqli_real_escape_string($conn, $val);
                my6_V:
            }
            goto g8wVU;
            g8wVU:
            kGqlT:
            goto L3Kdf;
            EM0lx:
        }
        goto fh3uM;
        kc9cs:
    }
    private function backup_table(&$conn, $table = '', $ignoreTables = array(), $file = '')
    {
        goto GGmuS;
        rxcoZ:
        $limit = 20000;
        goto arLrE;
        X17H0:
        $from += $limit;
        goto DBAoR;
        QkWuy:
        if (!($j < $num_fields)) {
            goto twCOf;
        }
        goto bmXef;
        d5Xxg:
        $num_fields = count($fields);
        goto mnkCN;
        dcBuJ:
        $line = "\50";
        goto Eypt5;
        aGKTS:
        $tableDataQuery = mysqli_query($conn, $query);
        goto mJWNw;
        RsUIG:
        $i = 0;
        goto BDP3a;
        y50jn:
        $cnt = mysqli_num_rows($tableDataQuery);
        goto RsUIG;
        ZWhiO:
        if ($cnt < $limit) {
            goto zEJ_Y;
        }
        goto X17H0;
        erj8u:
        $from = 0;
        goto rxcoZ;
        TToS0:
        if (!($row = mysqli_fetch_assoc($tableDataQuery))) {
            goto T7WG2;
        }
        goto cS6ab;
        ww4WP:
        DCtrj:
        goto TToS0;
        Ch9IK:
        $fields[] = $field->name;
        goto ELIP4;
        S65Tf:
        uLH0s:
        goto QkWuy;
        GGmuS:
        if (!$table || !$file) {
            return false;
        }
        goto fp2xw;
        fp2xw:
        $return = $this->get_create_table($conn, $table) . PHP_EOL . PHP_EOL;
        goto t_319;
        Ejr5Q:
        goto DCtrj;
        goto lQC2z;
        mnkCN:
        $return = '';
        goto te_eQ;
        R_O8Y:
        if ($val === NULL) {
            $line .= "\116\125\114\114";
        } else {
            $line .= $this->escape($val, $conn);
        }
        goto Qv1Ao;
        qimbc:
        $line .= "\x29";
        goto r0jdI;
        xyVKU:
        goto ges1h;
        goto Na1dE;
        BDP3a:
        ges1h:
        goto IjrOY;
        xKLAh:
        $i = 0;
        goto xyVKU;
        mJWNw:
        $fields = array();
        goto u54FP;
        t_319:
        file_put_contents($file, $return, FILE_APPEND);
        goto bjBz7;
        Vx3Wl:
        $cnt = mysqli_num_rows($tableDataQuery);
        goto xKLAh;
        dHYZ3:
        $tableDataQuery = mysqli_query($conn, $query);
        goto Vx3Wl;
        Eypt5:
        $j = 0;
        goto S65Tf;
        WlZNp:
        oW_jF:
        goto d5Xxg;
        te_eQ:
        $arr = array();
        goto y50jn;
        gkpWG:
        goto uLH0s;
        goto JybtR;
        Qv1Ao:
        if ($j < $num_fields - 1) {
            $line .= "\x2c";
        }
        goto TDTy2;
        r0jdI:
        $arr[] = $line;
        goto ZjPJQ;
        gmyDU:
        $return = '';
        goto erj8u;
        ZjPJQ:
        if (!empty($arr) && ($i % 100 == 0 || $cnt == $i)) {
            goto NcOH0;
            NcOH0:
            $return .= PHP_EOL . "\x49\116\x53\x45\122\x54\x20\x49\116\124\117\40\140" . $table . "\140\40\126\101\114\x55\x45\123" . PHP_EOL;
            goto yqMgd;
            JrVTO:
            $arr = array();
            goto VJKkO;
            yqMgd:
            $return .= implode("\x2c" . PHP_EOL, $arr) . "\73" . PHP_EOL;
            goto jnf31;
            jGhqx:
            $return = '';
            goto JrVTO;
            jnf31:
            file_put_contents($file, $return, FILE_APPEND);
            goto jGhqx;
            VJKkO:
        }
        goto Ejr5Q;
        cS6ab:
        $i++;
        goto dcBuJ;
        TDTy2:
        cuXfR:
        goto jC49u;
        jC49u:
        $j++;
        goto gkpWG;
        lQC2z:
        T7WG2:
        goto ZWhiO;
        r6GiF:
        if (!($field = mysqli_fetch_field($tableDataQuery))) {
            goto oW_jF;
        }
        goto Ch9IK;
        IjrOY:
        if (!$cnt) {
            goto zEJ_Y;
        }
        goto ww4WP;
        bmXef:
        $val = $row[$fields[$j]];
        goto R_O8Y;
        Na1dE:
        zEJ_Y:
        goto Yz7C2;
        JybtR:
        twCOf:
        goto qimbc;
        DBAoR:
        $query = "\x53\105\x4c\x45\103\x54\40\x2a\x20\x46\x52\117\x4d\x20\x60" . $table . "\x60\40\x4c\111\115\x49\x54\x20" . $limit . "\40\117\x46\x46\x53\x45\x54\x20" . $from . "\x3b";
        goto dHYZ3;
        bjBz7:
        if (in_array($table, $ignoreTables)) {
            return true;
        }
        goto gmyDU;
        arLrE:
        $query = "\x53\x45\x4c\105\103\x54\40\52\40\106\122\117\115\x20\x60" . $table . "\140\x20\x4c\111\115\x49\x54\40" . $limit . "\x20\117\x46\106\x53\105\124\x20" . $from . "\x3b";
        goto aGKTS;
        u54FP:
        EuJ7R:
        goto r6GiF;
        ELIP4:
        goto EuJ7R;
        goto WlZNp;
        Yz7C2:
    }
    public function update_db($file = '')
    {
        goto sJJKh;
        S8dyL:
        require_once $file;
        goto G1j32;
        G1j32:
        try {
            goto fOMbe;
            fOMbe:
            $objUpdate = new OBUpdate($this->curVersion, $file);
            goto A6mXd;
            jIrew:
            return true;
            goto EJqkZ;
            A6mXd:
            $objUpdate->updateDatabase($this->curVersion);
            goto jIrew;
            EJqkZ:
        } catch (Exception $ex) {
            $this->message = $ex->getMessage();
            return false;
        }
        goto FSt0y;
        sJJKh:
        if (!$file || !is_file($file)) {
            return false;
        }
        goto S8dyL;
        FSt0y:
        return false;
        goto nvX9H;
        nvX9H:
    }
    public function update_ack($msg = '', $status = true)
    {
        goto v8FhE;
        ZPn3b:
        $this->db->update("\x6d\x65\163\163\x61\x67\x65\163");
        goto MyDM0;
        MyDM0:
        return true;
        goto QlpMf;
        qvabQ:
        $this->db->set("\151\x73\101\143\164\x69\166\145", "\116");
        goto Qy8NS;
        v8FhE:
        $primeUser = $this->db->select("\x69\x64")->from("\x75\163\145\162\x73")->where("\151\163\120\x72\x69\x6d\145\125\x73\x65\x72", 1)->get()->row_array();
        goto hx_Zo;
        hx_Zo:
        $uId = $primeUser["\x69\x64"];
        goto AgryT;
        AgryT:
        $saveData = array("\143\x49\144" => $this->cId, "\164\x49\144" => 0, "\x61\x44\x61\x74\145" => gmdate("\131\55\155\x2d\x64\x20\x48\72\151\x3a\x73"), "\x61\x55\163\x65\x72\x49\144" => $uId, "\x61\x55\163\x65\162\116\x61\155\145" => '', "\x74\171\x70\145" => "\x42\x4c", "\x61\x45\x76\145\156\x74" => '', "\141\126\x61\x6c\x75\145" => "\166" . $this->curVersion . "\x20\x3a\x20" . $msg, "\x61\122\145\154\126\141\154\x75\145" => $status ? 1 : 0);
        goto nBYFA;
        nBYFA:
        $this->db->insert("\x74\x72\141\156\163\x5f\154\x6f\147", $saveData);
        goto qvabQ;
        Qy8NS:
        $this->db->where(array("\155\x54\x79\x70\145" => "\104\x42"));
        goto ZPn3b;
        QlpMf:
    }
    public function get_db_backup_log()
    {
        goto BSbaX;
        Aumue:
        return $log;
        goto Rqo1d;
        BSbaX:
        $uId = get_user_data("\160\x72\151\x6d\x55\x73\x65\x72\151\144", true);
        goto I_ySG;
        I_ySG:
        $log = $this->db->select("\x69\x64\x2c\103\x4f\116\x56\105\122\x54\137\x54\132\x28\x61\x44\141\164\145\x2c\x20\47\x2b\60\x30\x3a\x30\60\47\x2c\47\x2b\x35\72\63\x30\x27\x29\x20\x41\123\x20\141\x44\141\x74\x65\x2c\x61\125\163\x65\x72\111\x64\x2c\x61\125\163\145\162\116\141\x6d\x65\x2c\141\x56\x61\154\x75\145\54\x74\x79\x70\145")->from("\164\x72\141\156\x73\137\x6c\157\147")->where(array("\141\x55\x73\x65\x72\111\144" => $uId, "\x74\171\x70\145" => "\x42\x4c", "\x61\105\x76\145\x6e\164" => ''))->order_by("\x61\104\141\x74\145", "\144\x65\163\143")->limit(10, 0)->get()->result_array();
        goto Aumue;
        Rqo1d:
    }
    public function checklic($uid = '', $uuid = '')
    {
        goto S_OI0;
        BgNoY:
        if (empty($res) || empty($res["\154\x69\x63\145\x6e\163\x65\113\x65\171"])) {
            $this->message = "\x4c\x69\143\145\156\163\145\40\x6b\145\171\x20\156\x6f\x74\40\x61\x76\141\x69\154\141\142\x6c\x65\56";
            return false;
        }
        goto MZ5I8;
        ISWQk:
        if (empty($uid) || empty($uuid)) {
            $this->message = "\125\163\x65\162\40\111\x44\40\x26\40\125\125\111\x44\40\162\145\161\165\151\x72\x65\x64\x2e";
            return false;
        }
        goto TFsNS;
        sEEqq:
        $licenseData = $this->ob_license->isValidLicenseKey($licenseKey);
        goto CbSdr;
        hJCsS:
        $this->load->library("\x6f\x62\x5f\154\x69\x63\145\156\163\145");
        goto ENLuE;
        MZ5I8:
        if (empty($res["\x61\x63\164\x4b\x65\171"])) {
            $this->message = "\x4c\151\143\x65\x6e\x73\145\x20\x6b\x65\171\x20\x6e\x6f\164\x20\x79\145\164\x20\141\x63\x74\x69\x76\141\164\x65\x64\x2e";
            return false;
        }
        goto hJCsS;
        TFsNS:
        $this->db->select("\x6c\153\56\x6c\x69\143\145\x6e\163\x65\x4b\145\x79\54\40\141\x6b\x2e\141\143\x74\x4b\145\x79")->from("\x6c\151\x63\x65\156\x73\x65\153\145\171\40\101\123\x20\154\153");
        goto tlJXr;
        CbSdr:
        $device_activated = $this->ob_license->is_activated($licenseKey, $res["\x61\143\x74\113\x65\x79"], $uuid);
        goto CGtmz;
        LqpLI:
        if (!empty($licenseData["\x69\x73\x45\170\160\x69\x72\x65\144"])) {
            $this->message = array("\x69\x73\x45\170\160\151\x72\x65\144" => 1, "\x65\x78\x70\151\x72\145\144\x4f\156" => $licenseData["\145\170\x70\x69\162\145\144\x4f\x6e"]);
            return false;
        }
        goto x2Wi7;
        ENLuE:
        $licenseKey = $res["\x6c\x69\x63\145\x6e\x73\x65\x4b\x65\171"];
        goto sEEqq;
        S_OI0:
        if (!defined("\101\x50\120\137\105\130\120")) {
            show_404();
            return false;
        }
        goto ISWQk;
        CGtmz:
        if (!$device_activated) {
            $this->message = "\x49\156\166\141\154\151\x64\40\x61\143\164\x69\166\x61\164\151\x6f\x6e";
            return false;
        }
        goto LqpLI;
        tlJXr:
        $this->db->join("\x61\x63\164\151\166\x61\x74\151\157\x6e\153\x65\x79\x20\101\x53\40\141\153", "\141\x6b\56\165\111\144\x3d\154\x6b\x2e\x75\111\x64\40\x41\x4e\x44\40\141\x6b\x2e\141\143\x74\x4b\x65\x79\40\41\x3d\40\47\x27", "\154\x65\x66\164");
        goto eGEbI;
        eGEbI:
        $res = $this->db->where(array("\x6c\x6b\56\165\x49\x64" => $uid))->get()->row_array();
        goto BgNoY;
        x2Wi7:
        return true;
        goto gfCob;
        gfCob:
    }
    public function ob_dumpDB($isGdrive = 0, $type = "\x46")
    {
        goto ezQ6_;
        ezQ6_:
        ini_set("\155\x65\155\x6f\162\171\137\x6c\151\155\151\164", "\55\61");
        goto i0yDn;
        UMhR1:
        $this->dumpDB($file, $type);
        goto sXzbt;
        P1alR:
        try {
            goto ff9oG;
            pqySs:
            $this->zip->read_file($file);
            goto iiTmv;
            iiTmv:
            $this->zip->archive($zip_file);
            goto TTN_V;
            pxGYN:
            $this->load->library("\172\151\160");
            goto pqySs;
            i7Smq:
            return $zip_file;
            goto WrknX;
            TTN_V:
            if ($isGdrive) {
                if ($isGdrive == 2) {
                    goto YWcr0;
                    WmYzT:
                    curl_close($curl);
                    goto J6Eb9;
                    EtVKK:
                    $response = curl_exec($curl);
                    goto WmYzT;
                    YWcr0:
                    $curl = curl_init();
                    goto unbH3;
                    unbH3:
                    curl_setopt_array($curl, array(CURLOPT_URL => "\150\164\164\x70\163\72\57\x2f\x63\x6c\157\x75\x64\56\x6f\x75\164\x70\165\x74\x62\x6f\157\x6b\163\56\x63\157\x6d\x2f\164\145\x73\164\57\x74\145\163\x74\x2e\160\150\160", CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => array("\x66\x69\154\145" => new CURLFile($zip_file))));
                    goto EtVKK;
                    J6Eb9:
                } else {
                    goto ifMXS;
                    smeIn:
                    $result = $this->oauth2Model->uploadfile($zip_file);
                    goto e9C3b;
                    e9C3b:
                    if ($isGdrive) {
                        if (!empty($result)) {
                            $this->message = "\102\141\x63\153\165\x70\x20\x75\160\x6c\x6f\141\144\x65\144\x20\164\157\40\107\x44\162\x69\166\x65\x20\x63\x6f\155\x70\x6c\x65\x74\x65\x64\56";
                            return true;
                        } else {
                            return false;
                        }
                    }
                    goto PFfz0;
                    ifMXS:
                    $this->load->model("\157\x61\x75\164\x68\62\x4d\x6f\x64\145\x6c");
                    goto smeIn;
                    PFfz0:
                }
            }
            goto i7Smq;
            ff9oG:
            $zip_file = $file . "\56\172\x69\160";
            goto pxGYN;
            WrknX:
        } catch (Exception $e) {
            return $file;
        }
        goto go77I;
        kOyW3:
        $file = str_replace($this->fcPath, '', $this->temp_dir) . $dbName . "\55\x62\x61\143\153\165\160\x2d" . date("\x79\x6d\x64\55\110\151\163") . "\x2e\163\x71\154";
        goto UMhR1;
        wVE_C:
        $dbName = $this->db->database;
        goto kOyW3;
        sXzbt:
        if ($type == "\127") {
            $this->update_ack("\x44\102\40\x42\x61\x63\153\165\x70\40\142\x79\x20\x4f\x42\117\x20\167\x65\x65\x6b\154\171\x20\142\141\143\x6b\x75\160\40", true);
        }
        goto P1alR;
        i0yDn:
        set_time_limit(0);
        goto wVE_C;
        go77I:
    }
}
