diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2010-12-15 17:16:42 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2010-12-15 17:16:42 -0500 |
commit | 5ba2697e3103bd29b83fefdbf535da093ff317f1 (patch) | |
tree | 372d3cd0811260841aa2cc0a5973b2aea8eb4312 /GradeBook.tcl | |
parent | 655e6d6d3810ba7c3e27d8ea195a306f20c07672 (diff) | |
download | GradeBook-5ba2697e3103bd29b83fefdbf535da093ff317f1.tar.gz GradeBook-5ba2697e3103bd29b83fefdbf535da093ff317f1.zip |
sort column code modified
darcs-hash:20101215221642-067c0-9bb70ed686de08ccabe95fcc806528ba000ab569.gz
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-x | GradeBook.tcl | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl index b2dc580..c93bf67 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -1,6 +1,6 @@ #!/bin/sh # FILE: "/home/evmik/src/my_src/GradeBook/GradeBook.tcl" -# LAST MODIFICATION: "Wed, 15 Dec 2010 17:08:09 -0500 (evmik)" +# LAST MODIFICATION: "Wed, 15 Dec 2010 17:16:40 -0500 (evmik)" # (C) 2010 by Eugeniy Mikhailov, <evgmik@gmail.com> # $Id:$ # vim:set ft=tcl: \ @@ -83,8 +83,12 @@ proc htmlDBout {db {sort_col {}}} { #set x [db eval {SELECT * FROM GradesTable ORDER BY a}] #puts $x global script_name - set defSortCol LastName + set defSortCol LastName + if { $sort_col == {} } { + set sort_col $defSortCol + dbg "empty sort col changed to $sort_col" 4 + } # testing for the existense of the sorting column set eval_str [list SELECT * FROM GradesTable ORDER BY $sort_col] set err [catch {db eval $eval_str } errStat] @@ -95,9 +99,6 @@ proc htmlDBout {db {sort_col {}}} { } set show_header 1 - if { $sort_col == {} } { - set sort_col LastName - } # show the table with grades set eval_str [list SELECT * FROM GradesTable ORDER BY $sort_col] set err [catch { @@ -296,7 +297,7 @@ dbg [::ncgi::names] 4 if { $action == "logon" } { LogMeOn } if { $action == "logoff" } { LogMeOff } -dbg "Connection at $timestamp for user $user" +dbg "===== Connection at $timestamp for user $user =====" set permissions [AccessGroupRights db $user $password] ::ncgi::header |