summaryrefslogtreecommitdiff
path: root/GradeBook.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-xGradeBook.tcl19
1 files changed, 10 insertions, 9 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl
index 6c04ad4..7b7adf4 100755
--- a/GradeBook.tcl
+++ b/GradeBook.tcl
@@ -1,6 +1,6 @@
#!/bin/sh
# FILE: "/home/evmik/src/my_src/GradeBook/GradeBook.tcl"
-# LAST MODIFICATION: "Tue, 14 Dec 2010 17:23:25 -0500 (evmik)"
+# LAST MODIFICATION: "Tue, 14 Dec 2010 17:36:43 -0500 (evmik)"
# (C) 2010 by Eugeniy Mikhailov, <evgmik@gmail.com>
# $Id:$
# vim:set ft=tcl: \
@@ -43,23 +43,23 @@ set dbfile "./testdb"
sqlite3 db $dbfile
proc createDB {db} {
- db eval {CREATE TABLE t1(FirstName text, LastName text, HW01 float)}
+ db eval {CREATE TABLE GradesTable(FirstName text, LastName text, UserName text, HW01 float)}
- db eval {INSERT INTO t1 VALUES('John','Lname1', 7)}
- db eval {INSERT INTO t1 VALUES('Ale','Lname2', 5)}
- db eval {INSERT INTO t1 VALUES('Dan','Lname3',9)}
- #db1 eval {ALTER TABLE t1 ADD c int }
+ db eval {INSERT INTO GradesTable VALUES('John','Lname1', 'jhn', 7)}
+ db eval {INSERT INTO GradesTable VALUES('Ale','Lname2', 'ale', 5)}
+ db eval {INSERT INTO GradesTable VALUES('Dan','Lname3', 'dan', 9)}
+ #db1 eval {ALTER TABLE GradesTable ADD c int }
}
proc htmlDBout {db {sort_col {}}} {
- #set x [db eval {SELECT * FROM t1 ORDER BY a}]
+ #set x [db eval {SELECT * FROM GradesTable ORDER BY a}]
#puts $x
global script_name
set defSortCol LastName
# testing for the existense of the sorting column
- set eval_str [list SELECT * FROM t1 ORDER BY $sort_col]
+ set eval_str [list SELECT * FROM GradesTable ORDER BY $sort_col]
set err [catch {db eval $eval_str } errStat]
if { $err } {
dbg $errStat 3
@@ -72,7 +72,7 @@ proc htmlDBout {db {sort_col {}}} {
set sort_col LastName
}
# show the table with grades
- set eval_str [list SELECT * FROM t1 ORDER BY $sort_col]
+ set eval_str [list SELECT * FROM GradesTable ORDER BY $sort_col]
set err [catch {
db eval $eval_str v {
if { $show_header } {
@@ -186,6 +186,7 @@ proc ChoseAction {action} {
}
##################### end of procs ####################################
+#createDB db
dbg [::ncgi::names] 4
dbg "sdaf dsaf $action "
ChoseAction $action