#!/usr/local/bin/perl
print "Content-type: text/plain\r\n\r\n";
print "
JARE38-42 DMSP DATA";
print "";
print "DMSP DataBase (JARE38-42)
";
#
# for FORM(POST)
$query_string=$ENV{'QUERY_STRING'};
@param = split(/&/, $query_string);
#
($field_name, $yy)=split(/=/, $param[0]);
($field_name, $mm)=split(/=/, $param[1]);
($field_name, $dd)=split(/=/, $param[2]);
print "Year: $yy, Month: $mm, Day: $dd
";
open DB, "/usr/local/mysql/bin/mysql -N -e 'select dt,jare,fn from dmsp.gif where \"$yy-$mm-$dd\" < dt and dt < \"$yy-$mm-$dd 23:59:59\" order by dt'|";
$rl = 0;
print "";
while () {
($dd,$tt,$jare,$fn) = split();
if($rl == 0) {print ""};
print "";
print "![](./JARE",$jare,"_GIF/$fn) $dd $tt
| \r\n";
if($rl == 3) {print "
"};
$rl = ($rl+1)%4;
}
print "
";