ruleName = JText::translate('VBOINVTOTGUESTS');
$this->ruleDescr = JText::translate('VBO_CONDTEXT_RULE_NOG_DESCR');
$this->ruleId = basename(__FILE__);
}
/**
* Displays the rule parameters.
*
* @return void
*/
public function renderParams()
{
?>
getProperty('rooms', array());
if (!is_array($rooms_booked) || !count($rooms_booked)) {
return false;
}
// count total guests booked
$booked_adults = 0;
$booked_children = 0;
foreach ($rooms_booked as $rb) {
$booked_adults += (int)$rb['adults'];
$booked_children += (int)$rb['children'];
}
$booked_totguests = $booked_adults + $booked_children;
$enough = true;
$from_adults = $this->getParam('from_adults', null);
$to_adults = $this->getParam('to_adults', $from_adults);
if ($from_adults !== null && ($booked_adults < $from_adults || $booked_adults > $to_adults)) {
$enough = false;
}
$from_children = $this->getParam('from_children', null);
$to_children = $this->getParam('to_children', $from_children);
if ($from_children !== null && ($booked_children < $from_children || $booked_children > $to_children)) {
$enough = false;
}
$from_totguests = $this->getParam('from_totguests', null);
$to_totguests = $this->getParam('to_totguests', $from_totguests);
if ($from_totguests !== null && ($booked_totguests < $from_totguests || $booked_totguests > $to_totguests)) {
$enough = false;
}
return $enough;
}
}