/** * Update service * * @param array $data * @param int $serviceID * @return bool */ public function updateService($data, $serviceID) { $serviceID = (int) $serviceID; $data['ServiceCategories'] = Admin_View_Helper_DataFormating::serialize($data['ServiceCategories']); $where = $this->_adapter->quoteInto('ServiceID = ?', $serviceID); return Admin_View_Helper_DB::save(new Admin_Resource_Service(), $data, $where); }
/** * Update session * * @param array $data * @param int $sessionID * @return bool */ public function updateSession($data, $sessionID) { $sessionID = (int) $sessionID; $where = $this->_adapter->quoteInto('SessionID = ?', $sessionID); return Admin_View_Helper_DB::save(new Admin_Resource_EventSession(), $data, $where); }
/** * Update user * * @param array $data data to be updated * @param int $userID (optional) * @return bool Update succesfull or not */ public function updateUser($data, $userID = null) { $userID = $userID == null ? Admin_View_Helper_Authentication::getLoggedUserID() : (int) $userID; $where = $this->_adapter->quoteInto('UserID = ?', $userID); return Admin_View_Helper_DB::save(new Admin_Resource_User(), $data, $where); }
/** * Update article * * @param array $data * @param int $articleID * @return bool */ public function updateArticle($data, $articleID) { $articleID = (int) $articleID; $where = $this->_adapter->quoteInto('ArticleID = ?', $articleID); return Admin_View_Helper_DB::save(new Admin_Resource_Article(), $data, $where); }
/** * Insert access log * * @param int $companyID, * @return bool Insertion successful or not */ public function insertAccessLog($username, $activityType, $additionalInfo = "") { $data = array(Username => $username, ActivityType => $activityType, IpAddress => Admin_View_Helper_AccessLog::getClientIp(), LoginDateTime => Site_View_Helper_Date::formatDate(), AdditionalInfo => $additionalInfo); return Admin_View_Helper_DB::save(new Admin_Resource_AccessLog(), $data); }
/** * Insert contact log * * @param array $postData * @return array Status and message */ public function insertContactLog($postData) { if ($postData['Name'] == '') { return [status => 0, message => 'Please fill in your name']; } if ($postData['PhoneNr'] == null && $postData['Email'] == null) { return [status => 0, message => 'Please enter at least one way to contact you']; } if ($postData['ServiceRequired'] == 0 || $postData['ServiceRequired'] == null) { return [status => 0, message => 'Please select required service']; } if ($postData['Text'] == '') { return [status => 0, message => 'Please enter your comments']; } // Send email $emailSubject = '[' . $postData['ServiceRequiredText'] . '] Form submitted on www.beyourlight.co.uk'; $emailFrom = $postData['Email']; $emailText = 'Hello,<br/><br/>' . 'contact form has been submitted on www.beyourlight.co.uk<br/><br/>' . 'Here are the details:<br/>' . '<b>Name</b>: ' . $postData['Name'] . '<b>Email</b>: ' . $postData['Email'] . '<b>PhoneNr</b>: ' . $postData['PhoneNr'] . '<b>Service</b>: ' . $postData['ServiceRequiredText'] . '<b>Text</b>: ' . $postData['Text']; $emailTo = $this->getContactsByID()->Email; $emailSent = Site_View_Helper_Mailer::sendEmail($emailTo, $emailSubject, $emailText, $postData['Name'], EMAIL_USERNAME); // Insert log in DB $data = [ContactDateTime => Site_View_Helper_Date::formatDate(), Name => $postData['Name'], Email => $postData['Email'], PhoneNr => $postData['PhoneNr'], ServiceID => $postData['ServiceRequired'], Text => $postData['Text'], IpAddress => Admin_View_Helper_AccessLog::getClientIp(), EmailSent => $emailSent['Sent'], ErrorMessage => $emailSent['Message']]; Admin_View_Helper_DB::save(new Admin_Resource_ContactLog(), $data); return [status => 1, message => 'Your request has been submitted successfully']; }
/** * Update service category * * @param array $data * @param int $categoryID * @return bool */ public function updateServiceCategory($data, $categoryID) { $categoryID = (int) $categoryID; $where = $this->_adapter->quoteInto('ServiceCategoryID = ?', $categoryID); return Admin_View_Helper_DB::save(new Admin_Resource_ServiceCategory(), $data, $where); }
/** * Update testimonial * * @param array $data * @param int $testimonialID * @return bool */ public function updateTestimonial($data, $testimonialID) { $testimonialID = (int) $testimonialID; $where = $this->_adapter->quoteInto('TestimonialID = ?', $testimonialID); return Admin_View_Helper_DB::save(new Admin_Resource_Testimonial(), $data, $where); }