Kod
{$today}
{include file="header_ivt.tpl"}
<table align="center" width="70%">
<tr>
<td colspan="16" class="tab_uberschrift_1" align="center">Info About current rents</td>
</tr>
<tr>
<th colspan="2" class="tab_uberschrift_1">Num</th>
<th colspan="2" class="tab_uberschrift_1">Category</th>
<th colspan="2" class="tab_uberschrift_1">Name</th>
<th colspan="2" class="tab_uberschrift_1">RentDate</th>
<th colspan="2" class="tab_uberschrift_1">Owner</th>
<th colspan="2" class="tab_uberschrift_1">RentPerson</th>
<th colspan="2" class="tab_uberschrift_1">RentForPerson</th>
<th colspan="2" class="tab_uberschrift_1">GetBackDate</th>
</tr>
{foreach name=rent item=rent from=$rent}
{if $today gt $rent.getbackdate}
<tr> <td class="tab_uberschrift_2" colspan="2" align="center">{$smarty.foreach.rent.iteration}</td>
{foreach name=ren1 from=$rent item=rent}
<td class="tab_uberschrift_2" colspan="2" align="center">{$rent}</td>
{/foreach}
<td class="tab_uberschrift_2" align="center"><a href="cal.html"><img src="gfx/datechooser.png" alt="EDIT DATE" ></a></td>
</tr>
{else}
<tr> <td class="tab_uberschrift_3" colspan="2" align="center">{$smarty.foreach.rent.iteration}</td>
{foreach name=ren2 from=$rent item=rent}
<td class="tab_uberschrift_3" colspan="2" align="center">{$rent}</td>
{/foreach}
<td class="tab_uberschrift_3" align="center"><a href="cal.html"><img src="gfx/datechooser.png" alt="EDIT DATE" ></a></td>
</tr>
{/if}
{/foreach}
</table>
{include file="header_ivt.tpl"}
<table align="center" width="70%">
<tr>
<td colspan="16" class="tab_uberschrift_1" align="center">Info About current rents</td>
</tr>
<tr>
<th colspan="2" class="tab_uberschrift_1">Num</th>
<th colspan="2" class="tab_uberschrift_1">Category</th>
<th colspan="2" class="tab_uberschrift_1">Name</th>
<th colspan="2" class="tab_uberschrift_1">RentDate</th>
<th colspan="2" class="tab_uberschrift_1">Owner</th>
<th colspan="2" class="tab_uberschrift_1">RentPerson</th>
<th colspan="2" class="tab_uberschrift_1">RentForPerson</th>
<th colspan="2" class="tab_uberschrift_1">GetBackDate</th>
</tr>
{foreach name=rent item=rent from=$rent}
{if $today gt $rent.getbackdate}
<tr> <td class="tab_uberschrift_2" colspan="2" align="center">{$smarty.foreach.rent.iteration}</td>
{foreach name=ren1 from=$rent item=rent}
<td class="tab_uberschrift_2" colspan="2" align="center">{$rent}</td>
{/foreach}
<td class="tab_uberschrift_2" align="center"><a href="cal.html"><img src="gfx/datechooser.png" alt="EDIT DATE" ></a></td>
</tr>
{else}
<tr> <td class="tab_uberschrift_3" colspan="2" align="center">{$smarty.foreach.rent.iteration}</td>
{foreach name=ren2 from=$rent item=rent}
<td class="tab_uberschrift_3" colspan="2" align="center">{$rent}</td>
{/foreach}
<td class="tab_uberschrift_3" align="center"><a href="cal.html"><img src="gfx/datechooser.png" alt="EDIT DATE" ></a></td>
</tr>
{/if}
{/foreach}
</table>
Problem polega na tym ze jak chce wyswietic tabele w zaleznosci od warunku if (wiersz tabeli ma miec kolor1 lub kolor2 z css'a). Zmienna $rent jest tablica. Mam wrazenie jakby brany byl tylko pierwszy element
tablicy choc jest w petli. Gdy zmienie warunek z gt- (>) na lt- (<) to wtedy wszystkie wiersze zaznaczone sa na kolor 2. Podejrzewam ze mam blad w petli, albo w warunku.
Prosze o pomoc