diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-19 23:42:03 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-19 23:42:03 -0500 |
commit | ecb25d6adcbddf38c38c37494bfa040d4872b49c (patch) | |
tree | 8cbe6add6f7665ce7e5d10b2ae5e002fb721968e | |
parent | ea3a7a8a7b1325f0224c40eaf2b446a115f4559e (diff) | |
download | GradeBook-ecb25d6adcbddf38c38c37494bfa040d4872b49c.tar.gz GradeBook-ecb25d6adcbddf38c38c37494bfa040d4872b49c.zip |
logoff chenged to greeting division with porper First Last name selection
Ignore-this: ab69b6f9a4eb2e399463887bc70cce71
darcs-hash:20110120044203-067c0-098a3a18bb2f55f298b07670a88cda3baf01eafc.gz
-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>" } |