Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $total=0;
- foreach ($detail->result() as $row => $r) {
- $total +=$r->subtotal;
- }
- ?>
- //input pesanan
- <?php echo form_open_multipart('admin/opesan'); ?>
- <td><select name="no_meja" class="form-control">
- <option>Pilih No.Meja</option>
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- <option value="5">5</option>
- <option value="6">6</option>
- <option value="7">7</option>
- <option value="8">8</option>
- <option value="9">9</option>
- <option value="10">10</option>
- </select></td>
- <td><input type="date" name="tgl_order" required></td>
- //permasalahannya di subtotal_val
- <td>
- <input type="hidden" name="total" class="subtotal_val" value="<?=$total ;?> readonly />
- Rp. <?=number_format($total,2);?>
- </td>
- <td><button type="submit" onClick="return confirm('apakah anda sudah selesai menginput menu?')">Selesai</button></td></tr>
- <h4></h4>
- </tbody></table><br/>
- // hasil data tabel detail pesanan
- <h3 class="text-center">Data Pesanan</h3>
- <div style="overflow-y: scroll; width: 100%"><table id="example4" class="table table-bordered table-hover table-striped" style="width: 100%">
- <thead>
- <th>ID Produk</th>
- <th>Nama Pesanan</th>
- <th>Harga Satuan</th>
- <th>Jumlah Porsi</th>
- <th>Subtotal</th>
- <th>Aksi</th>
- </thead>
- <tbody>
- <?php
- $no = 1;
- $total = 0;
- foreach ($detail->result() as $row => $r) {
- ?>
- <tr>
- <td><?php echo $r->id_menu; ?></td>
- <td><?php echo $r->nama_pesanan; ?></td>
- <td id="harga_satuan" class="harga_satuan">Rp.<?php echo $r->harga_satuan; ?></td>
- <td id="jml_porsi" class="jml_porsi" onkeyup="total()"><?php echo $r->jml_porsi; ?></td>
- <td id="subtotal" class="subtotal" onkeyup="total()">Rp.<?php echo $r->subtotal; ?></td>
- <td><a href="<?php echo site_url('admin/hapus2/').$r->id_menu?>"
- onClick="return confirm('apakah anda yakin ingin menghapus pesanan?')"><button>Hapus</button></a></td></tr>
- <?php
- $total +=$r->subtotal;
- }
- ?>
- // grand total
- <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>
- </tbody></table><br/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement