Advertisement
RieqyNS13

Untitled

Jan 2nd, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 KB | None | 0 0
  1. <?php
  2.             include("config.php");
  3.             $q = listtes();
  4.             $total = 0;
  5.             foreach ($q as $r)
  6.             {
  7.                 $id = $r[1];
  8.                 $daftar = listdalam($id);  
  9.                 $index=1;
  10.                 foreach($daftar as $res){
  11.                     $res0="";
  12.                     $res1="";
  13.                     if($index==1){
  14.                         $res0=$res[0];
  15.                         $res1=$res[1];
  16.                     }
  17.                 echo "<tr>
  18.                        <td> $res0</td>
  19.                        <td> $res1</td>
  20.                        <td> $res[2]</td>
  21.                        <td> $res[3]</td>
  22.                        <td> $res[4]</td>
  23.                        </td>
  24.                     </tr>
  25.                     <tr>";
  26.                      $harga = $res[4];
  27.                      $total = $total + $harga;
  28.                     $index=$index+1;
  29.                 }
  30.                 echo "<td colspan=3>total</td>
  31.                        <td>$total</td>
  32.                     </tr>";
  33.             }
  34.             ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement