A lot of work on scan. Tables used to display scan terms and hits.
[egate.git] / www / mquery.egw
1 <html>
2 <head>
3 <title> WWW/Z39.50 Gateway Query Form</title>
4 </head>
5 <body>
6 {
7 # $Id: mquery.egw,v 1.11 1996/01/26 15:50:07 adam Exp $
8
9     if {[info commands saveState] == ""} {
10         source z39util.tcl
11     }
12
13     global setNo
14     global nextSetNo
15     global hist
16     global targets
17
18     if {[catch {set setNo $nextSetNo}]} {
19         set nextSetNo 1
20         set setNo 1
21     }
22
23     set useIcons 1
24     button-europagate
25     button-new-target 0
26
27     html {<form action="http:} $env(SCRIPT_NAME)
28     html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
29
30     set phost {}
31     set i 0
32     foreach t [lsort [egw_form target]] {
33         set host [lindex $t 0]
34         set base [lindex $t 1]
35         if {$host != $phost} {
36             set phost $host
37             incr i
38             set hist($setNo,$i,host) $host
39             set hist($setNo,$i,idAuthentication) [lindex $targets($host) 3]
40         }
41         lappend hist($setNo,$i,database) $base
42     }
43     set oSetNo [lindex $sessionParms 0]
44     if {$i == 0 && $oSetNo != ""} {
45         for {set i 1} {$i <= $hist($oSetNo,0,host)} {incr i} {
46             set hist($setNo,$i,host) $hist($oSetNo,$i,host)
47             set hist($setNo,$i,idAuthentication) \
48                 $hist($oSetNo,$i,idAuthentication)
49             set hist($setNo,$i,database) $hist($oSetNo,$i,database)
50         }
51         incr i -1
52     }
53     if {$i == 0} {
54         html "<h2>No targets specified</h2></body></html>"
55         egw_abort 1
56     }
57     set hist($setNo,0,host) $i
58
59     html "Input your search criteria:<br>\n"
60     set fields [lindex $targets($host) 2]
61     for {set no 1} {$no < 4} {incr no} {
62         html {<select name="menu} $no {">} \n
63         foreach f $fields {
64             html {<option> } [lindex $f 0] \n
65         }
66         html "</select>\n"
67         html {<input type="text" name="entry} $no {" size=35>} \n
68         if {$no < 3} {
69             html {<select name="logic} $no {">} \n
70             html "<option> And\n"
71             html "<option> Or\n"
72             html "<option> And not\n"
73             html "</select>\n"
74         }
75         html "<br>\n"
76     }
77     html {<input type=submit value="Search"><input type=reset value="Reset">}
78     html "<br>\n"
79     html {Number of records to display in the result set list: }
80     html {<input type="text" name="hits" value="}
81     html 10
82     html {" size=3></form>}
83     
84     set useIcons 0
85     button-europagate
86     button-new-target 0
87 }
88 {
89     catch maintenance
90     if {!$debug} return
91     html "<hr>\n"
92     html "<h3>Debug information</h3>\n"
93     html "sessionId: $sessionId <br>\n"
94     html "sessionParms: $sessionParms <br>\n"
95     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
96         html $e {: } $env($e) {<br>} \n
97     }
98     set j $hist($setNo,0,host)
99     for {set i 1} {$i <= $j} {incr i} {
100         html "host=" $hist($setNo,$i,host) " " $hist($setNo,$i,database) 
101         html "<br>\n"
102     }
103     html "form: " [egw_form] " <br>\n"
104     html "target: " $host " <br>\n"
105     html "setNo: " $setNo " <br>\n"
106     html "nextSetNo: " $nextSetNo " <br>\n"
107 }
108 </body></html>