public function getcusdata($id) { try { $db = $this->getDbTable(); $resreviewdata = array(); $select = $db->select()->from(array('c' => 'rd.customer'), array('c.cusfirst_name'))->where('cusfk_user = ?', $id); $cusdata = $select->query()->fetchAll(); return $cusdata; } catch (Exception $ex) { Rdine_Logger_FileLogger::info($ex->getMessage()); throw new Exception($ex->getMessage()); } }
public function AddContact($data) { try { $form = $this->getContactUsForm(); $result = array(); /*if($data['contactType'] == 'email'){ $form->emailAddress->setRequired(true); $form->phone->setRequired(false); }else if($data['contactType'] == 'phone'){ $form->phone->setRequired(true); $form->contactType->setValue('phone'); $form->emailAddress->setRequired(false); }*/ if ($form->isValid($data)) { $formData = $form->getValues(); $mapper = new Administrator_Model_ContactUsDataMapper(); $contactObj = new Administrator_Model_ContactUs(); $domain = $_SERVER["SERVER_NAME"]; if ($domain == "www.dinedesk.com" || $domain == "dinedesk.com") { $contactObj->setCompanyId(1); } else { if ($domain == "www.dinedesk.co.za" || $domain == "dinedesk.co.za") { $contactObj->setCompanyId(2); } else { $contactObj->setCompanyId(1); } } $contactObj->setcontactname($formData['contactName']); $contactObj->setaddress($formData['address']); $contactObj->setcity($formData['city']); $contactObj->setstate($formData['state']); $contactObj->setcountry($formData['country']); $contactObj->setzip($formData['postalCode']); $contactObj->setphone($formData['phone']); $contactObj->setemail($formData['emailAddress']); $contactObj->setfax($formData['fax']); $contactObj->setwebsite($formData['website']); $contactObj->setmoreinformation($formData['moreinfo']); $contactObj->setcomments($formData['comments']); $contactObj->setpostedon(date('Y-m-d')); $contactObj->setcontacttype($formData['type']); $status = $mapper->CreateContact($contactObj); if ($status) { $result['status'] = $status; $result['form'] = $form; } //return $result; $mailmapper = new Application_Service_Administrator(); //if($formData['notificationType'] == 'email'){ if ($result['status']) { /*$mailObj = new Communication_Model_Mail(); $mailObj->setMsgCode('EnquiryNot'); $name = $formData['contactName']; $data = array('Name' => $name, 'City' => $formData['city'], 'State' => $formData['state'], 'Country' => $formData['country'], 'Phone' => $formData['phone'], 'Email' => $formData['emailAddress'], 'Comments' => $formData['comments']); //'Status' => $formData['bookingStatus']); $mailObj->setData($data); $mailStatus = $mailmapper->SendMail($mailObj);*/ } return $result; } else { $formData = $form->getValues(); $form->populate($formData); $result['status'] = false; $result['form'] = $form; return $result; } } catch (Exception $ex) { Rdine_Logger_FileLogger::info($ex->getMessage()); throw new Exception($ex->getMessage()); } }
public function getRatingbyuserid($userid, $resid) { try { $rating = array(); $db = $this->getDbTable(); $select = $db->select()->from($db, "rr_review_ratings")->where("rr_fk_resid = ?", $resid)->where("rrcreatedby = ?", $userid)->order('rrid DESC'); $rating = $select->query()->fetchAll(); if (array_key_exists(0, $rating)) { return $rating[0]['rr_review_ratings']; } else { return $rating; } } catch (Exception $ex) { Rdine_Logger_FileLogger::info($ex->getMessage()); throw new Exception($ex->getMessage()); } }
public function getUserCount() { try { $db = $this->getDbTable(); $number = count($db->fetchAll()); return $number; } catch (Exception $ex) { Rdine_Logger_FileLogger::info($ex->getMessage()); throw new Exception($ex->getMessage()); } }
public function searchSugesstions() { try { $data = array(); $data['locations'] = array(); $locationMapper = new Application_Model_LocationboundariesMapper(); $locations = $locationMapper->fetchSugesstionData(); foreach ($locations as $value) { $data['locations'][] = array('name' => $value['location_name'] . "," . $value['city_name'] . "," . $value['country_name'], 'value' => $value['location_id']); } return $data; } catch (Exception $ex) { Rdine_Logger_FileLogger::info($ex->getMessage()); throw new Exception($ex->getMessage()); } }
public function getNumberOfUsers() { try { $cusMapper = new User_Model_ClientDataMapper(); $number = $cusMapper->getUserCount(); return $number; } catch (Exception $ex) { Rdine_Logger_FileLogger::info($ex->getMessage()); throw new Exception($ex->getMessage()); } }