function stats_draw_catalog_year_pulldown
Search API
6.x stats.module | stats_draw_catalog_year_pulldown($selected = "", $display_submit = FALSE) |
5.x stats.module | stats_draw_catalog_year_pulldown($selected = "", $display_submit = FALSE) |
Return the HTML for a pulldown containing the catalog years available for selection.
Parameters
unknown_type $selected:
unknown_type $display_submit:
File
- modules/
stats/ stats.module, line 378 - This module displays statistics and reports for FlightPath
Code
function stats_draw_catalog_year_pulldown($selected = "", $display_submit = FALSE) {
$rtn = "";
$rtn .= "
<table border='0'>
<td valign='middle'>
<select name='catalog_year' id='catalog_year'><option value=''>
" . t("Please select a catalog year") . "</option>
<option value=''>-----------------------------------</option>";
$current_catalog_year = variable_get("current_catalog_year", "");
if ($selected == "") {
$selected = $current_catalog_year;
}
$res = db_query("SELECT DISTINCT (catalog_year) FROM degrees
WHERE exclude = '0'
ORDER BY catalog_year DESC");
while ($cur = db_fetch_array($res)) {
$sel = ($cur ["catalog_year"] == $selected) ? "selected=selected" : "";
$rtn .= "<option value='{$cur ["catalog_year"]}' $sel>{$cur ["catalog_year"]}-" . ($cur ["catalog_year"] + 1) . "</option>";
}
$rtn .= " </select> </td>";
if ($display_submit == true)
{
$rtn .= "<td valign='middle'><input type='submit' value='" . t("Select") . "'></td>";
}
$rtn .= "</table>";
return $rtn;
}