Leser: 17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<TMPL_LOOP NAME="ANZAHL_SPIELE">
<table align="center" class="table_index" border="0">
<tr >
<td class="table_left">Name</td>
<td class="table_middle">1</td>
<td class="table_middle">2</td>
<td class="table_middle">3</td>
<td class="table_right">Total</td>
</tr>
<TMPL_LOOP NAME="SPIEL">
<tr>
<td ><TMPL_VAR NAME="NAME"></td>
<td ><TMPL_VAR NAME="FRAME_1_1"> <TMPL_VAR NAME="FRAME_1_2"></td>
<td ><TMPL_VAR NAME="FRAME_2_1"> <TMPL_VAR NAME="FRAME_2_2"></td>
<td><TMPL_VAR NAME="FRAME_3_1"> <TMPL_VAR NAME="FRAME_3_2"></td>
<td >Total</td>
</tr>
</TMPL_LOOP>
</table>
</TMPL_LOOP>
1 2 3 4 5 6 7 8 9 10 11 12 13 14
my $data = { ANZAHL_SPIELE => [ { SPIEL => [ { NAME => 'foo', ... }, ... ], }, ], ... };
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
my @tables;
for (my $i=1; $i<=$spiel_NR->[0][0]; $i++) {
$stm=qq!SELECT person.anzeige_name, frame_1_1, frame_1_2, frame_2_1, frame_2_2, frame_3_1, frame_3_2, frame_4_2, frame_5_1, frame_5_2, frame_6_1, frame_6_2, frame_7_1, frame_7_2, frame_8_1, frame_8_2, frame_9_1, frame_9_2, frame_10_1, frame_10_2, frame_10_3 FROM spiel, person WHERE person.pers_id=spiel.pers_id
AND datum ="$spiel_NR->[0][1]" AND spiel_nr ="$i"!;
print qq!<br>$stm<br><br>!;
my $spiel = $dbh->selectall_arrayref($stm);
my %row;
foreach my $games (@{$spiel}){
my %hash;
$hash{'NAME'} = $games->[0];
$hash{'FRAME_1_1'} = $games->[1];
$hash{'FRAME_1_2'} = $games->[2];
$hash{'FRAME_2_1'} = $games->[3];
$hash{'FRAME_2_2'} = $games->[4];
$hash{'FRAME_3_1'} = $games->[5];
$hash{'FRAME_3_2'} = $games->[6];
$row{'SPIEL'} = %hash;
}
push (@tables, \%row);
}
$template->param('ANZAHL_SPIELE'=>\@tables);