Example #1
0
 public function getMapSettings()
 {
     $settings = MBJService::getKeys();
     MBJService::setLanguage();
     // count locations without coordinates
     $query = $this->_db->getQuery(true);
     $query->select(' COUNT(id) ');
     $query->from(' #__joaktree_locations ');
     $this->_db->setQuery($query);
     $total = $this->_db->loadResult();
     $query->clear();
     $query->select(' COUNT(id) ');
     $query->from(' #__joaktree_locations ');
     $query->where(' latitude  IS NOT NULL ');
     $query->where(' latitude  <> 0 ');
     $query->where(' longitude IS NOT NULL ');
     $query->where(' longitude <> 0 ');
     $this->_db->setQuery($query);
     $valid = $this->_db->loadResult();
     $settings->valid = (int) $valid;
     $settings->total = (int) $total;
     $settings->invalid = $settings->total - $settings->valid;
     $settings->validpc = $settings->total ? round(100 * ($settings->valid / $settings->total), 0) : 0;
     $settings->invalidpc = $settings->total ? round(100 * ($settings->invalid / $settings->total), 0) : 0;
     return $settings;
 }
Example #2
0
 /**
  * The configuration keys
  *
  * @var    string
  * @since  1.0
  */
 public function getKeys()
 {
     return MBJService::getKeys();
 }