3 # $Id: nwi.egw,v 1.7 1996/05/22 16:50:26 adam Exp $
6 set scriptQuery nwi.egw
8 set utilExtension nwiutil.tcl
10 if {![info exists debug]} {
11 if {[lindex $sessionParms 1] == "1"} {
17 if {[info commands saveState] == ""} {
20 set html3 [lindex $sessionParms 0]
21 if {[string length $html3] == 0} {
22 if {![info exists env(HTTP_USER_AGENT)]} {
24 } elseif {[string first Mozilla $env(HTTP_USER_AGENT)] == 0} {
26 egw_log debug "New user using Netscape"
29 egw_log debug "New user Not using Netscape"
34 <title> Nordic Web Index, Simple search </title>
43 if {[catch {set setNo $nextSetNo}]} {
58 set initSet [lindex $sessionParms 0]
63 for {set i 1} {$i <= $hist($initSet,0,host)} {incr i} {
64 lappend curTargets $hist($initSet,$i,host)
66 set curSort $hist($initSet,sort)
67 set curFormat $hist($initSet,format)
68 set curEntry $hist($initSet,form,entry1)
71 html {<form action="http:} $env(SCRIPT_NAME)
72 html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
75 html {<dt><b>Enter your query</b><dd>}
77 html {<input type="text" name="entry1" size=50 value="}
78 html [join $curEntry] {">}
79 html {<input type=submit value="Search"><br>}
81 html {<dt><b>and search the following servers</b><dd>}
84 {mars.dtv.dk:9999/Default}
85 {nwi.ub2.lu.se:2121/sverige}
88 html {<input type="checkbox" name="host" }
89 if {[info exists curTargets]} {
90 if {[lsearch -exact $curTargets $t] != -1} {
94 html {value="} $t {"> } [lindex $targets($t) 0]
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"
102 html "<option>medium\n"
103 html "<option>brief\n"
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"
111 html "<option>server\n"
112 html "<option>score\n"
114 html "</select></b><br></dl>\n"
116 html {<input type=submit value="Search"><input type=reset value="Reset">}
118 html "\n<br><p><hr>\n"
121 html {<form action="http:} $env(SCRIPT_NAME)
122 html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
125 html {<b>Advanced search</b><br>}
127 set host [lindex $hosts 0]
128 set fields [lindex $targets($host) 2]
129 for {set no 2} {$no < 6} {incr no} {
131 html {<select name="menu} $no {">} \n
134 set template [join $hist($initSet,form,menu$no)]
136 if {[string length $template] > 0} {
137 html {<option> } $template "\n"
140 set name [lindex $f 0]
141 if {$template == $name} continue
142 html {<option> } $name \n
146 html {<input type="text" name="entry} $no {" size=35 value="}
149 if {[info exists hist($initSet,form,entry$no)]} {
150 html [join $hist($initSet,form,entry$no) " "]
155 html {<select name="logic} $no {">} \n
158 set template [join $hist($initSet,form,logic$no) " "]
160 if {[string length $template] > 0} {
161 html "<option> " $template \n
163 foreach op {And Or {And not}} {
164 if {$template == $op} continue
165 html "<option> " [join $op " "] \n