diff options
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-x | GradeBook.tcl | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl index a1cca36..0bb4a3f 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -173,7 +173,7 @@ proc htmlTop {permission_list} { if { $permission(GroupName) == "guest" } { askToLogin } else { - LogOffOption + Greetings } } @@ -186,11 +186,38 @@ proc htmlFooter {permission_list} { puts "</div>" } -proc LogOffOption {} { +proc Greetings {} { global user password script_name - puts "<div class=\"logoff\">" - puts "You are logged in as <span class=login>$user</span> do you wish to " - puts "<a href=\"$script_name?action=logoff\">logoff</a>" + + set FirstName UnknownFirstName + set LastName UnknownLastName + + # get First name info + set eval_str "SELECT \"FirstName\" FROM GradesTable where UserName=\"$user\"" + set err [catch { + db eval $eval_str v { + set FirstName $v(FirstName) + } + } errStat ] + if { $err } { + htmlErrorMsg $errStat + dbg "the following error happen: $errStat" 3 + } + # get Last name info + set eval_str "SELECT \"LastName\" FROM GradesTable where UserName=\"$user\"" + set err [catch { + db eval $eval_str v { + set LastName $v(LastName) + } + } errStat ] + if { $err } { + htmlErrorMsg $errStat + dbg "the following error happen: $errStat" 3 + } + + puts "<div class=\"greetings\">" + puts "<span class=login_info>$FirstName $LastName</span>, you are logged in as <span class=login_info>$user</span>." + #puts "<a href=\"$script_name?action=logoff\">logoff</a>" puts "</div>" } |