<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>
  <head>
    <title>Riwayat Transaksi | OtomaX API <?php echo html_escape($server->sv_nama);?></title>
    <?php include_once(VIEWPATH.'includes/head.php'); ?>
    <style type="text/css">nav{margin-bottom: 15px;float: right;}</style>
  </head>
  <body>
    <?php include_once(VIEWPATH. 'admin/_navbar.php'); ?>
    <div class="container">
      <ul class="breadcrumb">
        <li><a href="<?php echo site_url();?>"><i class="fa fa-home"></i></a></li>
        <li><a href="<?php echo site_url('admin');?>">Admin Panel</a></li>
        <li><a href="<?php echo site_url('admin/modules/otomax');?>">OtomaX</a></li>
        <li class="active"><span><?php echo html_escape($server->sv_nama);?></span></li>
      </ul>
      <div class="row">
        <div class="col-sm-4 col-md-3">
          <?php include_once(dirname(__FILE__).'/_sidebar.php');?>
        </div>
        <div class="col-sm-8 col-md-9">
          <?php if (!$history_trx['0101']):?>
          <div class="alert alert-warning">Belum ada riwayat transaksi.</div>
          <?php else:?>
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3><i class="fa fa-history"></i> Riwayat Transaksi</h3>
            </div>
            <div class="table-responsive">
              <table class="table table-bordered table-hover">
                <thead>
                  <tr>
                    <th>Transaksi</th>
                    <th>Tanggal</th>
                    <th>Pengirim</th>
                    <th>Status</th>
                    <th>SN</th>
                    <th>Saldo Awal</th>
                    <th>Harga</th>
                    <th>Saldo Akhir</th>
                  </tr>
                </thead>
                <tbody>
                  <?php foreach ($history_trx['0101'] as $item):?>
                  <tr>
                    <td><?php echo $item['kode_produk'];?>.<?php echo $item['tujuan'];?></td>
                    <td><?php echo $item['tgl_status'];?></td>
                    <td><?php echo $item['pengirim'];?></td>
                    <td><?php echo $item['harga'] != '0' ? '<span class="text-success">Sukses</span>' : '<span class="text-danger">Gagal</span>';?></td>
                    <td><?php echo $item['sn'];?></td>
                    <td><?php echo $item['saldo_awal'];?></td>
                    <td><?php echo $item['harga'];?></td>
                    <td><?php echo $item['saldo_akhir'];?></td>
                  </tr>
                  <?php endforeach;?>
                </body>
              </table>
            </div>
          </div>
          <?php echo pagination(site_url('admin/modules/otomax/history-trx'), $start_num, $history_trx['1001'], 20, '/%d');?>
          <?php endif;?>
        </div>
      </div>
    </div>
    <?php include_once(VIEWPATH.'includes/foot.php'); ?>
  </body>
</html>