<!-- Full Width Column -->
  <div class="content-wrapper">
    <div class="container">
      <!-- Content Header (Page header) -->
      <section class="content-header">
        <h1>
          Keranjang Reservasi
        </h1>
        
      </section>

      <!-- Main content -->
      <section class="content">
      <?php if ($this->cart->contents()) : ?>
      <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">Detail Keranjang Reservasi</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
              <table class="table table-hover">
                <tr>
                  <th>Blok</th>
                  <th>Tanggal Masuk</th>
                  <th>Tanggal Keluar</th>
                  <th>Harga Perhari</th>
                  <th>Hari</th>
                  <th>Sub Total</th>
                  <th>#</th>
                </tr>
                 <?php
                     foreach ($this->cart->contents() as $items) :
                        echo form_open('home/update_keranjang/' . $items['rowid']);
                     ?>
                <tr>
                  <td><b><?= $items['name']; ?></b></td>
                  <td><?=date('d F Y', strtotime($items['tglin'])) ?>
                  <input type="hidden" name="tglin" value="<?=$items['tglin']?>">
                  </td>
                  <td><?=date('d F Y', strtotime($items['tglout'])) ?>
                  <input type="hidden" name="tglout" value="<?=$items['tglout']?>">
                  </td>
                  <td><p style="padding:0px; margin:0px; bottom:0px;">Rp. <?= number_format($items['price'], 0, ',', '.'); ?></p></td>
                  <td><input style="width: 50px;" name="qty" type="number" class="text-center form-control" value="<?= $items['qty'] ?>" readonly></td>
                  <td><p style="padding:0px; margin:0px; bottom:0px;" id="subtotal" subtotal="<?= $items['subtotal'] ?>">Rp. <?= number_format($items['subtotal'], 0, ',', '.'); ?></p></td>
                  <td><a href="<?= base_url('home/hapus_keranjang/') . $items['rowid'] ?>"><i class="fa fa-trash" style="color:salmon; padding-top: 20px;"></i></a></td>
                </tr>
                <?php
                        echo form_close();
                     endforeach; ?>
                
              </table>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <div class="col-md-4">
         <div class="card mt-3 shadow">
            <div class="card-body">
               <h5 class="float-left">Total Bayar</h5>
               <span class="float-right">Rp. <?= number_format($this->cart->total(), 0, ',', '.'); ?></span>
            </div>
            <div class="card-body">
               <a href="<?= base_url('transaksi') ?>" class="btn btn-block btn-danger">Pesan Sekarang</a>
            </div>
         </div>
      </div>
      </div>
      <?php else : ?>
      <div class="alert alert-danger">
         pesanan anda kosong
      </div>
   <?php endif; ?>


      </section>
      <!-- /.content -->
    </div>
    <!-- /.container -->
  </div>
  <!-- /.content-wrapper -->