Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $total_berjalan_debet=0;
- $total_berjalan_credit=0;
- mysql_select_db($database_prathama, $prathama);
- $query_glku = "SELECT IFNULL(posting,'TOTAL')as posting ,descs, sum(debet) as debet, sum(credit) as credit, aperiod, fyear FROM gl where fyear=2015 GROUP BY aperiod, posting WITH ROLLUP";
- $glku = mysql_query($query_glku, $prathama) or die(mysql_error());
- $row_glku = mysql_fetch_assoc($glku);
- $totalRows_glku = mysql_num_rows($glku);
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Untitled Document</title>
- </head>
- <body>
- <table width="800" border="1">
- <tr>
- <td>posting</td>
- <td>descs</td>
- <td>aperiod</td>
- <td>year</td>
- <td>debet</td>
- <td>credit</td>
- </tr>
- <?php
- while($row_glku = mysql_fetch_assoc($glku)){
- if($row_glku['posting']=='TOTAL') {
- $total_berjalan_debet=$total_berjalan_debet+$row_glku['debet'];
- $total_berjalan_credit=$total_berjalan_credit+$row_glku['credit'];
- }
- echo "<tr>
- <td>".$row_glku['posting']."</td>
- <td>".($row_glku['posting']=='TOTAL'?'':$row_glku['descs'])."</td>
- <td>".$row_glku['aperiod']."</td>
- <td>".$row_glku['fyear']."</td>
- <td>".$row_glku['debet']."
- ".$total_berjalan_debet."</td>
- <td>".$row_glku['credit']."
- ".$total_berjalan_credit."</td>
- </tr>";
- }
- ?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement