1
I have a table that brings paid and unpaid commission results.
I want him to bring only the pay, I mean, if number_format($row->amount_paid,2) = 0
not bring that line.
<?php
$i=-1;
foreach($this->rows->rows as $row){?>
<tr class="sectiontableentry<?php echo ($i%2)+1;?>">
<td><?php echo $row->name; ?></td>
<td align="right"><?php echo empty($row->timestamp) ? '' : date('Y-m-d',$row->timestamp); ?></td>
<td align="right"><?php echo $row->order_number; ?></td>
<td align="right"><?php echo number_format($row->order_total,2); ?></td>
<td align="right"><?php echo number_format($row->commission,2); ?></td>
<td align="right"><?php echo number_format($row->amount_paid,2);?></td>
<td align="right"><?php echo number_format($row->balance,2); ?></td>
<td><?php echo $row->note; ?> </td>
</tr>
<?php }?>
I believe I have to use if somewhere, right? But I don’t know how.
if(number_format($row->amount_paid,2) != 0){ //...código}
doesn’t work?– rray
then, my question is where to put the if put here: foreach($this->Rows->Rows as $Row){if(number_format($Row->amount_paid,2) != 0){ //...code}} but did not give
– Leandro Teraoka
After the
foreach
and before the<tr>
and closes after the</tr>
– rray
Sorry, gave yes, I had put a "}" less, thank you!
– Leandro Teraoka