endrasgusti

puyeng5

Oct 18th, 2017
56
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mysql_select_db($database_prathama, $prathama);
  2. $query_glku = "SELECT IFNULL(posting,'SUBTOTAL')as posting ,descs, sum(debet) as debet, sum(credit) as credit, IFNULL(aperiod,'TOTAL')as aperiod, fyear FROM gl where fyear=2015 GROUP BY aperiod, posting WITH ROLLUP";
  3. $glku = mysql_query($query_glku, $prathama) or die(mysql_error());
  4. $row_glku = mysql_fetch_assoc($glku);
  5. $totalRows_glku = mysql_num_rows($glku);
  6. ?>
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  11. <title>Untitled Document</title>
  12. </head>
  13.  
  14. <body>
  15. <table width="800" border="1">
  16.   <tr>
  17.     <td>posting</td>
  18.     <td>descs</td>
  19.     <td>aperiod</td>
  20.     <td>year</td>
  21.     <td>debet</td>
  22.     <td>credit</td>
  23.   </tr>
  24.   <?php
  25.   while($row_glku = mysql_fetch_assoc($glku)){
  26.          
  27. echo "<tr>
  28.      <td>".$row_glku['posting']."</td>
  29.      <td>".($row_glku['posting']=='SUBTOTAL'?'':$row_glku['descs'])."</td>
  30.       <td>".$row_glku['aperiod']."</td>
  31.       <td>".$row_glku['fyear']."</td>
  32.      <td>".$row_glku['debet']."</td>
  33.      <td>".$row_glku['credit']."</td>
  34.    </tr>";
  35.     if(($row_glku['posting']=='SUBTOTAL')&&($row_glku['aperiod']=='TOTAL')) {
  36.       $total_berjalan_debet=$total_berjalan_debet+$row_glku['debet'];
  37.       $total_berjalan_credit=$total_berjalan_credit+$row_glku['credit'];
  38.  
  39. echo"<tr>
  40.    <td>&nbsp;</td>
  41.    <td>SALDO UP TO THIS MONTH</td>
  42.    <td>&nbsp;</td>
  43.    <td>&nbsp;</td>
  44.    <td>".$total_berjalan_debet."</td>
  45.    <td>".$total_berjalan_credit."</td>
  46.  </tr>";
  47.     }
  48.   }
  49.      ?>
  50.  
  51. </table>
RAW Paste Data