#!/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 ;
$batch_file =`echo $string | awk -F\",\" '{print \$3}'`;
$batch_file =~s/\s//g ;

print "Content-type: text/html\n\n";
###############contents insert#########
system("cat ../elements/header");
print "<div class=\"large-8 columns\">";
print "<h4>${project}::${jobnet}";

unless( $batch_file eq new ){
  print "::<a href=\"./batch_download.cgi?${project},${jobnet},${batch_file}\">${batch_file}</a>";
}
print "</h4>";

print "<form action=\"./batch_upload.cgi?${project},${jobnet}\" method=\"POST\" ENCTYPE=\"multipart/form-data\">";
print "<input type=\"file\" name=\"uploadFile\">";
print "<br></br>";
print "<input type=\"submit\" class=\"small button\" value=\"Upload batch\">";
print "</form>";
print "</div>";
print "<div class=\"large-4 columns\">";
print "<div style=\"padding-left:12px;padding-top:12px;\">";
print "<a href=\"./set_jobnet_form.cgi?${project},${jobnet}\">Back to Jobnet Setting</a></p>";
unless( $batch_file eq new ){
  print "<a href=\"./batch_delete.cgi?${project},${jobnet},${batch_file}\">Delete This Batch File</a></p>";
}
print "</div>";
print "</div>";
system("cat ../elements/footer");
