#!/usr/local/bin/perl5_8 #Start program for Report 1 Summary use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); #remove for PRD else security hole use HTML::Template; # Clear the buffers & print the html headers to avoid problems $|=1; print "content-type: text/html\n\n"; my $CGI = CGI->new; #not sure I need this here but I've tried it with and without &get_parms; #go get the $CGI parameters my $template = HTML::Template->new( filename => 'nc1_rpt1_summary.tmpl', associate => $CGI, ); #futzed params to pass to nc_rpt1_summary.tmpl $template->param(hdr_title=>"Report 1 - Summary"); $template->param(hdr_descr=>"Fiscal YTD Financial Information"); $template->param(hdr_asofdate=>"As of June 30, 2003"); $template->param(hdr_project=>"Project/Proj Ref: 533694-033694"); $template->param(attr_dept=>"183901"); $template->param(attr_descr=>"Nonwovens Center"); $template->param(attr_award=>"Placeholder"); $template->param(attr_prog=>"110"); $template->param(attr_projpd=>"09-01-1991 to 12-31-2099"); $template->param(attr_budgpd=>"09-01-1991 to 12-31-2099"); $template->param(attr_fund=>"91000"); $template->param(attr_fyr=>"2003"); $template->param(attr_rate=>"Placeholder"); $template->param(attr_sub=>"563"); $template->param(attr_stat=>"Active"); $template->param(attr_spec=>"Placeholder"); $template->param(attr_equip=>"Placeholder"); $template->param(attr_resp=>"Various Industries"); $template->param(attr_pi=>"Placeholder"); #more futzed params to pass to nc_rpt1_summary.tmpl for main body data/dollars $template->param(rpt_data => [{ acct=>'11100', descr=>'Cash', cfte=>'- ', cbud=>'0.00', cmo=>'11,845.51', fytd=>'57,788.43', pre=>'0.00', enc=>'0.00', bba=>'(57,788.43)', ffte=>'- ', fbud=>'0.00', bgcol=>'#FFFFFF'}, { acct=>'10000-19999', descr=>'Total Assets', cfte=>'- ', cbud=>'$0.00', cmo=>'($2,367.49)', fytd=>'$430.27', pre=>'$0.00', enc=>'$0.00', bba=>'($430.27)', ffte=>'- ', fbud=>'$0.00', bgcol=>'#D3D3D3'}, { acct=>' ', descr=>' ', cfte=>' ', cbud=>' ', cmo=>' ', fytd=>' ', pre=>' ', enc=>' ', bba=>' ', ffte=>' ', fbud=>' ', bgcol=>'#99CC99'}, ] ); print $template->output(); print "
";
print "Good-bye Cruel World
\n";
sub get_parms
{
my ($CGI) = @_;
my @parameters_to_find = qw( rept_id
proj_id
rpt_asofdt
);
my %parameters;
foreach my $parm ( @parameters_to_find )
{ my $val = $CGI->param($parm);
$parameters{$parm} = $val;
}
return %parameters;
}