<?php
/*
Generated by OutputBooks Team
*/

namespace Storage;

class Storage extends \ClsBase
{
    public function __construct()
    {
        parent::__construct();
    }
    public function test()
    {
        goto NQNBf;
        uzqhd:
        exit;
        goto dIaD8;
        NQNBf:
        $this->CI->load->library("\164\162\141\x6e\x73\137\164\141\x62\154\x65");
        goto rF7x4;
        rF7x4:
        print_R($this->CI->trans_table);
        goto uzqhd;
        dIaD8:
    }
    public function get_storagetrans($id = 0, $type = '')
    {
        $this->CI->load->library("\163\x74\x6f\162\141\x67\x65\137\164\x61\142\154\x65");
        return $this->CI->storage_table->get_storagetrans($id, $type);
    }
    public function save($data, $params = array())
    {
        goto gHtw3;
        kkiY7:
        if ($ret === false) {
            $this->error = $this->CI->storage_table->error;
        } else {
            if (!empty($data["\164\162\141\x6e\x73\111\144"])) {
                $this->update_lock($data["\x74\x72\x61\156\x73\x49\144"]);
            }
        }
        goto iFXs3;
        D5F5t:
        $ret = $this->CI->storage_table->save($data, $params);
        goto kkiY7;
        gHtw3:
        $this->CI->load->library("\163\164\157\x72\141\x67\x65\x5f\x74\x61\x62\x6c\145");
        goto D5F5t;
        iFXs3:
        return $ret;
        goto qSSn5;
        qSSn5:
    }
    public function delete($data, $params = array())
    {
        goto kRAyu;
        kRAyu:
        $this->CI->load->library("\x73\x74\x6f\x72\x61\147\145\x5f\164\141\142\154\145");
        goto dTGDi;
        L5ybf:
        if ($ret === false) {
            $this->error = $this->CI->storage_table->error;
        } else {
            if (!empty($data["\164\x72\x61\x6e\x73\x49\x64"])) {
                $this->update_lock($data["\x74\x72\141\x6e\163\111\144"]);
            }
        }
        goto MoKGw;
        dTGDi:
        $ret = $this->CI->storage_table->delete($data, $params);
        goto L5ybf;
        MoKGw:
        return $ret;
        goto rijvQ;
        rijvQ:
    }
    private function update_lock($transId = 0)
    {
        goto eWmbd;
        lNgds:
        $this->CI->db->from("\163\x74\157\162\x61\147\145\137\x74\163\x20\x61\x73\x20\x73\164");
        goto xgMLA;
        cxTsR:
        if (!empty($result) && !empty($result["\x63\156\164"])) {
            $isLocked = "\x53";
        }
        goto mamRT;
        mamRT:
        $this->CI->db->update("\x74\162\141\156\x73", array("\151\163\x4c\x6f\143\x6b\145\x64" => $isLocked), array("\151\144" => $transId));
        goto KGR_i;
        xgMLA:
        $this->CI->db->where(array("\163\164\56\164\x73\111\x64" => $transId, "\163\x74\56\163\x74\x6f\111\144\40\x3e" => 0));
        goto awCoi;
        mfUwG:
        $isLocked = '';
        goto cxTsR;
        awCoi:
        $result = $this->CI->db->get()->row_array();
        goto mfUwG;
        eWmbd:
        $this->CI->db->select("\x43\117\x55\x4e\x54\x28\x73\164\56\163\164\x6f\111\x64\51\40\x41\123\40\x63\156\164");
        goto lNgds;
        KGR_i:
    }
}
