Major revision. Single-target result set can be reached from the
[egate.git] / www / nwi.egw
1 <html>
2 {
3 # $Id: nwi.egw,v 1.3 1996/03/13 14:07:30 adam Exp $
4     source ztargets.conf
5
6     set scriptQuery nwi.egw
7     set scriptTarget {}
8     set utilExtension nwiutil.tcl
9
10     if {[info commands saveState] == ""} {
11         source z39util.tcl
12     }
13     if {![info exists debug]} {
14         if {[lindex $sessionParms 1] == "1"} {
15             set debug 1
16         } else {
17             set debug 0
18         }
19     }
20     set html3 [lindex $sessionParms 0]
21     if {[string length $html3] == 0} {
22         if {![info exists env(HTTP_USER_AGENT)]} {
23             set html3 1
24         } elseif {[string first Mozilla $env(HTTP_USER_AGENT)] == 0} {
25             set html3 1
26             egw_log debug "New user using Netscape"
27         } else {
28             set html3 0
29             egw_log debug "New user Not using Netscape"
30         }
31     }
32 }
33 <head>
34 <title> Nordic Web Index, Simple search </title>
35 </head>
36 <body>
37 {
38     global setNo
39     global nextSetNo
40     global hist
41     global targets
42
43     if {[catch {set setNo $nextSetNo}]} {
44         set nextSetNo 1
45         set setNo 1
46     }
47
48     set useIcons 1
49     button-main
50
51     set curSort score
52     set curFormat brief
53     set curEntry {}
54
55     set initSet 0
56     catch {
57         set initSet [lindex $sessionParms 0]
58         if {$initSet < 0} {
59             set initSet 0
60         }
61         if {$initSet} {
62             for {set i 1} {$i <= $hist($initSet,0,host)} {incr i} {
63                 lappend curTargets $hist($initSet,$i,host)
64             }
65             set curSort $hist($initSet,sort)
66             set curFormat $hist($initSet,format)
67             set curEntry $hist($initSet,form,entry1)
68         }
69     }
70     html {<form action="http:} $env(SCRIPT_NAME)
71     html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
72
73     html "<dl>"
74     html {<dt><b>Enter your query</b><dd>}
75
76     html {<input type="text" name="entry1" size=50 value="}
77     html [join $curEntry] {">}
78     html {<input type=submit value="Search"><br>}
79
80     html {<dt><b>and search the following servers</b><dd>}
81
82     foreach t {
83             {nwi.ub2.lu.se/sverige}
84             {nwi.ub2.lu.se/new_nor_lib} 
85             {localhost:9999/test}
86             {localhost:210/Default}
87         } {
88         html {<input type="checkbox" name="host" }
89         if {[info exists curTargets]} {
90             if {[lsearch -exact $curTargets $t] != -1} {
91                 html {checked }
92             }
93         }
94         html {value="} $t {"> } [lindex $targets($t) 0]
95     }
96     catch {unset curTargets}
97     html {<p><dt><b>Display each record in <select name="format"><dd>}
98     if {![string compare $curFormat brief]} {
99         html "<option>brief\n"
100         html "<option>medium\n"
101     } else {
102         html "<option>medium\n"
103         html "<option>brief\n"
104     }
105     html "</select> notation"
106     html { and sort by <select name="sort">}
107     if {![string compare $curSort score]} {
108         html "<option>score\n"
109         html "<option>server\n"
110     } else {
111         html "<option>server\n"
112         html "<option>score\n"
113     }
114     html "</select></b><br></dl>\n"
115
116     set useIcons 0
117     button-main
118
119     catch maintenance
120 }
121
122