public function UpdateResOwnerProfile($formData) { try { $restOwn = new User_Model_Manager(); $restOwn->setId($formData->resownerId); $restOwn->setFristName(trim($formData->firstName)); $restOwn->setLastName(trim($formData->lastName)); $restOwn->setRestaurantname(trim($formData->restaurantName)); $restOwn->setPhonenumber(trim($formData->phone)); $restOwn->setCountryCode($formData->rescodetext); $restOwn->setTechfirstName($formData->techfirstName); $restOwn->setTechlastname($formData->techlastName); $restOwn->setTechemail($formData->techemail); $restOwn->setTechphone($formData->techphone); $restOwn->setTechcountrycode($formData->techrescodetext); $restOwn->setBilfirstName($formData->bilfirstName); $restOwn->setBillastname($formData->billastName); $restOwn->setbilemail($formData->bilemail); $restOwn->setBilphone($formData->bilphone); $restOwn->setBilcountrycode($formData->bilrescodetext); $mapper = new User_Model_ManagerDataMapper(); $status = $mapper->update($restOwn); if ($status) { $result = array('status' => true); } return $result; } catch (Exception $ex) { Rdine_Logger_FileLogger::info($ex->getMessage()); throw new Exception($ex->getMessage()); } }
public function EditSourceofRestaurant($request) { try { $obj = new User_Model_Manager(); $source2 = $request->source_list; $obj->setSourceid($source2); $userid = $request->uid; $obj->setId($userid); $sourcedesc = $request->sourcedescription; $obj->setSourcedescription($sourcedesc); $rsetownerMapper = new User_Model_ManagerDataMapper(); $status = $rsetownerMapper->EditSourceofRestaurant($obj); return $status; } catch (Exception $ex) { Rdine_Logger_FileLogger::info($ex->getMessage()); throw new Exception($ex->getMessage()); } }
public function EditSourceofRestaurant(User_Model_Manager $obj) { try { $db = Zend_Db_Table::getDefaultAdapter(); $status = false; if ($obj->getSourceid()) { $set = array('rsosourceid' => $obj->getSourceid(), 'rsosourcedescription' => $obj->getSourcedescription()); $where = $db->quoteInto('rsofk_user = ?', $obj->getId()); $rows_affected = $this->getDbTable()->update($set, $where); } else { $set = array('rsosourceid' => null, 'rsosourcedescription' => null); $where = $db->quoteInto('rsofk_user = ?', $obj->getId()); $rows_affected = $this->getDbTable()->update($set, $where); } if ($rows_affected > 0) { $status = true; } return $status; } catch (Exception $ex) { throw new Exception($ex->getMessage()); } }
/** * registration of Restaurant Owner * * @param owner registration form data * @return status of registration completed or not */ public function RegisterRestaurantOwner(array $data, $source = 'DD') { try { $form = $this->getRestaurantOwnerForm(); $stateid = null; $regionid = null; $cityid = null; $regionBd = array(); $cityBd = array(); $ngbhBd = array(); $restService = new Application_Service_Restaurant(); if ($form->isValid($data)) { $storage = new Zend_Auth_Storage_Session(); $userdata = $storage->read(); $formData = $form->getValues(); $restaurantowner = new User_Model_Manager(); $restaurantowner->setFristName($formData['firstName'])->setLastName($formData['lastName'])->setEmail(strtolower($formData['emailAddress']))->setPassword($formData['password'])->setUsertypeid(3)->setRole(2)->setRegistereddate(date('Y-m-d H:i:s'))->setRestaurantname($formData['restaurantName'])->setPhonenumber($formData['phone'])->setCountryCode($formData['countryCode'])->setcity($formData['resownercity'])->setzipCode($formData['resownerzipcode'])->setSourceid($formData['source'])->setWebsite($formData['website'])->setSourcedescription($formData['sourcedescription'])->setDescription($formData['description'])->setDateofbirth($formData['dateofbirth']); if ($userdata['Usertype'] == "ADM" || $userdata['Usertype'] == "ADU" || $source == 'WIX') { $restaurantowner->setUserstatisid(1); } else { $restaurantowner->setUserstatisid(3); } if (isset($userdata['companyid'])) { $restaurantowner->setCompanyid($userdata['companyid']); } else { $restaurantowner->setCompanyid(1); } $mapper = new User_Model_ManagerDataMapper(); $res_own_id = $mapper->save($restaurantowner, $source); if ($res_own_id) { // $mailmapper = new Application_Service_Communication(); /* for E-mail $mailObj = new Communication_Model_Mail(); //$mailObj->setMsgCode('ResOwnConf'); $mailObj->setMsgCode('New Registration email'); $name = $formData['firstName'].' '.$formData['lastName']; $data = array('name'=> $name, 'restname'=> $formData['restaurantName'], 'phone' => $formData['countryCode'].$formData['phone'], 'email' => strtolower($formData['emailAddress']), // 'state' => $state, 'city' => $city, 'userid' => $formData['userid'], 'approval'=> $approval, 'uId' => $res_own_id, 'disapproval'=>$disapproval, 'state' => $formData['resownercountry'], 'city' => $formData['resownercity'], 'desc' => $formData['description']); $mailObj->setData($data); $mailStatus = $mailmapper->SendMail($mailObj); */ $result = array('status' => true, 'userid' => $res_own_id); if ($source == 'DD') { return $result; } else { return array('status' => true, 'result' => $res_own_id); } } } else { $formData = $form->getValues(); $form->populate($data); $result = array('status' => false, 'form' => $form); return $result; } } catch (Exception $ex) { Rdine_Logger_FileLogger::info($ex->getMessage()); throw new Exception($ex->getMessage()); } }