#!/usr/bin/perl
#
  do "acqPATHs.pl";
  $str = $ENV{"QUERY_STRING"};
  ($Pid, $Prog, $Qidno, $Count) = split(/\+/, $str);
  print "Content-type: text/html; charset=iso-8859-1\n\n";
#
  if (kill(9,$Pid)) {
#------- Execution Aborted -------
    $htmlbody =<<EOM;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<link rel="stylesheet" type="text/css" href="/AMXS/amxs.css">
<title>AMXS execution ($Pid) aborted</title>
<script type="text/javascript">
<!--
function start() { setTimeout('refresh()', 1000); }
function refresh() {
  var count = parseInt(__COUNT__) + 1;
  parent.Ftop.location.replace("/cgi/AMXS/refresh1.cgi?"
      + "Prog=__PROG__&Qidno=__QIDNO__&Action=Aborted&Count=" + count);
}
//-->
</script>
</head>
<body bgcolor="yellow" style="margin: 4px 7px;" onload="start();">
<hr>
<big>Prog.(__PID__) <b>__PROG__</b> (QID: __QIDNO__)
 Aborted </big> (__COUNT__s)
</body>
</html>
EOM
#-------
  } else {
#------- Execution Abort Fail -------
    $htmlbody =<<EOM;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="/AMXS/amxs.css">
<title>AMXS abort FAIL</title>
</head>
<body bgcolor="red" style="margin: 4px 7px;">
<hr>
<big>ERROR: Prog.(__PID__) <b>__PROG__</b> (QID: __QIDNO__)
 Abort Fail</big> (__COUNT__s)
</body>
</html>
EOM
#-------
  }
  $htmlbody =~ s/__PID__/$Pid/g;
  $htmlbody =~ s/__PROG__/$Prog/g;
  $htmlbody =~ s/__QIDNO__/$Qidno/g;
  $htmlbody =~ s/__COUNT__/$Count/g;
  print $htmlbody;
  exit(0);
