I have a booking system which has a dropdown list which you click on. When you click on this dropdown list the options are as follows:
1 person 2 person 3 person 4 person .....
I would like the first option to say "1 person" but all remaining options to say "people" like follows:
1 person 2 people 3 people 4 people .....
The PHP file has the following section which controls the output of a selector:
public function getFilterPlaces () {
$places = array();
$bookingSystem = $this->getParam ('bookingSystem','tables');
if ( $bookingSystem == 'tables' ) {
$query = $this->_db->getQuery ( true );
$query->select ('a.places AS max, a.minim AS min');
$query->from ('#__tbb_table AS a');
$this->_db->setQuery ( $query );
$tables = $this->_db->loadObjectList();
if ( $tables ) {
foreach ( $tables as $table ) {
for ( $i = $table->min; $i<= $table->max; $i++ ) {
if ( !in_array($i, $places ) ) {
$places[$i] = $i . ' people';
}
}
}
}
} elseif ( $bookingSystem == 'places' ) {
$max = $this->getParam ('restaurantPlaces', 0);
if ( $max ) {
for ( $i = 1; $i<= $max; $i++ ) {
$places[$i] = $i . ' ' . JText::_('COM_TABLEBOOKING_FILTER_PLACES');
}
}
}
return $places;
}
How would I code the array to populate the first entry with "1 person" and the following with 2 people, 3 people etc.?
Thanks,