#!/usr/local/bin/tclsh8 # # dbview.cgi # # Web script to build a dynamic page based on a miniDB.tcl text database. # Developed as a way to view BN experiment results. # # 1998jul27 dpwe@icsi.berkeley.edu # $Header: /n/yam/da/dpwe/public_html/bn/RCS/dbview.cgi,v 1.2 1998/07/28 06:54:18 dpwe Exp $ # Load web util fns source "./cgi-utils.tcl" # includes setting up machtype package require Dpwe_Utilfns #package require MiniDB source "miniDB.tcl" # Do we put a query form at the bottom? set showform 1 # Retrieve the fields set db "" set filter "" set cols "" set sort "" set back "" set vars "" if { [set msg [CheckGetEnvironment]] == ""} { set vars [GetGetVars] } # Default: no db and no colnames set colnames "" # Title relates to database file set name "dbview on $db" puts "Content-type: text/html\n" puts "" puts "
" puts "(Tcl-version is $tcl_version)
" puts "Generated: | [clock format [clock sec]] |
Database: | $db |
Filter: | $filter |
Display cols: | $cols |
Sort cols: | $sort |
Showing [llength [lindex $dbs 1]] of $ntotrec records. Click on a column title to sort by that column:
" # What would be the URL to get back here, with a "%s" to fill in cols? set myurl "$env(SCRIPT_NAME)?db=[Gettify $db]&filter=[Gettify $filter]&cols=[Gettify $cols]&sort=%s" # Format to HTML set tbl [DBFormatHTML $dbs $myurl] # Output puts $tbl } if {$back != ""} { puts "