diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ui.lib.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/ui.lib.php b/lib/ui.lib.php index 128ba533..cd82cfc7 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -1294,4 +1294,29 @@ function show_genre_select($name='genre',$genre_id=0) { } // show_genre_select +/** + * show_catalog_select + * Yet another one of these buggers. this shows a drop down of all of your catalogs + */ +function show_catalog_select($name='catalog',$catalog_id=0,$style='') { + + echo "<select name=\"$name\" style=\"$style\">\n"; + + $sql = "SELECT id, name FROM catalog ORDER BY name"; + $db_results = mysql_query($sql, dbh()); + + while ($r = mysql_fetch_assoc($db_results)) { + $selected = ''; + if ($r['id'] == $catalog_id) { + $selected = "selected=\"selected\""; + } + + echo "\t<option value=\"" . $r['id'] . "\" $selected>" . scrub_out($r['name']) . "</option>\n"; + + } // end while + + echo "</select>\n"; + +} // show_catalog_select + ?> |