#!/usr//bin/perl 

require "ctime.pl";

$adminmail = "sjg\@coloradolinux.com";

# make files readable
umask(011);

# disable buffering
$| = 1;

# Try to Get rid of noise from gnuplot
open(STDERR,">/dev/null");

# read in STDIN from the browser
$size_of_form_information = $ENV{'CONTENT_LENGTH'};
read (STDIN, $form_info, $size_of_form_information );


@key_value_pairs = split (/&/, $form_info);
foreach $key_value (@key_value_pairs)
{
	($key, $value) = split (/=/, $key_value);
	$value =~ tr/+/ /;
	$value =~ s/%([\dA-Fa-f]{2})/pack ("C",hex ($1))/eg;
	$value =~ s/\r\n\r\n/<p>/g;     # convert paragraph marks to html pgraps
	$value =~ s/\r\n/<br>/g;                # same but for dos
	$value =~ s/\n/<br>/g;          # same but for dos
	#print "<tr><td><b>$key</b><td>$value";
	$$key = $value;
}

# Print HTML Response
print "Content-type: text/html","\n\n";
print "
<HTML>
<HEAD>
<TITLE>Search USNCTAM'06 Talks</TITLE></HEAD>
<body test=#000000 bgcolor=lightblue link=#0000EE vlink=#551A8B alink=#FF0000>
<font class='form_field' face='Verdana, Arial, Helvetica, sans-serif'>
<CENTER>
<h2> Search USNCTAM'06 Talks</h2>
<b>Any fields left blank are unrestricted. </b> <br> 
If you want to search web pages or abstract <br>
content, please use our other <a href=http://strike.coloradolinux.com/search.html> search utility. </a>

<form action=runsearch.pl method=POST>
<br>
<center>
<input type=hidden name=station5 value=''>
<p> Session 
<input type=text name=session value=''>
<p> Day of Week 
<input type=text name=day value=''>
<p> Time 
<input type=text name=time value=''>
<p> Author 
<input type=text name=author value=''>
<p> Title 
<input type=text name=title value=''>

<p><input TYPE=submit VALUE=search>
<br>
<br>
<p></form>
</body>
</html>
";
