#!/institute/bin/perl

# routine to print the header to html
sub printheader {
   print(output "<h1>$team: $week</h1>");
   print(output "<hr>\n");
   print(output "<form method=\"GET\" action=\"/cgi-bin/lar703-save.pl\">");
}

sub one_picture {
   print(output "<h2>$file</h2>\n");
   print(output "Enter a caption:<br>\n");
   print(output "<textarea name=cap rows=2 cols=65>");
   do "$file.cap";
   print(output "$caption");   
   print(output "</textarea>");
   print(output "Enter a description:<br>\n");
   print(output "<textarea name=desc rows=5 cols=65>");
   do "$file.des";
   print(output "$description");
   print(output "</textarea>");

}

# routine to print message that there were no hits
sub printnone {
   print(output "<h1>$state Military Rosters</h1>");
   print(output "There were no matches for the search you requested");
}


#########################
######### MAIN PROGRAM ##
#########################

# grab parameters to build the search criteria
$qstring=$ENV{"QUERY_STRING"};
$qstring=~tr/\+*/ /; 
#print (output "$qstring<br>");
%p=split(/[=&]/,$qstring);

$team=$p{team};
$week=$p{week};

# set directory path
$d="/institute/web/stern/lar702";

# open files

$file="test";

open (output, ">&STDOUT");

#inititalize HTML output
print(output "Content-type: text/html\n");
print(output "\n");

&printheader;

&one_picture;

print(output "</body></html>\n");

close (input);
close (output);
