aboutsummaryrefslogtreecommitdiff
path: root/GradeBook.tcl
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-01-19 23:42:03 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-01-19 23:42:03 -0500
commitecb25d6adcbddf38c38c37494bfa040d4872b49c (patch)
tree8cbe6add6f7665ce7e5d10b2ae5e002fb721968e /GradeBook.tcl
parentea3a7a8a7b1325f0224c40eaf2b446a115f4559e (diff)
downloadGradeBook-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
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-xGradeBook.tcl37
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>"
}