Hello all.

I've been trying to get this working for a while now without success. All
I need to do is make two loops, one nested within the other. The code I
have so far I know won't work the way it is, and I've tried several
different ways. If someone has done this before, what I'm trying to
display is a calendar with dynamic information. For now I have static
information in it (for testing purposes only). I've attached the two
documents that I'm working with (the .pl and the .tmpl) if someone could
take a look at it and tell me what i'm missing it would be much
appreciated.

Thank you,
Lew A
GWI Operations
#!/usr/bin/perl5 -wT

use strict;
use HTML::Template;

use constant TMPL_FILE => "templates/test.tmpl";

my $tmpl = new HTML::Template( filename => TMPL_FILE, no_includes => 1, global_vars => 
1);

my $week = 3;
my @days = ({day => 1}, {day => 2}, {day => 3}, {day => 4}, {day => 5}, {day => 6}, 
{day => 7});

$tmpl->param( cal_week => [{ cal_day => \@days }]);

print "Content-type: text/html\n\n";
print $tmpl->output;
<html>
<head>
<title>Calender</title>
</head>

<body bgcolor="white">

<center>

<table width='646' height='550' border='1' cellspacing='0' cellpadding='0'>
<tr>
<td width='90' height='10' align='center' valign='center'>
Sunday
</td>
<td width='90' height='10' align='center' valign='center'>
Monday
</td>
<td width='90' height='10' align='center' valign='center'>
Tuesday
</td>
<td width='90' height='10' align='center' valign='center'>
Wednesday
</td>
<td width='90' height='10' align='center' valign='center'>
Thursday
</td>
<td width='90' height='10' align='center' valign='center'>
Friday
</td>
<td width='90' height='10' align='center' valign='center'>
Saturday
</td>
</tr>

<TMPL_LOOP NAME="cal_week">
<tr>
<TMPL_VAR NAME="week">

        <TMPL_LOOP NAME="cal_day">
        <td width='90' height='90' align='right' valign='top'>
        <TMPL_VAR NAME="day">
        </td>
        </TMPL_LOOP>

</tr>
</TMPL_LOOP>

</table>
</center>

</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to