#!/usr/bin/perl ##!/usr/local/bin/perl5.8.0 # # $Id: creports.pl,v 1.24 2006/09/13 18:12:31 psims Exp $ # # Source File: creports.pl # Get config require 'sitecfg.pl'; require 'testlib.pl'; require 'tstatlib.pl'; require 'cybertestlib.pl'; use Time::Local; $FORM{'frm'}=""; &app_initialize; my $HBI_Debug = 0 ; my $HBI_Key ; if ($HBI_Debug) { foreach $HBI_Key (sort keys %FORM) { warn __FILE__ . " key $HBI_Key FORM $FORM{$HBI_Key} X" ; } } if ($FORM{'pdf'}) { print "Content-Type: application/pdf\n\n"; open(STDOUT, "| ".$cfgroot.$pathsep."html2pdf"); select(STDOUT); # needed for older versions of perl } else { print "Content-Type: text/html\n\n"; #print STDERR "Content-Type: text/html\n\n"; #open(STDOUT, "| filtertest.pl"); #select(STDOUT); } # ACT-C-001&Login Activity Report # ACT-C-005&Login Activity by User # ACT-C-002&Test Activity Report # ACT-C-003&Test Reports by Candidate # ACT-C-004&Test Statistics by Test # ACT-C-004F&Test Statistics by Test User Filter # ACT-C-006&Test Report by User # ACT-C-007&Timing Statistics by Test unless ($FORM{'tid'}) { warn "ERROR: Empty Session ID " ; &show_illegal_access_warning("user"); exit(); } if (&get_session($FORM{'tid'})) { &LanguageSupportInit(); unless ($SESSION{'clid'}) { warn "ERROR: Empty Client ID in Session data for Session ID $FORM{'tid'} " ; &show_illegal_access_warning("user"); exit(); } $REPORT{'rptid'}=""; @rptdefs = &get_data("reports.$SESSION{'clid'}"); @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 (substr($FORM{'rptno'},0,5) ne 'ACT-C') { # This is a custom report my ($ret); (my $rptapp, @rptparams) = split(/ /, $REPORT{'rptapp'}); unless ($ret=do $rptapp) { warn "couldn't parse $REPORT{'rptapp'}: $@" if $@; warn "couldn't do $REPORT{'rptapp'}: $!" unless defined $ret; warn "couldn't run $REPORT{'rptapp'}" unless $ret; } # At this point the custom report takes over writing out all the html. } elsif (($FORM{'frm'} eq '1') || ($FORM{'frm'} eq '5')) { &show_index; } else { if ($FORM{'frm'} eq '2') { &show_detail; } else { if ($FORM{'frm'} eq '') { if ($FORM{'rptno'} eq 'ACT-C-004') { $REPORT{'rptid'}=$FORM{'rptno'}; &show_index; } elsif ($FORM{'rptno'} eq 'ACT-C-003') { $REPORT{'rptid'}=$FORM{'rptno'}; # &show_index; &show_frames_003; } elsif ($FORM{'rptno'} eq 'ACT-C-006') { $REPORT{'rptid'}=$FORM{'rptno'}; &show_detail; } elsif ($FORM{'rptno'} eq 'ACT-C-007') { $REPORT{'rptid'}=$FORM{'rptno'}; &show_frames_007; } elsif ($FORM{'rptno'} eq 'ACT-C-002') { $REPORT{'rptid'}=$FORM{'rptno'}; &show_frames_002; } elsif ($FORM{'rptno'} eq 'ACT-C-001') { $REPORT{'rptid'}=$FORM{'rptno'}; &show_frames_001; } else { &show_frames; } } else { print "\n"; print "
\n"; print " \n"; print "\n"; } } } } close(STDOUT); sub show_frames { print "\n"; print "\n"; print "\n"; print "\n"; } sub show_frames_001 { print "\n"; print "\n"; print "\n"; print "\n"; } sub show_frames_002 { print "\n"; print "\n"; print "