<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title><?= $title ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <!-- Light layout Bootstrap Css -->
    <link
      href="<?= base_url(); ?>assets/admin/css/bootstrap-dark.min.css"
      id="bootstrap-dark-style"
      disabled="disabled"
      rel="stylesheet"
      type="text/css"
    />
    <link
      href="<?= base_url(); ?>assets/admin/css/bootstrap.min.css"
      id="bootstrap-style"
      rel="stylesheet"
      type="text/css"
    />
    <!-- Icons Css -->
    <link
      href="<?= base_url(); ?>assets/admin/css/icons.min.css"
      rel="stylesheet"
      type="text/css"
    />
    <!-- App Css-->
    <link
      href="<?= base_url(); ?>assets/admin/css/app-dark.min.css"
      id="app-dark-style"
      disabled="disabled"
      rel="stylesheet"
      type="text/css"
    />
    <link
      href="<?= base_url(); ?>assets/admin/css/app-rtl.min.css"
      id="app-rtl-style"
      disabled="disabled"
      rel="stylesheet"
      type="text/css"
    />
    <link
      href="<?= base_url(); ?>assets/admin/css/app.min.css"
      id="app-style"
      rel="stylesheet"
      type="text/css"
    />

  </head>
  <body>

  <!-- Begin Page Content -->
<div class="container py-4">
	<!-- Page Heading -->
    <?php $settingss = $this->db->get('settings')->row_array(); ?>
	<!-- DataTales Example -->
	<div class="card mb-4">
		<div class="card-body">
      <div class="d-sm-flex align-items-center mb-0 justify-content-between">
        <img src="<?= base_url(); ?>assets/images/logo/<?= $this->Settings_model->general()['logo-dark'] ?>" alt="logo" class="mb-0" height="30px">
        <!-- <img src="<?= base_url(); ?>assets/images/icon/barcode.jpg" alt="barcode" height="40px" class="mb-0"> -->
        <div>
          <h6 class="mb-0">Order ID : <?= $invoice['invoice_code']; ?></h6>
          <!--<p class="mb-0"></p>-->
        </div>
      </div> 
      <hr>
      <div class="row">
          <div class="col-md-12">
              <h5>Penerima :</h5>
              <h6 class="mt-2 mb-0"><i class="fas fa-user"></i>&emsp;<?= $invoice['name']; ?></h6>
              <?php if($invoice['location'] == ""){ ?>
              <p class="mt-1 mb-0"><i class="fas fa-map-marker-alt"></i>&emsp;<?= $invoice['address']; ?> Kec. <?= $loc['subdistrict_name']; ?> <?= $loc['type']; ?> <?= $loc['city']; ?></p>
              <?php }else{ ?>
                <p class="mt-1 mb-0"><i class="fas fa-map-marker-alt"></i>&emsp;<?= $invoice['address']; ?></p>
              <?php } ?>
              <p class="mt-1"><i class="fas fa-mobile"></i>&emsp; <?= $invoice['telp'] ?></p>
              <br>
              <h5>Pengirim :</h5>
              <h6 class="mt-2 mb-0"><i class="fas fa-user"></i>&emsp;<?= $this->Settings_model->general()['app_name'] ?></h6>
              <p class="mt-1 mb-0"><i class="fas fa-mobile"></i> &emsp;<?= $this->Settings_model->general()['contact'] ?></p>
              
              <?php if($invoice['courier'] == "jne"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/jne.jpg" alt="kurir" width="160" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "ninja"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/ninja.png" alt="kurir" width="160" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "wahana"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/wahana.png" alt="kurir" width="100" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "tiki"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/tiki.png" alt="kurir" width="160" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "slis"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/slis.jpg" alt="kurir" width="150" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "sicepat"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/sicepat.png" alt="kurir" width="100" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "sap"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/sap.png" alt="kurir" width="120" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "rpx"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/rpx.png" alt="kurir" width="160" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "rex"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/rex.png" alt="kurir" width="100" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "pos"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/pos.jpeg" alt="kurir" width="120" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "pandu"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/pandu.png" alt="kurir" width="150" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "jnt"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/jnt.jpg" alt="kurir" width="100" style="top: 0; position: absolute; right: 0">
              <?php }else if($invoice['courier'] == "jet"){ ?>
                <img src="<?= base_url(); ?>assets/images/courier/jet.png" alt="kurir" width="120" style="top: 0; position: absolute; right: 0">
              <?php } ?>
              <hr>
              <h5 class="font-weight-bold mb-3">Item</h5>
              <table class="table table-bordered">
                  <tr>
                      <th class="text-center">No.</th>
                      <th class="text-center">Nama Produk</th>
                      <th class="text-center">Variasi</th>
                      <th class="text-center">Warna</th>
                      <th class="text-center">Banyak</th>
                  <?php $no=1; foreach($orders->result_array() as $data): ?>
                  </tr>
                      <td class="text-center"><?= $no; ?></td>
                      <td><?= $data['product_name']; ?></td>
                      <td class="text-center"><?= $data['size']; ?></td>
                      <td class="text-center"><?= $data['color']; ?></td>
                      <td class="text-center"><?= $data['qty']; ?></td>
                  <tr>
                  <?php $no++; endforeach; ?>
              </table>
          </div>
      </div>
		</div>
	</div>
</div>

  <script>
    window.print();
</script>

  </body>
</html>