#!/usr/bin/perl
use CGI qw(param);

$home="/usr/local/e-cron";
$string = $ENV{'QUERY_STRING'};
$string =~s/\///g ;
$project =`echo $string | awk -F\",\" '{print \$1}'`;
$project =~s/\s//g ;
$jobnet =`echo $string | awk -F\",\" '{print \$2}'`;
$jobnet =~s/\s//g ;
$server =`echo $string | awk -F\",\" '{print \$3}'`;
$server =~s/\s//g ;

print "Content-type: text/html\n\n";
###############contents insert#########
system("cat ../elements/header");
print "<h3>${project}::${jobnet}::${server} loglist</h3>";

@LOGLIST=();
@LOGLIST=`sudo -u ejobmgr /usr/local/e-cron/bin/for_cgi/ls_log ${project}/${jobnet} ${server}`;

foreach $log (@LOGLIST){
  print "<p><a href=\"./cat_log.cgi?${project},${jobnet},${server},${log}\">$log</a></p>";
}
system("cat ../elements/footer");
