[eluser]redraw[/eluser]
dear all,
I want print a report
i have view :
Code:
<body>
<div class='title' align="center">Jurnal Transaksi Harian <br />Periode <?php echo $tanggal_mulai. " S/D " . $tanggal_sampai; ?></div>
<table align="center" width="27%" border='0' cellpadding='0' cellspacing='0' class="display" id="example">
<thead>
<tr>
<th align="center" width="7%">Tanggal</th>
<th align="center" width="7%">Nota</th>
<th align="center" width="7%">Code</th>
<th align="left" width="23%">Account</th>
<th align="left" width="23%">Keterangan</th>
<th align="right" width="10%">Debet</th>
<th align="right" width="10%">Kredit</th>
</tr>
</thead>
<?php
$i = 0;
$xnota = "";
$row1 = 'Y';
$v_debet = 0;
$v_kredit = 0;
?>
<?php foreach($detail->result() as $rows):?>
<?php
$v_debet = $v_debet + $rows->debet;
$v_kredit = $v_kredit + $rows->kredit;
?>
<?php
if($xnota != $rows->no_bukti and $row1 != 'Y'){
echo "<tr><td colspan='7'><hr></td>";
echo "<tr><td></td></tr>";
echo "<tr><td colspan='5' align='right'>";
echo "BALANCE";
echo "</td>";
$v_debet = number_format($v_debet);
$v_kredit = number_format($v_kredit);
echo "<td align='right'>". $v_debet ."</td>";
echo "<td align='right'>". $v_kredit ."</td></tr>";
echo "<tr><td colspan='5'></td><td colspan='2' valign='colspan'><hr></td><td></td></tr>";
$v_debet = 0;
$v_kredit = 0;
}
?>
<tr>
<td colspan="7"></td>
</tr>
<tr>
<td height="19" align="center" ><?php echo $rows->tanggal;?></td>
<td height="19" align="center" ><?php echo $rows->no_bukti;?></td>
<td height="19" align="center" ><?php echo $rows->code;?></td>
<td height="19" align="left" ><?php
$jenis = $rows->jenis;
if($jenis == 'k')
{
echo " ".$rows->account;
}
else
{
echo $rows->account;
}
?></td>
<td align="left" ><?php echo $rows->keterangan;?></td>
<td align="right"><?php
$debet = $rows->debet;
$debet= number_format($debet);
echo $debet;
?>
</td>
<td height="19" align="right"><?php
$kredit = $rows->kredit;
$kredit= number_format($kredit);
echo $kredit;
?></td>
<td align="center"><input type='hidden' id='code_<?php echo $rows->master_id;?>' value='<?php echo $rows->code;?>' />
<input type='hidden' id='tanggal_<?php echo $rows->master_id;?>' value='<?php echo $rows->tanggal;?>' />
<input type='hidden' id='keterangan_<?php echo $rows->master_id;?>' value='<?php echo $rows->keterangan;?>'/>
<input type='hidden' id='nilai_<?php echo $rows->master_id;?>' value='<?php echo $rows->nilai;?>'/></td>
</tr>
<?php
$xnota = $rows->no_bukti;
$row1 = 'N';
?>
<?php
endforeach;
if($row1 == 'N'){
echo "<tr><td colspan='7'><hr></td>";
echo "<tr><td></td></tr>";
echo "<tr><td colspan='5' align='right'>";
echo "BALANCE";
echo "</td>";
//$v_debet = $nilaitrn;
$v_debet = number_format($v_debet);
$v_kredit = number_format($v_kredit);
echo "<td align='right'>".$v_debet."</td>";
echo "<td align='right'>".$v_kredit."</td></tr>";
echo "<tr><td colspan='5'></td><td colspan='2' valign='colspan'><hr></td><td></td></tr>";
}
?>
</table>
</body>
but that display wrong summaries.
I just attached a picture the print preview, so it will be easy to understand.