#!/usr/bin/tclsh
# maybe  change upper line for NEXTSTEP
# ChM 25.12.2001

proc encode {w} {
    regsub -all { } $w {_} w
    return $w
}

set query $env(QUERY_STRING)

proc empty {w} { return [string match "" $w] }

puts {Content-type: text/html



<html>
<head>
<title>Einfache Suche - Monat</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">
<table width="464" border="0" cellpadding="5" align="center">
  <tr bgcolor="#336600"> 
    <td height="66"> 
      <p><font size="+3" color="#FFFFFF">Einfache Pflanzensuche<br>
        <i><font size="+2">easy </font></i></font><i><font size="+2" color="#FFFFFF">plant 
        search</font></i></p>
      </td>
  </tr>
  <tr> 
 <td>

}


# Farbe
if [regexp {farbe=([0-9a-zA-Z+%\-]*)} $query z color] {
if ![empty $color] {
 puts "<p>Farbe: $color</p>"
}   } { set color ""
 puts "<p>Farbe: unbestimmt</p>"
 }

# Wuchshoehe
if [regexp {hoehe=([0-9a-zA-Z+%\-]*)} $query z height] {
if ![empty $height] {

}   } { set height "" }

if [regexp {hoehemax=([0-9a-zA-Z+%\-]*)} $query z heightmax] {
if ![empty $heightmax] {
puts "<p>Wuchsh&ouml;he: $height - $heightmax cm </p>"
}   } { set heightmax 0
 puts "<p>Wuchsh&ouml;he: unbestimmt </p>"
}



puts "<p>Bitte klicken Sie auf den Monat, in dem Sie die Pflanze bl&uuml;hen gesehen "
puts "  haben:<br>"
puts "  <i>Please choose the month in which you have seen the plant blossom:</i></p>"
puts "<table width=\"469\" border=\"0\" cellpadding=\"1\">"
puts "  <tr>"
puts "    <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=1&sortier=deutscher+Name\">Januar "
puts "      / <i>january</i></a></td>"
puts "    <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=7&sortier=deutscher+Name\">Juli "
puts "      / <i>july</i></a></td>"
puts "  </tr>"
puts "  <tr>"
puts "    <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=2&sortier=deutscher+Name\">Februar "
puts "      / <i>february</i></a></td>"
puts "   <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=8&sortier=deutscher+Name\">August "
puts "      / <i>august</i></a></td>"
puts "  </tr>"
puts "  <tr>"
puts "    <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=3&sortier=deutscher+Name\">M&auml;rz "
puts "      / <i>march</i></a></td>"
puts "    <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=9&sortier=deutscher+Name\">September "
puts "      / <i>september</i></a></td>"
puts "  </tr>"
puts "  <tr>"
puts "    <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=4&sortier=deutscher+Name\">April "
puts "      / <i>april</i></a></td>"
puts "    <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=10&sortier=deutscher+Name\">Oktober "
puts "      / <i>october</i></a></td>"
puts "  </tr>"
puts "  <tr>"
puts "    <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=5&sortier=deutscher+Name\">Mai "
puts "      / <i>may</i></a></td>"
puts "    <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=11&sortier=deutscher+Name\">November "
puts "      / <i>november</i></a></td>"
puts "  </tr>"
puts "  <tr>"
puts "    <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=6&sortier=deutscher+Name\">Juni "
puts "      / <i>june</i></a></td>"
puts "    <td><a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&amp;monat=12&sortier=deutscher+Name\">Dezember "
puts "      / <i>december</i></a></td>"
puts "  </tr>"
puts "</table>"
puts "<p>Bl&uuml;tezeitraum ist <a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&sortier=deutscher+Name\">unbekannt "
puts "  / unbestimmt</a>.<br>"
puts "  <i>Time is <a href=\"/cgi-bin/psearch.pl?farbe=$color&amp;hoehe=$height&amp;hoehemax=$heightmax&sortier=deutscher+Name\">not "
puts "  known / anytime</a>.</i><br>"
puts "</p>"
puts "<p>&nbsp;</p>"
puts "</table>"
puts "</body>"
puts "</html>"