displayFleetSelect

(/rs/public/functions.php)

displayFleetSelect -- String containing options for a select input.

Description

string displayFleetSelect ($selected = 0, $current = "yes")

This function will return <option> tags for all specified fleets. The value of each option is the fleet id in the database, and the text for each option is the full fleet name.

If $selected is given the fleet with id $selected will be selected by default.

If $current is set to "no", all fleets are returned, including inactive ones. A value of "yes" for current will return only active fleets. "yes" is the default value for this parameter.

This function will return an empty string on failure.

Examples

displayFleetSelect () /* Returns options for all current fleets. The selected fleet will be the first fleet in the list. */

displayFleetSelect (4, "no") /* Returns options for all fleets, current and inactive. Fleet with id 4 will be selected by default */

Related Functions

None.

Dependencies

None.

Function Index