Beispiel #1
0
 public function getPriceList()
 {
     if (!class_exists('MathHelper')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_bookpro/helpers/math.php';
     }
     $db = $this->getDbo();
     $query = $db->getQuery(true);
     $query->select('*');
     $query->from($db->quoteName('#__bookpro_price'));
     $db->setQuery($query);
     $data = $db->loadObjectList();
     $result = new JObject();
     $result->date = MathHelper::filterArrayObjects($data, 'code', 'DATE');
     $result->week = MathHelper::filterArrayObjects($data, 'code', 'WEEK');
     $result->dayoff = MathHelper::filterArrayObjects($data, 'code', 'DAYOFF');
     return $result;
 }
 function getReturnAirport($from, $type, $country_id = null)
 {
     require_once JPATH_ADMINISTRATOR . '/components/com_bookpro/helpers/math.php';
     $t = microtime(1);
     if (empty($from)) {
         return array();
     }
     //get parent destination
     $parents = $this->getParentDest($country_id);
     $return_dests = $this->getReturnDest($from, $type);
     $result = array();
     foreach ($parents as $pr) {
         $result[$pr->title] = MathHelper::filterArrayObjects($return_dests, 'parent_id', $pr->id);
     }
     //		echo 'time:'.(microtime(1)-$t);
     return TransportHelper::removeEmptyArray($result);
 }