diff options
-rw-r--r-- | GradeBook.css | 4 | ||||
-rwxr-xr-x | GradeBook.tcl | 37 |
2 files changed, 34 insertions, 7 deletions
diff --git a/GradeBook.css b/GradeBook.css index 3c9e22f..85335b6 100644 --- a/GradeBook.css +++ b/GradeBook.css @@ -25,7 +25,7 @@ div.login { margin-bottom: 15px; } -div.logoff { +div.greetings { /*border-bottom: 2px solid black;*/ background-color: #ffcc99; padding-top: 5px; @@ -33,7 +33,7 @@ div.logoff { margin-bottom: 15px; } -div.logoff span.login { +div.greetings span.login_info { background-color: #ffcc99; font-weight: bold; } 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>" } |