You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

571 lines
21 KiB

#!/usr/bin/perl
#
# $Id: sreports.pl,v 1.4 2006/01/23 21:39:30 ddoughty Exp $
#
# Source File: sreports.pl
# Get config
require 'sitecfg.pl';
require 'testlib.pl';
require 'tstatlib.pl';
$FORM{'frm'}="";
&app_initialize;
warn "INFO: " . __FILE__ . " running.\n" ;
print "Content-Type: text/html\n\n";
if (&get_session($FORM{'tid'})) {
&LanguageSupportInit();
$REPORT{'rptid'}="";
@rptdefs = &get_data("sitereports.dat");
@lbls = split(/&/, $rptdefs[0]);
foreach $rptdef (@rptdefs) {
chomp ($rptdef);
@flds = split(/&/, $rptdef);
if ($flds[0] eq $FORM{'rptno'}) {
for $i (0 .. $#lbls) {
$REPORT{$lbls[$i]} = $flds[$i];
$i++;
}
}
}
if ($FORM{'frm'} == '1' || ($FORM{'frm'} == '' && $REPORT{'rptid'} eq "ACT-004")) {
&show_index;
} else {
if ($FORM{'frm'} == '2') {
&show_detail;
}
else {
if ($FORM{'frm'} == '') {
&show_frames;
} else {
print "<HTML>\n";
print "<HEAD></HEAD>\n";
print "<BODY BACKGROUND=\"$SYSTEM{'BACKGROUND'}\" BGCOLOR=\"$SYSTEM{'BGCOLOR'}\"
TEXT=\"$SYSTEM{'TEXT'}\" LINK=\"$SYSTEM{'LINK'}\"
VLINK=\"$SYSTEM{'VLINK'}\" ALINK=\"$SYSTEM{'ALINK'}\">
</BODY>\n";
print "</HTML>\n";
}
}
}
}
sub show_frames {
print "<HTML>\n";
print "<HEAD></HEAD>\n";
print "<FRAMESET frameborder=0 cols=\"30%,*\">\n";
print "<FRAME name=\"rptindex\" frameborder=0 src=\"$cgiroot/sreports.pl?lang=$SESSION{'lang'}&tid=$SESSION{'tid'}&frm=1&rptno=$FORM{'rptno'}\">\n";
print "<FRAME name=\"rptdetail\" frameborder=0 src=\"$cgiroot/sreports.pl?lang=$SESSION{'lang'}&tid=$SESSION{'tid'}&frm=0\">\n";
print "</FRAMESET>\n";
print "</HTML>\n";
}
sub show_index {
&log_entry($SESSION{'clid'}, $SESSION{'uid'}, "2", "Exec Report $FORM{'rptno'}");
print "<HTML>\n";
print "<HEAD>\n<TITLE>$REPORT{'rptid'} - $REPORT{'rptdesc'}</TITLE>\n</HEAD>\n";
print "<BODY BACKGROUND=\"$SYSTEM{'BACKGROUND'}\" BGCOLOR=\"$SYSTEM{'BGCOLOR'}\"
TEXT=\"$SYSTEM{'TEXT'}\" LINK=\"$SYSTEM{'LINK'}\"
VLINK=\"$SYSTEM{'VLINK'}\" ALINK=\"$SYSTEM{'ALINK'}\">
\n";
print "<B>$REPORT{'rptid'}<BR>$REPORT{'rptdesc'}</B><BR>&nbsp;<BR>\n";
if ($REPORT{'rptid'} eq 'ACT-001') {
opendir(DIR, "$logroot");
@dircon = readdir(DIR);
closedir DIR;
@sdircon = sort @dircon;
foreach $diritem (@sdircon) {
chomp ($diritem);
if ($diritem =~ /sess\.[0-9]/i ) {
@lines = &get_log($diritem);
foreach $line (@lines) {
chomp ($line);
($nm,$vlu)=split(/=/, $line);
$SESS{$nm}=$vlu;
}
$tmstr = &format_date_time("yy-mm-dd hh:nn", "1", "-10000", substr($SESS{'tid'}, 0, -4));
print "<FONT SIZE=2>$tmstr</FONT> <A HREF=\"$cgiroot/sreports.pl?tid=$SESSION{'tid'}&frm=2&rptno=$FORM{'rptno'}&dbfile=$SESS{'clid'}.$SESS{'uid'}&filter=$SESS{'tid'}\" TARGET=\"rptdetail\">$SESS{'uid'}.$SESS{'clid'}</A><BR>\n";
}
}
} elsif ($REPORT{'rptid'} eq 'ACT-002') {
print "<HR WIDTH=\"100%\">\n";
print "<B>Tests Pending:</B><BR>\n";
opendir(DIR, "$testpending");
@dircon = readdir(DIR);
closedir DIR;
@sdircon = sort @dircon;
foreach $diritem (@sdircon) {
chomp ($diritem);
if ($diritem =~ /[a-zA-Z0-9](.*).[a-zA-Z0-9](.*).[a-zA-Z0-9]/i ) {
print "<FONT SIZE=2><A HREF=\"$cgiroot/sreports.pl?tid=$SESSION{'tid'}&frm=2&location=0&rptno=$FORM{'rptno'}&dbfile=$diritem\" TARGET=\"rptdetail\">$diritem</A></FONT><BR>\n";
}
}
print "<HR WIDTH=\"100%\">\n";
print "<B>Tests in Progress:</B><BR>\n";
opendir(DIR, "$testinprog");
@dircon = readdir(DIR);
closedir DIR;
@sdircon = sort @dircon;
foreach $diritem (@sdircon) {
chomp ($diritem);
if ($diritem =~ /[a-zA-Z0-9](.*).[a-zA-Z0-9](.*).[a-zA-Z0-9]/i ) {
print "<FONT SIZE=2><A HREF=\"$cgiroot/sreports.pl?tid=$SESSION{'tid'}&frm=2&location=1&rptno=$FORM{'rptno'}&dbfile=$diritem\" TARGET=\"rptdetail\">$diritem</A></FONT><BR>\n";
}
}
print "<HR WIDTH=\"100%\">\n";
print "<B>Tests Completed:</B><BR>\n";
opendir(DIR, "$testcomplete");
@dircon = readdir(DIR);
closedir DIR;
@sdircon = sort @dircon;
foreach $diritem (@sdircon) {
chomp ($diritem);
if ($diritem =~ /[a-zA-Z0-9](.*).[a-zA-Z0-9](.*).[a-zA-Z0-9]/i ) {
print "<FONT SIZE=2><A HREF=\"$cgiroot/sreports.pl?tid=$SESSION{'tid'}&frm=2&location=2&rptno=$FORM{'rptno'}&dbfile=$diritem\" TARGET=\"rptdetail\">$diritem</A></FONT><BR>\n";
}
}
} elsif ($REPORT{'rptid'} eq 'ACT-004') {
# C_004
$faction="$cgiroot/IntegroStats.pl";
$ftarget="rptwindow";
$fparms="<input type=hidden name=\"tid\" value=\"$SESSION{'tid'}\">\n";
$fparms=join('',$fparms,"<input type=hidden name=\"tstid\" value=\"\">\n");
### DED 10/25/2002 Added rptdesc and rptid to pass to creportsf
$fparms=join('',$fparms,"<input type=hidden name=\"rptdesc\" value=\"$REPORT{'rptdesc'}\">\n");
$fparms=join('',$fparms,"<input type=hidden name=\"rptid\" value=\"$REPORT{'rptid'}\">\n");
$finputs="<table cellpadding=2 border=1>\n";
$finputs=join('',$finputs,"\t<tr>\n\t\t<td colspan=3 align=center valign=top>Advanced Options<br></td>\n</tr>\n");
$finputs=join('',$finputs,"<tr>\n");
$finputs=join('',$finputs,"\t\t<td valign=top><font size=2>\n<i>Question Statistics:</i><br>\n");
$finputs=join('',$finputs,"<input type=radio name=\"testsummary\" value=\"composite\" onClick=\"return reportOptions(this)\"> Question Statistics<br>\n");
$finputs=join('',$finputs,"\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<input type=checkbox name=\"showobs\" onClick=\"return reportOptions(this)\"> include inactive questions<br>\n");
$finputs=join('',$finputs,"\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<input type=checkbox name=\"exnoresp\"> exclude No Response from stats<br>\n");
$finputs=join('',$finputs,"\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<i>User Comments:</i><br>\n");
$finputs=join('',$finputs,"\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<input type=radio name=\"showcmts\" value=\"donot\" onClick=\"return reportOptions(this)\"> do not include<br>\n");
$finputs=join('',$finputs,"\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<input type=radio name=\"showcmts\" value=\"withq\" onClick=\"return reportOptions(this)\"> include with question<br>\n");
$finputs=join('',$finputs,"\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<input type=radio name=\"showcmts\" value=\"atend\" onClick=\"return reportOptions(this)\"> include at end<br>\n");
$finputs=join('',$finputs,"\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<input type=radio name=\"showcmts\" value=\"atendwonocomm\" onClick=\"return reportOptions(this)\"> include at end without uncommented questions<br>\n");
$finputs=join('',$finputs,"\t\t</font></td>\n");
### DED 12/23/04 Removed Test Stats & Other Options
#$finputs=join('',$finputs,"\t\t<td valign=top><font size=2>\n<i>Test Statistics</i><br>\n");
#$finputs=join('',$finputs,"<input type=radio name=\"testsummary\" value=\"bycnd\" onClick=\"return reportOptions(this)\"> Individual Test results<br>\n");
#$finputs=join('',$finputs,"\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<input type=checkbox name=\"statsbysubj\" onClick=\"return reportOptions(this)\"> breakdown by subject area<br>\n");
#$finputs=join('',$finputs,"\t\t</font></td>\n");
#$finputs=join('',$finputs,"\t\t<td valign=top><font size=2>\n<i>Other Options:</i><br>");
#$finputs=join('',$finputs,"<input type=radio name=\"testsummary\" value=\"extractemail\" onClick=\"return reportOptions(this)\"> Extract From Tests<br>\n");
#$finputs=join('',$finputs,"\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<input type=checkbox name=\"cndnme\" onClick=\"return reportOptions(this)\"> Candidate Name<br>\n");
#$finputs=join('',$finputs,"\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<input type=checkbox name=\"cndeml\" onClick=\"return reportOptions(this)\"> Candidate Email Address<br>\n");
#$finputs=join('',$finputs,"\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<input type=checkbox name=\"cndscr\" onClick=\"return reportOptions(this)\"> Candidate Score<br>\n");
#$finputs=join('',$finputs,"\t\t</font></td>\n");
$finputs=join('',$finputs,"\t</tr>\n");
$finputs=join('',$finputs,"\t</tr>\n");
$finputs=join('',$finputs,"\t\t<td align=left valign=top><font size=2>\n");
### DED 12/23/04
### Removed Filter-by-question options
#$finputs=join('',$finputs,"\&nbsp\;<br>\n");
#$finputs=join('',$finputs,"<input type=checkbox name=\"filterbyques\" onClick=\"return filterCheck(this.form)\"> Filter by question<br>\n");
#$finputs=join('',$finputs,"<input type=checkbox name=\"specfilter\" onClick=\"return filterCheck(this.form)\"> Filter by user<br>\n");
#$finputs=join('',$finputs,"\t\t</font></td>\n");
#$finputs=join('',$finputs,"\t\t<td align=right valign=top><font size=2>\n");
#my $j;
#$finputs=join('',$finputs,"From: <select name=\"mofm\">\n");
#for $i (526 .. 537) {
#$j=$i-525;
#$finputs=join('',$finputs,"<option value=\"$j\">$xlatphrase[$i]\n");
#}
#$finputs=join('',$finputs,"</select><select name=\"dyfm\">\n");
#for $i (1 .. 31) {
#$finputs=join('',$finputs,"<option value=\"$i\">$i\n");
#}
#$finputs=join('',$finputs,"</select><select name=\"yrfm\">\n");
#for $i (2000 .. 2099) {
#$finputs=join('',$finputs,"<option value=\"$i\">$i\n");
#}
#$finputs=join('',$finputs,"</select><br>\n");
#$finputs=join('',$finputs,"To: <select name=\"moto\">\n");
#for $i (526 .. 537) {
#$j=$i-525;
#$finputs=join('',$finputs,"<option value=\"$j\">$xlatphrase[$i]\n");
#}
#$finputs=join('',$finputs,"</select><select name=\"dyto\">\n");
#for $i (1 .. 31) {
#$finputs=join('',$finputs,"<option value=\"$i\">$i\n");
#}
#$finputs=join('',$finputs,"</select><select name=\"yrto\">\n");
#for $i (2000 .. 2099) {
#$finputs=join('',$finputs,"<option value=\"$i\">$i\n");
#}
#$finputs=join('',$finputs,"</select><br>\n");
#$finputs=join('',$finputs,"\t\t</font></td>\n");
#$finputs=join('',$finputs,"\t\t<td align=right valign=top><font size=2>\n");
#$finputs=join('',$finputs,"<input type=checkbox name=\"export\" onClick=\"return reportOptions(this)\"> download in text format<br>\n");
#$finputs=join('',$finputs,"\t\t</font></td>\n");
$finputs=join('',$finputs,"\t</tr>\n");
$finputs=join('',$finputs,"</table>\&nbsp\;<br>\n");
$fjscript="
function onWdwLoad() {
var oform=document.rptform1;
//oform.mofm.selectedIndex=0;
//oform.dyfm.selectedIndex=0;
//oform.yrfm.selectedIndex=0;
//oform.moto.selectedIndex=oform.moto.options.length-1;
//oform.dyto.selectedIndex=oform.dyto.options.length-1;
//oform.yrto.selectedIndex=oform.yrto.options.length-1;
//oform.testsummary[0].checked=true;
oform.testsummary.checked=true;
oform.showcmts[0].checked=true;
}
function filterCheck(oform) {
if (oform.specfilter.checked==true || oform.filterbyques.checked==true) {
oform.action=\"$cgiroot/creportsf.pl\";
} else {
oform.action=\"$cgiroot/teststats.pl\";
}
}
function parmsC004(oform,tst) {
oform.tstid.value=tst;
oform.submit();
}
function reportOptions(oinp) {
var oform=oinp.form,idx;
if (oinp.name==\"testsummary\") {
idx=(oform.testsummary[0].checked) ? 0 : -1;
idx=(oform.testsummary[1].checked) ? 1 : idx;
idx=(oform.testsummary[2].checked) ? 2 : idx;
return testsummaryClick(oform,idx);
} else {
if (oinp.name==\"showcmts\") {
idx=(oform.showcmts[0].checked) ? 0 : -1;
idx=(oform.showcmts[1].checked) ? 1 : idx;
idx=(oform.showcmts[2].checked) ? 2 : idx;
idx=(oform.showcmts[3].checked) ? 3 : idx;
return showcmtsClick(oform,idx);
} else {
if (oinp.name==\"statsbysubj\") {
return statsbysubjClick(oform,oinp.checked);
} else {
if (oinp.name==\"showobs\") {
return showobsClick(oform,oinp.checked);
} else {
if (oinp.name==\"export\") {
return exportClick(oform,oinp.checked);
} else {
return dataextractOpts(oform);
}
}
}
}
}
}
function dataextractOpts(oform) {
if (!(oform.testsummary[2].checked)) {
oform.testsummary[2].checked=true;
oform.showcmts[0].checked=false;
oform.showcmts[1].checked=false;
oform.showcmts[2].checked=false;
oform.showcmts[3].checked=false;
oform.statsbysubj.checked=false;
oform.showobs.checked=false;
}
return true;
}
function testsummaryClick(oform,i) {
if (i==0) {
if (!((oform.showcmts[0].checked) || (oform.showcmts[1].checked)
|| (oform.showcmts[2].checked) || (oform.showcmts[3].checked) )) {
oform.showcmts[0].checked=true;
oform.statsbysubj.checked=false;
oform.showobs.checked=false;
oform.cndnme.checked=false;
oform.cndeml.checked=false;
if (\"$CLIENT{'clcnd1'}\" != \"\") {
oform.cnd1.checked=false;
}
if (\"$CLIENT{'clcnd2'}\" != \"\") {
oform.cnd2.checked=false;
}
if (\"$CLIENT{'clcnd3'}\" != \"\") {
oform.cnd3.checked=false;
}
if (\"$CLIENT{'clcnd4'}\" != \"\") {
oform.cnd4.checked=false;
}
oform.cndscr.checked=false;
}
} else {
if (i==1) {
oform.showcmts[0].checked=false;
oform.showcmts[1].checked=false;
oform.showcmts[2].checked=false;
oform.showcmts[3].checked=false;
oform.statsbysubj.checked=false;
oform.showobs.checked=false;
oform.cndnme.checked=false;
oform.cndeml.checked=false;
if (\"$CLIENT{'clcnd1'}\" != \"\") {
oform.cnd1.checked=false;
}
if (\"$CLIENT{'clcnd2'}\" != \"\") {
oform.cnd2.checked=false;
}
if (\"$CLIENT{'clcnd3'}\" != \"\") {
oform.cnd3.checked=false;
}
if (\"$CLIENT{'clcnd4'}\" != \"\") {
oform.cnd4.checked=false;
}
oform.cndscr.checked=false;
} else {
if (i==2) {
oform.showcmts[0].checked=false;
oform.showcmts[1].checked=false;
oform.showcmts[2].checked=false;
oform.showcmts[3].checked=false;
oform.statsbysubj.checked=false;
oform.showobs.checked=false;
}
}
}
return true;
}
function showcmtsClick(oform,i) {
if (!(oform.testsummary[0].checked)) {
oform.testsummary[0].checked=true;
oform.statsbysubj.checked=false;
oform.showobs.checked=false;
}
return true;
}
function statsbysubjClick(oform,chkd) {
if (chkd) {
if (!(oform.testsummary[1].checked)) {
oform.testsummary[1].checked=true;
oform.showcmts[0].checked=false;
oform.showcmts[1].checked=false;
oform.showcmts[2].checked=false;
oform.showcmts[3].checked=false;
oform.showobs.checked=false;
}
}
return true;
}
function showobsClick(oform,chkd) {
if (chkd) {
if (!(oform.testsummary[0].checked)) {
oform.testsummary[0].checked=true;
oform.showcmts[0].checked=true;
oform.statsbysubj.checked=false;
}
}
return true;
}
function exportClick(oform,chkd) {
return true;
}
window.onload=onWdwLoad;
";
print "<HTML>
<HEAD>
<TITLE>$REPORT{'rptid'} - $REPORT{'rptdesc'}</TITLE>
<SCRIPT language=\"JavaScript\">
<!--
$fjscript
function right(e) {
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) {
alert(\"This source and all graphics are proprietary and may not be viewed or copied.\");
return false;
} else {
if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
alert(\"This source and all graphics are proprietary and may not be viewed or copied.\");
return false;
}
}
return true;
}
//document.onmousedown=right;
//document.onmouseup=right;
//if (document.layers) window.captureEvents(Event.MOUSEDOWN);
//if (document.layers) window.captureEvents(Event.MOUSEUP);
//window.onmousedown=right;
//window.onmouseup=right;
// -->
</SCRIPT>
</HEAD>
<BODY BACKGROUND=\"$SYSTEM{'BACKGROUND'}\" BGCOLOR=\"$SYSTEM{'BGCOLOR'}\"
TEXT=\"$SYSTEM{'TEXT'}\" LINK=\"$SYSTEM{'LINK'}\"
VLINK=\"$SYSTEM{'VLINK'}\" ALINK=\"$SYSTEM{'ALINK'}\">
";
print "<FORM name=\"rptform1\" action=\"$faction\" METHOD=POST target=\"$ftarget\">\n$fparms\n";
print "<TABLE cellpadding=0 cellspacing=0 border=0 width=100\%>
<TR>
<TD VALIGN=\"top\">$CLIENT{'logo'}</TD>
<TD ALIGN=\"right\">
<FONT COLOR=\"$SYSTEM{'HEADERCOLOR'}\" size=2>
<B>$REPORT{'rptdesc'}\&nbsp;-\&nbsp;$REPORT{'rptid'}</B><BR>
</FONT>
</TD>
</TR>
</TABLE>
";
&print_report_C_004();
} else {
print "<CENTER>\n";
print "Report $FORM{rptno} is not yet available.\n";
print "</CENTER>\n";
}
print "</BODY>\n";
print "</HTML>\n";
&log_entry($SESSION{'clid'}, $SESSION{'uid'}, "3", "Exec Report $FORM{'rptno'} completed");
}
sub show_detail {
print "<HTML>\n";
if ($REPORT{'rptid'} eq 'ACT-001') {
&log_entry($SESSION{'clid'}, $SESSION{'uid'}, "2", "Exec Log Report $FORM{'dbfile'}");
print "<HEAD>\n<TITLE>$REPORT{'rptid'} - Log File $FORM{'dbfile'}</TITLE>\n</HEAD>\n";
print "<BODY BACKGROUND=\"$SYSTEM{'BACKGROUND'}\" BGCOLOR=\"$SYSTEM{'BGCOLOR'}\"
TEXT=\"$SYSTEM{'TEXT'}\" LINK=\"$SYSTEM{'LINK'}\"
VLINK=\"$SYSTEM{'VLINK'}\" ALINK=\"$SYSTEM{'ALINK'}\">
\n";
print "<H4>$REPORT{'rptid'} - $REPORT{'rptdesc'}</H4><BR>\n";
if ($FORM{'filter'}!='') {
print "<B>Session $FORM{'filter'}</B><BR>\n";
@lines = &get_log("sess.$FORM{'filter'}");
foreach $line (@lines) {
chomp ($line);
print "$line<BR>\n";
}
print "<HR WIDTH=\"100\%\">\n";
}
@lines = &get_log($FORM{'dbfile'});
foreach $line (@lines) {
chomp ($line);
if ($FORM{'filter'}!='') {
if ($line =~ /,$FORM{'filter'},/ ) {
print "$line<BR>\n";
}
} else {
print "$line<BR>\n";
}
}
&log_entry($SESSION{'clid'}, $SESSION{'uid'}, "2", "Exec Log Report $FORM{'dbfile'} completed");
} elsif ($REPORT{'rptid'} eq 'ACT-002') {
print "<HEAD>
<TITLE>$REPORT{'rptid'} - Test File $FORM{'dbfile'}</TITLE>
<HEAD>
<TITLE>$REPORT{'rptid'} - $REPORT{'rptdesc'}</TITLE>
<SCRIPT language=\"JavaScript\">
<!--
function right(e) {
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) {
alert(\"This source and all graphics are proprietary and may not be viewed or copied.\");
return false;
} else {
if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
alert(\"This source and all graphics are proprietary and may not be viewed or copied.\");
return false;
}
}
return true;
}
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
// -->
</SCRIPT>
</HEAD>
<BODY BACKGROUND=\"$SYSTEM{'BACKGROUND'}\" BGCOLOR=\"$SYSTEM{'BGCOLOR'}\"
TEXT=\"$SYSTEM{'TEXT'}\" LINK=\"$SYSTEM{'LINK'}\"
VLINK=\"$SYSTEM{'VLINK'}\" ALINK=\"$SYSTEM{'ALINK'}\">
\n";
$msg = "";
@locations = ( $testpending, $testinprog, $testcomplete);
$trash = join($pathsep, $locations[$FORM{'location'}], $FORM{'dbfile'});
open (TESTFILE, "<$trash") or $msg="failed";
if ($msg eq 'failed') {
print "Unable to open file.";
} else {
@lines = <TESTFILE>;
close TESTFILE;
if ($trash =~ /$testinprog/ ) {
print "<A HREF=\"\#terminate\">TERMINATE THIS TEST</A><BR>\n";
}
foreach $line (@lines) {
chomp ($line);
print "$line<BR>\n";
}
if ($trash =~ /$testinprog/ ) {
print "<FORM METHOD=POST ACTION=\"$cgiroot/testterm.pl\">\n";
print "<INPUT TYPE=HIDDEN NAME=\"tid\" VALUE=\"$SESSION{'tid'}\">\n";
print "<INPUT TYPE=HIDDEN NAME=\"dbfile\" VALUE=\"$FORM{'dbfile'}\">\n";
print "<A NAME=\"terminate\">Reason for Terminating The Test:</A><BR>\n";
print "<TEXTAREA NAME=\"reason\" ROWS=\"4\" COLS=\"40\"></TEXTAREA><BR>\n";
print "<INPUT TYPE=SUBMIT VALUE=\"Terminate Test\">\n";
print "</FORM>\n";
}
}
} else {
print "<HEAD>\n<TITLE>$REPORT{'rptid'}</TITLE>\n</HEAD>\n";
print "<BODY>\n";
print "Report Not Yet Available.<BR>\n";
}
print "</BODY>\n";
print "</HTML>\n";
}
sub print_report_C_004 {
@trecs = &get_test_list_all();
@tmptrecs = ();
for (1 .. $#trecs) {
($id, $desc) = split(/&/, $trecs[$_]);
$trecs[$_] = join('&', "$desc", "$id");
push @tmptrecs, $trecs[$_];
}
@tmptrecs = sort @tmptrecs;
my $prev = 'nonesuch';
@trecs = grep($_ ne $prev && (($prev) = $_), @tmptrecs);
for (0 .. $#trecs) {
($desc,$id) = split(/&/, $trecs[$_]);
$testscompleted = CountTestFiles($testcomplete,"all",$id);
$testsinprogress = CountTestFiles($testinprog, "all",$id);
$testspending = CountTestFiles($testpending, "all",$id);
$href="javascript:parmsC004(document.rptform1,\'$id\')\;";
$tstoption =" <TR>
<TD valign=top><FONT SIZE=2><a href=\"$href\">$id</a></FONT></TD>
<TD valign=top><FONT SIZE=2>$desc</FONT></TD>
<TD align=right valign=top><FONT SIZE=2>$testscompleted</FONT></TD>
<TD align=right valign=top><FONT SIZE=2>$testsinprogress</FONT></TD>
<TD align=right valign=top><FONT SIZE=2>$testspending</FONT></TD>
</TR>\n";
$tstoptions = join('', $tstoptions, $tstoption);
}
print "<CENTER><B>Test/Survey Summary Statistics</B><br>
$finputs
<TABLE cellpadding=1 cellspacing=1 border=0 width=\"100\%\">
<TR><TD colspan=5><HR WIDTH=\"100\%\"></TD></TR>
<TR>
<TD valign=top><B><FONT SIZE=1>Test ID</FONT></B></TD>
<TD valign=top><B><FONT SIZE=1>Description</FONT></B></TD>
<TD align=right valign=top><B><FONT SIZE=1>Cmp</FONT></B></TD>
<TD align=right valign=top><B><FONT SIZE=1>InP</FONT></B></TD>
<TD align=right valign=top><B><FONT SIZE=1>Pnd</FONT></B></TD>
</TR>
<TR><TD colspan=5><HR WIDTH=\"100\%\"></TD></TR>
$tstoptions
<TR><TD colspan=5><HR WIDTH=\"100\%\"></TD></TR>
</TABLE>
";
}