And here is another way that works:
@selected = MODULES::Appointment::get_selections($root_htdocs, $app_dir,
$cmd, $dbh, $table_app);
$i1 = @selected; # These two lines used below, too
$i2 = ($i1/8); #Gives number of rows retrieved in main query
$i3 = 0;
$i4 = 0;
while ($i3 < $i2) {
my %row_data;
$row_data{'COL1'} = $selected[$i4 + 0];
$row_data{'COL2'} = $selected[$i4 + 1];
$row_data{'COL3'} = $selected[$i4 + 2];
$row_data{'COL4'} = $selected[$i4 + 3];
$row_data{'COL5'} = $selected[$i4 + 4];
#custom values#
$app_status = $selected[$i4 + 5];
if ($app_status == 0) {$print_status = "New Appt"}
if ($app_status == 1) {$print_status = "No Show"}
if ($app_status == 2) {$print_status = "Showed"}
if ($app_status == 3) {$print_status = "Purchased"}
if ($app_status == 4) {$print_status = "No Interest"}
if ($app_status == 5) {$print_status = "Maybe"}
if ($app_status == 6) {$print_status = "Later"}
if ($app_status == 7) {$print_status = "Other"}
$row_data{'COL6'} = $print_status;
$row_data{'COL7'} = $selected[$i4 + 6];
$row_data{'COL8'} = $selected[$i4 + 7];
push(@loop_data1, \%row_data);
$i3++;
$i4 = ($i4 +8);
}
$template->param(THIS_LOOP1 => \@loop_data1); # Assign the loop data to
the loop param
print $template->output; # print the template
Dave
At 04:14 PM 2/14/02 -0500, Aaron J Mackey wrote:
>I'd do it something like this:
>
>$template->param(LOOPSIZE => scalar @data);
>$template->param(MYLOOP => \@data);
>
># here's the template:
>
><TMPL_LOOP NAME=MYLOOP>
><tr>
><TMPL_IF __FIRST__>
><td rowspan="<TMPL_VAR NAME=LOOPSIZE>">Like this?</td>
></TMPL_IF>
><td><TMPL_VAR NAME=LOOPVAR></td>
></tr>
></TMPL_LOOP>
>
>-Aaron
>
>On Thu, 14 Feb 2002, Barriga, Celso wrote:
>
> > Hello,
> >
> > I'm new to the list and HTML::Template so I don't know if my question is a
> > FAQ for this list, but anyway, here it goes...
> >
> > Is there a loop context variable or some other way to determine the total
> > count for my loop? I see the other vars, i.e., __FIRST__, __LAST__,
> __ODD__,
> > etc., after enabling loop_context_vars, but not the total loop count.
> >
> > Basically what I'm trying to do is create a 2-column table, where one
> column
> > would contain every loop element per row, but the other column will just be
> > one row that I'd create on __FIRST__ element but with a ROWSPAN of
> > loop_count, so it will cover however number of elements I have. Here's a
> > textual representation of what I would like to achieve.
> >
> > _______________________
> > | |___________|
> > | |___________|
> > | |___________|
> > |___________|___________|
> >
> > Thanks a lot in advance.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
Dave Van Abel
Lakewood, CO USA
http://www.vanabel.com
http://perlsources.com
303-989-6481 (home-office)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]