Work on scan.
[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.6 1995/12/21 15:49:51 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     html {<form action="http:} $env(SCRIPT_NAME)
24     html / $sessionId {/msearch.egw/} $setNo {" method=post>} \n
25
26     set phost {}
27     set i 0
28     foreach t [lsort [wform target]] {
29         set host [lindex $t 0]
30         set base [lindex $t 1]
31         if {$host != $phost} {
32             set phost $host
33             incr i
34             set hist($setNo,$i,host) $host
35             set hist($setNo,$i,idAuthentication) [lindex $targets($host) 3]
36         }
37         lappend hist($setNo,$i,database) $base
38     }
39     if {$i == 0} {
40         html "<h2>No targets specified</h2></body></html>"
41         wabort 1
42     }
43     set hist($setNo,0,host) $i
44 }
45 <h2>Input your search criteria: </h2><br>
46 {
47     set fields [lindex $targets($host) 2]
48     for {set no 1} {$no < 4} {incr no} {
49         html {<select name="menu} $no {">} \n
50         foreach f $fields {
51             html {<option> } [lindex $f 0] \n
52         }
53         html "</select>\n"
54         html {<input type="text" name="entry} $no {" size=35>} \n
55         if {$no < 3} {
56             html {<select name="logic} $no {">} \n
57             html "<option> And\n"
58             html "<option> Or\n"
59             html "<option> And not\n"
60             html "</select>\n"
61         }
62         html "<br>\n"
63     }
64 }
65 <input type=submit value="Search"><input type=reset value="Reset">
66 <br>
67 {
68     html {Number of records to display in the result set list: }
69     html {<input type="text" name="hits" value="}
70     html 10
71     html {" size=3>}
72 }
73 </form>
74 {
75     global useIcons
76     if {$useIcons} {
77         html {<img src="/gif/button-egw.gif">}
78     }    
79     html {<a href="http:} $env(SCRIPT_NAME)
80     html / $sessionId {/mtargets.egw}
81     if {$useIcons} {
82         html {"><img src="/gif/button-new-target.gif" border=0></a>}
83     } else {
84         html {"> New target </a>}
85     }
86 }
87 <hr>
88 This page is maintained by <a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.
89 Last modified 29. september 1995. <br>
90 <em> This and the following pages are under construction
91 and will continue to be so until the end of December 1995.</em>
92 {
93     html "<hr>\n"
94     html "<h3>Debug information</h3>\n"
95     html "sessionId: $sessionId <br>\n"
96     html "sessionParms: $sessionParms <br>\n"
97     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
98         html $e {: } $env($e) {<br>} \n
99     }
100     set j $hist($setNo,0,host)
101     for {set i 1} {$i <= $j} {incr i} {
102         html "host=" $hist($setNo,$i,host) " " $hist($setNo,$i,database) 
103         html "<br>\n"
104     }
105     html "form: " [wform] " <br>\n"
106     html "target: " $host " <br>\n"
107     html "setNo: " $setNo " <br>\n"
108     html "nextSetNo: " $nextSetNo " <br>\n"
109 }
110 </body></html>