ruleName = JText::translate('VBO_CONDTEXT_RULE_COUNTRIES');
$this->ruleDescr = JText::translate('VBO_CONDTEXT_RULE_COUNTRIES_DESCR');
$this->ruleId = basename(__FILE__);
}
/**
* Displays the rule parameters.
*
* @return void
*/
public function renderParams()
{
$this->vbo_app->loadSelect2();
$countries = $this->loadCountries();
$current_countries = $this->getParam('countries', array());
?>
getPropVal('booking', 'country');
if (empty($country_booked)) {
return false;
}
$allowed_countries = $this->getParam('countries', array());
return (in_array($country_booked, $allowed_countries));
}
/**
* Internal function for this rule only.
*
* @return array
*/
protected function loadCountries()
{
$countries = array();
$dbo = JFactory::getDbo();
$q = "SELECT `country_name`, `country_3_code` FROM `#__vikbooking_countries` ORDER BY `country_name` ASC;";
$dbo->setQuery($q);
$dbo->execute();
if ($dbo->getNumRows()) {
$countries = $dbo->loadAssocList();
}
return $countries;
}
}