<!-- Full Width Column -->
<div class="content-wrapper">
   <div class="container">
      <!-- Content Header (Page header) -->
      <section class="content-header">
         <h1>
            Cekout
         </h1>
      </section>
      <!-- Main content -->
      <section class="content">
         <div class="box box-default">
          <div class="box-header with-border">
            <h3 class="box-title">Detail Pemesan</h3>
          </div>
          <div class="box-body">
            <table class="table table-hover">
               <thead>
                  <tr>
                     <td scope="row" style="width:15%">Nama</td>
                     <td style="width:5%">:</td>
                     <td id="td_nama_penerima" pesanan="<?= $user['nama']; ?>"><?= $user['nama']; ?></td>
                  </tr>
                  <tr>
                     <td scope="row" style="width:15%">Telepon</td>
                     <td style="width:5%">:</td>
                     <td><?= $user['telepon']; ?></td>
                  </tr>
                  <tr>
                     <td scope="row" style="width:15%">Alamat Lengkap</td>
                     <td style="width:5%">:</td>
                     <td><?= $user['alamat']; ?></td>
                  </tr>
                  <tr>
                     <td scope="row" style="width:15%">Tanggal Reservasi </td>
                     <td style="width:5%">:</td>
                     <td><?= date('d F Y', strtotime($pesanan_detail['tgl_in'])); ?> Sampai <?= date('d F Y', strtotime($pesanan_detail['tgl_out'])); ?> </td>
                  </tr>
                  <tr>
                     <td scope="row" style="width:15%">Status</td>
                     <td style="width:5%">:</td>
                     <td><?= $pesanan_detail['status']; ?></td>
                  </tr>
               </thead>
            </table>
            <hr>
            <table class="table table-hover">
               <tr>
                  <th>Nama Blok</th>
                  <th>Jumlah Hari</th>
                  <th class="text-right">Harga</th>
                  <th class="text-right">Total</th>
               </tr>
               <?php 
               $grand=0;
               foreach ($barang_detail as $barang) : ?>
               <?php 
               $subtotal = $barang['qty'] * $barang['harga']; 
               $grand+=$barang['qty'] * $barang['harga'];
               ?>
               <tr>
                  <td><?= $barang['blok']; ?></td>
                  <td><?= $barang['qty']; ?></td>
                  <td class="text-right">Rp. <?= number_format($barang['harga']); ?></td>
                  <td class="text-right" >Rp. <?= number_format($subtotal); ?></td>
               </tr>
               <?php endforeach; ?>
               <tr>
                  <td></td>
                  <td></td>
                  <td class="text-right">Total Pembayaran</td>
                  <td class="text-right" id="subtotal">Rp. <?= number_format($grand); ?></td>
               </tr>
            </table>
            <button class="btn btn-block btn-danger" id="pay-button">Pilih Metode Pembayaran</button>
         </div>
         </div>
      </section>
      <!-- /.content -->
   </div>
   <!-- /.container -->
   <form id="payment-form" method="post" action="<?= site_url() ?>snap/finish">
   <input type="hidden" name="result_type" id="result-type" value="">
   </div>
   <input type="hidden" name="result_data" id="result-data" value="">
   </div>
   </form>
</div>
<!-- /.content-wrapper -->
