Advertisement
cahyadyazin

Untitled

Dec 9th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.86 KB | None | 0 0
  1. <table border="0" width="100%" cellpadding="5" cellspacing="5" class="luar">
  2.     <thead class="ju">
  3.         <td></td>
  4.         <td>&nbsp;&nbsp;&nbsp; Tanggal &nbsp;&nbsp;&nbsp;</td>
  5.         <td>&nbsp;&nbsp;&nbsp; No ACC &nbsp;&nbsp;&nbsp;</td>
  6.         <td><i>&nbsp;&nbsp;&nbsp; i &nbsp;&nbsp;&nbsp;</i></td>
  7.         <td>&nbsp;&nbsp;&nbsp; Nama Akun &nbsp;&nbsp;&nbsp;</td>
  8.         <td>&nbsp;&nbsp;&nbsp; Keterangan &nbsp;&nbsp;&nbsp;</td>
  9.         <td>&nbsp;&nbsp;&nbsp; Debit &nbsp;&nbsp;&nbsp;</td>
  10.         <td>&nbsp;&nbsp;&nbsp; Kredit &nbsp;&nbsp;&nbsp;</td>
  11.         <td colspan="2"> ...</td>
  12.     </thead>
  13. <?php
  14.     while($v_a=mysql_fetch_array($data_ini)){
  15.     $no++;
  16. ?>
  17.     <tbody align="center" id="baris">
  18.          <td><input type="checkbox" name="cekb[]" value="<?php echo $v_a['kredit']?>" checked="checked"></td>
  19.         <td><?php
  20.         $wkt = date_create($v_a['tgl']);
  21.         echo date_format($wkt, "d F Y"); ?></td>
  22.         <td><?php echo $v_a['no_acc']; ?></td>
  23.         <td><?php echo $v_a['i']; ?></td>
  24.         <td><?php echo $v_a['nama_akun']; ?></td>
  25.         <td><?php echo $v_a['ket']; ?></td>
  26.         <td><?php echo rupiah($v_a['debit']); ?></td>
  27.         <td><?php echo rupiah($v_a['kredit']); ?></td>
  28.         <td><a href="index.php?data=e_cost&id=<?php echo $v_a['id_costumer'];?>"><img src="./images/edit.png" title="Ubah Data"></a></td>
  29.         <td><a href="index.php?data=d_cost&id=<?php echo $v_a['id_costumer'];?>"><img src="./images/delete.png" title="Hapus Data"></a></td>
  30.     </tbody>
  31. <?php } ?>
  32. </table>
  33. ///// di bawah ini file php buat menghitung field yang terceklis
  34. <?php
  35.     if(isset($_POST['hitung_dc']) and isset($_POST['cekb']))
  36.     {
  37.             $jml = 0;
  38.             foreach($_POST['cekb'] as $val)
  39.                     {
  40.                             $jml = $jml + $val;
  41.                     }
  42.     }
  43.     ?>
  44.     <p>Debit <input type="text" name="debit_b" value="<?php echo $jml;?>" placeholder="Hitung dulu bos">
  45.     <input type="submit" name="hitung_dc" value="Hitung"></p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement