<?php defined('BASEPATH') or exit('No direct script access allowed'); $opsi = json_decode($trx->tr_opsi, true); ?>
<?php if (@$_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest'):?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Status Pengiriman</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link href="<?php echo base_url('assets/css/bootstrap.min.css');?>" rel="stylesheet"/>
    <link href="<?php echo base_url('assets/css/bootstrap-theme.css');?>" rel="stylesheet"/>
    <style type="text/css">.col-xs-4.col-sm-3{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}.panel-body>.row{margin-bottom: 15px;}.panel-body>.row:last-child{margin-bottom: 0;}</style>
  </head>
  <body style="background: #f6f6f6;">
  <?php else:?>
  <style type="text/css">.col-xs-6.col-sm-3{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}.panel-body>.row{margin-bottom: 15px;}.panel-body>.row:last-child{margin-bottom: 0;}</style>
  <?php endif;?>
    <div style="padding: 15px;">
    <?php /* if (@$_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest'):?>
    <div class="panel panel-default">
      <div class="panel-heading"><h4 style="margin-top: 5px; margin-bottom: 5px;">Informasi Transaksi</h4></div>
      <div class="panel-body">
        <div class="row">
          <div class="col-xs-6 col-sm-3">ID</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo $trx->tr_id;?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Tanggal pembelian</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo format_tanggal($trx->tr_tanggal);?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Jenis produk</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo html_escape(@$this->system->produk->{$trx->op_produk}->nama);?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3"><?php echo html_escape($this->system->produk->{$trx->op_produk}->form->provider->label);?></div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo html_escape($trx->op_nama);?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3"><?php echo html_escape($this->system->produk->{$trx->op_produk}->form->voucher->label);?></div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo html_escape($trx->vo_nominal);?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Harga</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo format_uang2($opsi['original_amount']);?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Berat barang</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo $opsi['weight'];?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Jumlah pembelian</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo $opsi['quantity'];?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Biaya kirim</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo format_uang2($opsi['shipping']['courier']['cost']);?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Total pembayaran</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo format_uang2($trx->tr_harga);?></div>
        </div>
      </div>
    </div>
    <?php endif; */?>
    <div class="panel panel-default">
      <div class="panel-heading"><h4 style="margin-top: 5px; margin-bottom: 5px;">Informasi Pengiriman</h4></div>
      <div class="panel-body">
        <div class="row">
          <div class="col-xs-6 col-sm-3">Jasa pengiriman</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo html_escape(@$result['summary']['courier_name']);?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Jenis layanan</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo html_escape(@$result['summary']['service_code']);?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">No. Resi</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo ($this->user->is_admin() || @$this->user->us_id ==  $trx->us_id || $trx->us_id == 0 || @$this->uri->segment(3) == @$result['summary']['waybill_number'] ? html_escape(@$result['summary']['waybill_number']) : html_escape(substr(@$result['summary']['waybill_number'], 0, -4).'XXXX'));?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Tanggal dikirim</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo html_escape(@$result['summary']['waybill_date'].' '.@$result['details']['waybill_time']);?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Dikirim oleh</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo html_escape(@$result['summary']['shipper_name'] .' - '.@$result['summary']['origin']);?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Dikirim ke</div>
          <div class="col-xs-6 col-sm-9 text-right"><?php echo html_escape(@$result['summary']['receiver_name'].' - '.@$result['summary']['destination']);?></div>
        </div>
        <div class="row">
          <div class="col-xs-6 col-sm-3">Status</div>
          <div class="col-xs-6 col-sm-9 text-right"><strong><?php echo html_escape(@$result['summary']['status']);?></strong></div>
        </div>
      </div>
    </div>
    <?php if (isset($result['manifest']) && $result['manifest']):?>
    <div class="panel panel-default" style="margin-bottom: 0;">
      <div class="panel-heading"><h4 style="margin-top: 5px; margin-bottom: 5px;">Riwayat Pengiriman</h4></div>
      <div class="list-group">
        <?php foreach ($result['manifest'] as $res):?>
        <div class="list-group-item">
          <h6 class="list-group-item-heading"><?php echo html_escape(@$res['manifest_date'].' '.@$res['manifest_time']);?></h6>
          <p class="list-group-item-text"><?php echo html_escape(@$res['manifest_description']);?></p>
        </div>
        <?php endforeach;?>
      </div>
    </div>
    <?php else:?>
    <div class="alert alert-info" style="margin-bottom: 0;">Belum ada riwayat pengiriman.</div>
    <?php endif;?>
    </div>
    <?php if (@$_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest'):?>
  </body>
</html>
<?php else:?>
<div style="margin-bottom:15px;text-align: center;"><button class="btn btn-default" type="button" data-dismiss="modal"><i class="fa fa-times"></i> Tutup</button></div>
<?php endif;?>