function getReceiverMsgByStatus($receiver, $status) { $exists = R::getAll('select * from chatmessage where receiver=? and msgstatus=?', array($receiver, $status)); if ($exists == null) { $this->res['Status'] = App::getActionResponse('Empty'); $this->res = App::getTotalResponse($this->res); //$this->res = App::setJSONResponse($res); return $this->res; } else { $jsonData = array(); foreach ($exists as $row) { $jsonData[] = $row; } $this->res['chatmessage'] = $jsonData; $this->res['Status'] = App::getActionResponse('Success'); $this->res = App::getTotalResponse($this->res); return $this->res; } }
case 'signup': App::setJSONResponse($user->signup($request['fname'], $request['lname'], $request['age'], $request['address'], $request['prof'], $request['profession'], $request['email'], $request['phone'], $request['countryid'])); break; case 'presignup': App::setJSONResponse($user->presignup($request['email'])); break; case 'askquestion': App::setJSONResponse($user->askquestion($request['categoryid'], $request['deviceid'], $request['question'])); break; case 'updatedeviceid': App::setJSONResponse($user->updatedeviceid($request['device'], $request['phone'])); break; case 'update': App::setJSONResponse($user->updateProfile($request['authkey'], $request['fname'], $request['lname'], $request['email'], $request['photo'], $request['deviceid'], $request['allphones'])); break; case 'joincategory': App::setJSONResponse($user->joincategory($request['phone'], $request['category'])); break; case 'getarticle': App::setJSONResponse($user->getarticle($request['articleid'])); break; case 'getdefaultarticle': App::setJSONResponse($user->getdefaultarticle()); break; case 'sendsms': App::setJSONResponse($user->sendingSms($request['sender'], $request['phone'], $request['smsmessage'])); break; default: App::setJSONResponse(array('Status' => App::getActionResponse('Unknown'))); break; }
function getSipId($phone) { $res = array(); $exists = R::getRow('select * from user where phone=? ', array($phone)); if ($exists == NULL) { $this->res['Status'] = App::getActionResponse('InvalidLogin'); $this->res = App::getTotalResponse($this->res); } else { $dpin = $exists['sip_id']; $this->res['sipId'] = $dpin; $this->res['Status'] = App::getActionResponse('Success'); $this->res = App::getTotalResponse($this->res); return $this->res; } }