Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //------------------------------------------------------------------------------
- public function resulOK($res, $js = '', $echo = 1) {
- $js .= $this->onResultJs;
- $this->onResultJs='';
- parent::resulOK($res, $js, $echo);
- }
- //------------------------------------------------------------------------------
- public function resultERROR($res, $js = '', $echo = 1) {
- $js.=$this->onResultJs;
- $this->onResultJs='';
- return parent::resultERROR($res, $js, $echo);
- }
- //------------------------------------------------------------------------------
- public function resulOK($res, $js = '', $echo = 1) {
- $res = json_encode(array('res' => $res, 'js' => $js));
- if ($res==false) {
- file_put_contents(logsDir().'/lastJsonError.txt', $js);
- die('JSON klaida: '.json_last_error_msg ());
- }
- if ($echo == 1) {
- echo $res;
- die;
- }
- return $res;
- }
- //------------------------------------------------------------------------------
- public function resultERROR($res, $js = '', $echo = 1) {
- $res1=$res;
- if (!empty($res) and is_numeric($res)) {
- $res = $this->db->error($res);
- if (TSMV::isCamel()) {
- $res=utf($res);
- }
- }
- if ($res1==-999999) {
- $w = $this->db->exec_Func("warn.v_warnUser");
- if (!empty($w)) {
- echo $w;
- die;
- }
- }
- else if ($res1<0) {
- $w = $this->db->exec_Func("warn.v_warnUser");
- if (!empty($w)) {
- if (TSMV::isCamel()) {
- $w=utf($w);
- }
- $res.=" ".$w;
- }
- }
- $res = json_encode(array('error' =>$res, 'js' => $js));
- if ($res==false) {
- file_put_contents(logsDir().'/lastJsonError.txt', $js);
- die('JSON klaida: '.json_last_error_msg ());
- }
- if ($echo == 1) {
- echo $res;
- die;
- }
- return $res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement