Advertisement
gundambison

perbaikan 79-kuitansi akhir

Aug 26th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $total=0;
  3. foreach ($detail->result() as $row => $r) {
  4. $total +=$r->subtotal;
  5. }
  6. ?>
  7. //input pesanan
  8. <?php echo form_open_multipart('admin/opesan'); ?>
  9. <td><select name="no_meja" class="form-control">
  10.   <option>Pilih No.Meja</option>
  11.   <option value="1">1</option>
  12.   <option value="2">2</option>
  13.   <option value="3">3</option>
  14.   <option value="4">4</option>
  15.   <option value="5">5</option>
  16.   <option value="6">6</option>
  17.   <option value="7">7</option>
  18.   <option value="8">8</option>
  19.   <option value="9">9</option>
  20.   <option value="10">10</option>
  21. </select></td>
  22.  
  23. <td><input type="date" name="tgl_order" required></td>
  24. //permasalahannya di subtotal_val
  25. <td>
  26. <input type="hidden" name="total" class="subtotal_val" value="<?=$total ;?> readonly />
  27. Rp. <?=number_format($total,2);?>
  28. </td>
  29. <td><button type="submit" onClick="return confirm('apakah anda sudah selesai menginput menu?')">Selesai</button></td></tr>
  30. <h4></h4>
  31. </tbody></table><br/>
  32. // hasil data tabel detail pesanan
  33. <h3 class="text-center">Data Pesanan</h3>
  34. <div style="overflow-y: scroll; width: 100%"><table id="example4" class="table table-bordered table-hover table-striped" style="width: 100%">
  35.   <thead>
  36.    
  37.     <th>ID Produk</th>
  38.     <th>Nama Pesanan</th>
  39.     <th>Harga Satuan</th>
  40.     <th>Jumlah Porsi</th>
  41.     <th>Subtotal</th>
  42.     <th>Aksi</th>
  43.   </thead>
  44.   <tbody>
  45.      <?php
  46.      $no = 1;
  47.      $total = 0;
  48.      foreach ($detail->result() as $row => $r) {
  49.      
  50.      ?>
  51.     <tr>
  52.      
  53.       <td><?php echo $r->id_menu; ?></td>
  54.       <td><?php echo $r->nama_pesanan; ?></td>
  55.       <td id="harga_satuan" class="harga_satuan">Rp.<?php echo $r->harga_satuan; ?></td>
  56.       <td id="jml_porsi" class="jml_porsi" onkeyup="total()"><?php echo $r->jml_porsi; ?></td>
  57.       <td id="subtotal" class="subtotal" onkeyup="total()">Rp.<?php echo $r->subtotal; ?></td>
  58.       <td><a href="<?php echo site_url('admin/hapus2/').$r->id_menu?>"
  59.             onClick="return confirm('apakah anda yakin ingin menghapus pesanan?')"><button>Hapus</button></a></td></tr>
  60.        <?php
  61.         $total +=$r->subtotal;
  62.      }
  63.      
  64.         ?>
  65. // grand total
  66.        <tr style="font-weight: bold;"><td colspan="3"></td><td>Total :</td><td id="total1" name="total1" class="total1">Rp.<?php echo $total; ?></td></tr>
  67.        
  68.        
  69.   </tbody></table><br/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement