edu_department_select db { default_dept_id " " } { select_name "department_id" } { include_null_entry_p "t" }What it does:
This returns a string that is a select box listing all of the departments.Defined in: /web/philip/tcl/education.tcl
Source code:
set selection [ns_db select $db "select department_name, department_id from edu_departments order by department_name, department_number"]
set html "<select name=\"$select_name\">"
if {[string compare $include_null_entry_p t]} {
append html "<option value=\"\"> ---"
}
while { [ns_db getrow $db $selection] } {
set_variables_after_query
if {[string compare $department_id $default_dept_id] == 0} {
append html "<option value=$department_id selected>$department_name \n"
} else {
append html "<option value=$department_id>$department_name \n"
}
}
append html "</select>"
return $html