📄 pulldown.php3
字号:
<?php// Simon's Rock Web Calendar// Copyright (C) 1999-2000 Ryan Krebs and Simon's Rock College of Bard// Please read the accompanying files "COPYING" and "COPYRIGHT"// for more informationif( !$PULLDOWN_INCLUDED ) { $PULLDOWN_INCLUDED = 1;// This function outputs a pull-down menu for a form, using two columns// from a table. This is used in the submit forms so the names can be// displayed in the pulldown, but the ID stored in the event function outputPulldownFromTable( $db_conn, $table, $value_col, $label_col, $name = "", $selection = "" ) { if (!isSet( $name ) ) { $name = $table; } $query = "SELECT * from $table ORDER BY $label_col"; if (!$result_id = @pg_exec( $db_conn, $query )) { return $php_errormsg; } echo( "<SELECT NAME=\"" . $name . "\">\n" ); $index = 0; if( isSet( $GLOBALS[$name] ) ) $selected = $GLOBALS[$name]; else $selected = ""; while( $option = @pg_fetch_array( $result_id, $index++ ) ) { echo( "<OPTION VALUE=\"" . $option[$value_col] . "\"" . ( $selection != "" ? ( $option[$value_col] == $selection ? " SELECTED" : "" ) : ( $option[$value_col] == $selected ? " SELECTED" : "" ) ) . ">"); echo( $option[$label_col] . "\n" ); } echo( "</SELECT>\n" ); return 0; } function parsePulldown( $name ) { return $GLOBALS[$name]; }}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -