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