<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>
  <head>
    <title>Mutasi <?php echo $this->payment->duitku->nama;?></title>
    <?php include_once(VIEWPATH. 'includes/head.php'); ?>
  </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/payments');?>">Metode Pembayaran</a></li>
        <li class="active"><span><?php echo html_escape($this->payment->duitku->nama);?></span></li>
      </ul>
      <div class="row">
        <div class="col-sm-4 col-md-3">
          <?php
          $params = array(array(
            'title' => html_escape($this->payment->duitku->nama),
            'links' => array(
                array('Overview', site_url('admin/payments/duitku'), 'fa fa-eye'),
                array('Mutasi', site_url('admin/payments/duitku/mutasi'), 'fa fa-history', true),
                array('Settings', site_url('admin/payments/duitku/settings'), 'fa fa-cog'),
            )
          ));
          echo sidebar_menu($params);
          ?>
        </div>
        <div class="col-sm-8 col-md-9">
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3><i class="fa fa-history"></i> Mutasi</h3>
            </div>
            <div class="panel-body">
              <?php if (!$total): ?>
              <div class="alert alert-warning">
                Tidak ada riwayat mutasi.
              </div>
              <?php else: ?>
              <div class="table-responsive">
                <table class="table table-striped">
                  <thead>
                    <tr>
                      <th>Tanggal</th>
                      <th>Keterangan</th>
                      <th>Debet</th>
                      <th>Kredit</th>
                    </tr>
                  </thead>
                  <tbody>
                    <?php foreach ($results as $history):?>
                    <tr>
                      <?php if ($history->trx_id):?>
                      <td><a href="<?php echo site_url('admin/transaksi/view/'.$history->trx_id);?>"><?php echo html_escape($history->tgl);?></a></td>
                      <?php elseif ($history->dep_id):?>
                      <td><a href="<?php echo site_url('admin/riwayat-deposit/view/'.$history->dep_id);?>"><?php echo html_escape($history->tgl);?></a></td>
                      <?php else:?>
                      <td><?php echo html_escape($history->tgl);?></td>
                      <?php endif;?>
                      <td><?php echo nl2br(html_escape($history->keterangan));?></td>
                      <td><?php echo format_uang($history->debet);?></td>
                      <td><?php echo format_uang($history->kredit);?></td>
                    </tr>
                    <?php endforeach;?>
                  </tbody>
                </table>
              </div>
              <?php echo pagination(site_url('admin/payments/duitku/mutasi'),$start,$total,$this->system->set['list_per_page'],'/%d');?>
              <?php endif; ?>
            </div>
          </div>
        </div>
      </div>
    </div>
    <?php include_once(VIEWPATH.'includes/foot.php'); ?>
  </body>
</html>