示例#1
0
 /**
  * Validation and filtering
  *
  * @return boolean True is satisfactory
  */
 function check()
 {
     // Validate business information
     if (trim($this->promo) == '') {
         $this->setError('Please enter the promo text.');
         return false;
     }
     if ($this->dateAdded == null) {
         // Set the registration timestamp
         $now =& FiveFactory::getDate();
         $this->dateAdded = strtotime($now->toMySQL());
     }
     return true;
 }
示例#2
0
 /**
  * Validation and filtering
  *
  * @return boolean True is satisfactory
  */
 function check()
 {
     // Validate user information
     if (trim($this->_ccName) == '') {
         $this->setError('Please enter your name as it appears on your credit card.');
         return false;
     }
     if (!checkCreditCard($this->_ccNum, $this->_ccType)) {
         global $errortext;
         $this->setError($errortext);
         return false;
     }
     $now =& FiveFactory::getDate();
     if ($now->isAfter($this->_ccExpYY . '-' . $this->_ccExpMM . '-28')) {
         $this->setError("Your credit card has expired.");
         return false;
     }
     if ($this->date_transaction == null) {
         // Set the registration timestamp
         $now =& FiveFactory::getDate();
         $this->date_transaction = strtotime($now->toMySQL());
     }
     return true;
 }
示例#3
0
 /**
  * Method is responsible for loading the featured businesses
  * 
  */
 function loadFeatured()
 {
     $db =& $this->getDBO();
     $now =& FiveFactory::getDate();
     $query = 'SELECT *' . ' FROM ' . $this->_tbl . ' WHERE ' . strtotime($now->toMySQL()) . ' BETWEEN `feat_start` and `feat_end`';
     $db->setQuery($query);
     //echo _520($query);
     if ($results = $db->loadList($this->_tbl_key, $this->_type)) {
         return $results;
     }
 }
示例#4
0
 /**
  * Updates last visit time of user
  *
  * @param int The timestamp, defaults to 'now'
  * @return boolean False if an error occurs
  */
 function setLastVisit($timeStamp = null, $id = null)
 {
     // check for User ID
     if (is_null($id)) {
         if (isset($this)) {
             $id = $this->id;
         } else {
             // do not translate
             exit('WARNUSER');
         }
     }
     // if no timestamp value is passed to functon, than current time is used
     $date =& FiveFactory::getDate($timeStamp);
     // updates user lastvistdate field with date and time
     $query = 'UPDATE ' . $this->_tbl . ' SET lastvisitDate = ' . $this->_db->Quote($date->toMySQL()) . ' WHERE id = ' . (int) $id;
     $this->_db->setQuery($query);
     if (!$this->_db->query()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     return true;
 }