/** * System Connect */ public function systemConnect($data) { $obj_chkapi = new App_Model_Chkapi(); $validation_result = $obj_chkapi->chkAPI($data); if ($validation_result == 1) { try { $obj = new App_Model_Connect(); $result = $obj->systemConnectModel($data); if ($result) { $obj_user->success = "true"; $obj_user->systemconnect = new stdClass(); $obj_user->systemconnect->sessionid = $result; } else { $obj_user->success = "false"; $obj_user->Message = "Error1"; } //end of else } catch (exception $e) { $obj_user->success = "false"; $obj_user->message = "Error:" . $e->getMessage(); } //end of try } else { $obj_user->success = "false"; $obj_user->message = "Access Denied"; } return $obj_user; }
public function getUserFavoritesBusinessesModule($data) { #-- chk for session in table user_session_id $connect_obj = new App_Model_Connect(); $chk_session = $connect_obj->chkSessionModule($data['UserID'], $data['SessionID']); if ($chk_session) { try { $db = Zend_Db_Table::getDefaultAdapter(); $query = $db->select()->from(array('buss_foll' => $this->_business_followers, array('business_id', 'user_id')))->join(array('buss' => $this->_businesses), 'buss.id = buss_foll.business_id', array('description', 'tiny_description', 'image'))->join(array('buss_loc' => $this->_business_locations), 'buss.id = buss_loc.business_id', array('latitude', 'longitude', 'address'))->join(array('buss_cat' => $this->_business_categories), 'buss.category_id = buss_cat.id', array('name', "buss_cat_id" => 'id')); if ($data['UserID']) { $query->where($this->getAdapter()->quoteInto('buss_foll.user_id = ?', $data['UserID'])); } } catch (exception $e) { echo "Error: " . $e->getMessage(); } } else { $query = "invalid"; } return $query; }