我从我的 SQL 中存储了不同的数据数组:
push( @bugid,$bug_id);
push(@assign,$assignd_to);
push(@stat,$stats);
push(@res,$resol);
push(@rat,$rate);
push(@sev,$prior);
push(@op,$o_p);
push(@shrt,$shor_desc);
$vars->{'bugid'}= \@bugid;
$vars->{'Ticket'}= $ticket_no;
$vars->{'Assigne'}= \@assign;
$vars->{'stats'}= \@stat;
$vars->{'resoltion'}= \@res;
$vars->{'rate'}= \@rat;
$vars->{'priorty'}= \@sev;
$vars->{'opsys'}= \@op;
$vars->{'shrtdesc'}= \@shrt;
我已将其传递给模板文件以显示如下目的:
$template->process('reports/gayathri_old-ticketlist.html.tmpl', $vars)
|| ThrowTemplateError($template->error());
我想在表格中显示详细信息。即,对应于每个bugid,我想显示所有其他字段。
我已经在模板文件中添加了这样的代码。我得到了表格格式。但是这些值以错误的方式输入到每一列中。
<table border='1' bgcolor='#eefff3'>
<tr><td><b>BUG ID</b></td>
<td><b>TICKET NO</b></td>
<td><b>ASSIGNED TO</b></td>
<td><b>BUG STATUS</b></td>
<td><b>RESOLUTION</b></td>
<td><b>RATING</b></td>
<td><b>PRIORITY</b></td>
<td><b>OP-SYS</b></td>
<td><b>SHORT DESCRIPTION</b></td></tr>
[% FOREACH Assigne = Assigne %]
[% FOREACH stats = stats %]
[% FOREACH resoltion = resoltion %]
[% FOREACH rate = rate %]
[% FOREACH priorty = priorty %]
[% FOREACH opsys = opsys %]
[% FOREACH shrtdesc = shrtdesc %]
[% FOREACH bugid = bugid %]
<tr>
<td>
<A HREF="show_bug.cgi?id=[% bugid %]"> [% bugid %] </A><br>
</td>
<td>
[% Ticket %]
</td>
<td>
[% Assigne %]
</td>
<td>
[% stats %]
</td>
<td>
[% resoltion %]
</td>
<td>
[% rate %]
</td>
<td>
[% priorty %]
</td>
<td>
[% opsys %]
</td>
<td>
[% shrtdesc %]
</td>
</tr>
[% END %]
[% END %]
[% END %]
[% END %]
[% END %]
[% END %]
[% END %]
[% END %]
</table>
有人可以纠正这个吗?