My goal is to present the user with a main menu. That main menu has a few objects that help limit the query to the database, plus helps determine which report is run. Once the initial summary report is run (whether Report 1 Summary, Report 2 Summary, etc.), the user should be able to click on any data cell in the Summary report and drilldown to further details. (And then from the interim drilldown, they want to drilldown to journal line detail).
My question at the moment is: How can I get it to recognize that I've selected Report 1 (rept_id=1), so it knows to launch nc1_rpt1_summary.pl (eventually, I'd like the thing to replace the rept_id digit in the .pl automagically so it launches the right report, but that's another hair-pulling day down the road).
Here's what I have:
Initial program being launched from URL
#!/usr/local/bin/perl5_8 #Start program for Campus Financial Reports use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); #remove for PRD else security hole use HTML::Template; my $CGI = CGI->new; # Clear the buffers & print the html headers to avoid problems $|=1; print "content-type: text/html\n\n"; my $template = HTML::Template->new( filename => 'nc1_mainmenu.tmpl', associate => $CGI, ); print $template->output(); print "<p>"; print "Good-bye Cruel World<br>\n";
<TMPL_INCLUDE NAME='nc1_start.tmpl'> <TMPL_INCLUDE NAME='nc1_style.tmpl'> <TMPL_INCLUDE NAME='nc1_titlebarmain.tmpl'> <body> <form name=frm_mainmenu> <table border=0 width="100%" summary="Welcome Paragraph"> <tr><td class=welc><br>Welcome!<br><br></td></tr> </table> <table border="0" width="100%" summary="Input Form"> <tr> <td class=welc width="10%" rowspan="7" valign="top">Step 1:</td> <td class=welc width="20%" rowspan="7" valign="top">Select a Report</t +d> <td class=welc width="70%" id="rpt1form"> <input type="RADIO" name="rept_id" value="1" onclick="highlight();" C +HECKED> <span style="cursor:pointer;cursor:hand" onmouseover="style.color='#BF0000';window.status='Report Descr +iptions';" onmouseout="style.color='black';window.status='';" onclick='window.open("../../campus/nc_pf_rpt_descrs.html#Rpt1D +escr", "myWindow", "width=650,height=600,top=10,left=10,scrol +lbars=yes");'> Report 1 - Fiscal Year-to-Date Financial Informati +on </span></td> <tr> <td class=welc id="rpt2form"> <input type="RADIO" name="rept_id" value="2" onclick='highlight();'> <span style="cursor:pointer;cursor:hand" onmouseover="style.color='#BF0000';" onmouseout="style.color='black';" onclick='window.open("../../campus/nc_pf_rpt_descrs.html#Rpt2D +escr", "myWindow", "width=650,height=600,top=10,left=10,scrol +lbars=yes");'> Report 2 - Quarter/Project-to-Date Financial Statu +s </span></td> <!-- a bunch of code here for remaining reports removed for this examp +le --> <tr> <td class=welc width="10%">Step 2:</td> <td class=welc width="20%">Select a Period</td> <td class=welc width="70%"><select name="rpt_asofdt"> <option value="Project To Date">Project To Date <option value="Month Ending OCT 2003">Month Ending OCT 2003 <option value="Month Ending SEP 2003">Month Ending SEP 2003 <option value="Month Ending AUG 2003">Month Ending AUG 2003 <option value="Month Ending JUL 2003">Month Ending JUL 2003 <option value="Month Ending JUN 2003">Month Ending JUN 2003 <option value="Month Ending MAY 2003">Month Ending MAY 2003 <option value="Month Ending APR 2003">Month Ending APR 2003 <option value="Month Ending MAR 2003">Month Ending MAR 2003 <option value="Month Ending FEB 2003">Month Ending FEB 2003 <option value="Month Ending JAN 2003">Month Ending JAN 2003 <option value="Month Ending DEC 2002">Month Ending DEC 2002 <option value="Month Ending NOV 2002">Month Ending NOV 2002 <option value="Month Ending OCT 2002">Month Ending OCT 2002 </SELECT></td> </tr> <tr><td class=welc> </td></tr> <tr> <td class=welc width="10%">Step 3:</td> <td class=welc width="20%">Enter a Project ID</td> <td class=welc width="70%" colspan="2"><input name="proj_id" size="14" +></td> </tr> <tr><td class=welc> </td></tr> <tr> <td class=welc width="10%">Step 4:</td> <td class=welc width="20%">Submit the Report</td> <td class=welc width="70%" colspan="2"><input type="SUBMIT" name="submit_rpt" value="SUBMIT" style="cursor:pointer;c +ursor:hand;" onclick='window.locatio +n="nc1_rpt1_summary.pl"'></td> </tr> <tr><td class=welc> </td></tr> </table> </form> <TMPL_INCLUDE "nc1_end.tmpl">
#!/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 wit +h 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 "<p>"; print "Good-bye Cruel World<br>\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; }
<TMPL_INCLUDE "nc1_start.tmpl"> <TMPL_INCLUDE "nc1_style.tmpl"> <TMPL_INCLUDE "nc1_titlebarrpt.tmpl"> <TMPL_INCLUDE "nc1_header.tmpl"> <form name=frm_summ_rept method=POST action="http://www.ncsu.edu"> <table border=1 cellspacing=0 cellpadding=1 width="100%" summary="Colu +mn Headings and Data Cells"> <tr valign="bottom"> <th width="9%">Account Summary</th> <th width="18%">Description</th> <th width="4%">Current FTE</th> <th width="9%">Current Budget</th> <th width="9%">Current Month Activity</th> <th width="9%">FYTD Activity</th> <th width="9%">Pre-Encumbrances</th> <th width="9%">Encumbrances</th> <th width="11%">Budget Balance Available</th> <th width="4%">Future FTE</th> <th width="9%">Future Budget</th> </tr> <TMPL_LOOP NAME=rpt_data> <tr bgcolor=<TMPL_VAR NAME=bgcol>> <td class=rowhdr><TMPL_VAR NAME=acct></td> <td class=rowhdr style="cursor:pointer;cursor:hand;" title="Account 11100" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='<TMPL_VAR NAME=b +gcol>';" onclick="frm_summ_rept.drill_detail.value='REF +'; frm_summ_rept.submit();"><font color= +"#000000"><TMPL_VAR NAME=descr></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Current FTE Period Drilldo +wn" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='<TMPL_VAR NAME=b +gcol>';" onclick="frm_summ_rept.drill_detail.value='REF +'; frm_summ_rept.submit();"><font color= +"#000000"><TMPL_VAR NAME=cfte></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Current Budget Period Dril +ldown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='<TMPL_VAR NAME=b +gcol>';" onclick="frm_summ_rept.drill_detail.value='REF +'; frm_summ_rept.submit();"><font color= +"#000000"><TMPL_VAR NAME=cbud></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Current Month Activity Per +iod Drilldown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='<TMPL_VAR NAME=b +gcol>';" onclick="frm_summ_rept.drill_detail.value='REF +'; frm_summ_rept.submit();"><font color= +"#000000"><TMPL_VAR NAME=cmo></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see FYTD Activity Period Drill +down" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='<TMPL_VAR NAME=b +gcol>';" onclick="frm_summ_rept.drill_detail.value='REF +'; frm_summ_rept.submit();"><font color= +"#000000"><TMPL_VAR NAME=fytd></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Pre-Encumbrances Period Dr +illdown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='<TMPL_VAR NAME=b +gcol>';" onclick="frm_summ_rept.drill_detail.value='REF +'; frm_summ_rept.submit();"><font color= +"#000000"><TMPL_VAR NAME=pre></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Encumbrances Period Drilld +own" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='<TMPL_VAR NAME=b +gcol>';" onclick="frm_summ_rept.drill_detail.value='REF +'; frm_summ_rept.submit();"><font color= +"#000000"><TMPL_VAR NAME=enc></td> <td class=rowdat><font color="#000000"><TMPL_VAR NAME=bba></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Future FTE Period Drilldow +n" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='<TMPL_VAR NAME=b +gcol>';" onclick="frm_summ_rept.drill_detail.value='REF +'; frm_summ_rept.submit();"><font color= +"#000000"><TMPL_VAR NAME=ffte></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Future Budget Period Drill +down" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='<TMPL_VAR NAME=b +gcol>';" onclick="frm_summ_rept.drill_detail.value='REF +'; frm_summ_rept.submit();"><font color= +"#000000"><TMPL_VAR NAME=fbud></td> </tr> </TMPL_LOOP> <tr bgcolor="#CCCCFF"> <td>should look like:</td> </tr> <tr bgcolor="#FFFFFF"> <td class=rowhdr> 11100</td> <td class=rowhdr style="cursor:pointer;cursor:hand;" title="Account 11100" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='#FFFFFF';" onclick="frm_summ_rept.drill_detail.value='REF'; frm_summ_rept.submit();"> Cash</td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Cash Period Drilldown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='#FFFFFF';" onclick="frm_summ_rept.drill_detail.value='REF'; frm_summ_rept.submit();"><font color="#00 +0000">- </font></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Cash Period Drilldown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='#FFFFFF';" onclick="frm_summ_rept.drill_detail.value='REF'; frm_summ_rept.submit();"><font color="#00 +0000">0.00</font></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Cash Period Drilldown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='#FFFFFF';" onclick="frm_summ_rept.drill_detail.value='REF'; frm_summ_rept.submit();"><font color="#00 +0000">11,845.51</font></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Cash Period Drilldown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='#FFFFFF';" onclick="frm_summ_rept.drill_detail.value='REF'; frm_summ_rept.submit();"><font color="#00 +0000">57,788.43</font></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Cash Period Drilldown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='#FFFFFF';" onclick="frm_summ_rept.drill_detail.value='REF'; frm_summ_rept.submit();"><font color="#00 +0000">0.00</font></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Cash Period Drilldown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='#FFFFFF';" onclick="frm_summ_rept.drill_detail.value='REF'; frm_summ_rept.submit();"><font color="#00 +0000">0.00</font></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Cash Period Drilldown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='#FFFFFF';" onclick="frm_summ_rept.drill_detail.value='REF'; frm_summ_rept.submit();"><font color="#BF +0000">(57,788.43)</font></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Cash Period Drilldown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='#FFFFFF';" onclick="frm_summ_rept.drill_detail.value='REF'; frm_summ_rept.submit();"><font color="#00 +0000">- </font></td> <td class=rowdat style="cursor:pointer;cursor:hand;" title="Click to see Cash Period Drilldown" onmouseover="style.background='#CCCCFF';" onmouseout="style.background='#FFFFFF';" onclick="frm_summ_rept.drill_detail.value='REF'; frm_summ_rept.submit();"><font color="#00 +0000">0.00</font></td> </tr> </table> <TMPL_INCLUDE "nc1_footer.tmpl"> <TMPL_INCLUDE "nc1_end.tmpl">
Lori
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |