<?php
defined('BASEPATH') or exit('No direct script access allowed');
$payment_key = strtolower($this->router->fetch_class());
?>
<!DOCTYPE html>
<html>
  <head>
    <title><?php echo $this->payment->{$payment_key}->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->{$payment_key}->nama);?></span></li>
      </ul>
      <div class="row">
        <div class="col-sm-4 col-md-3">
          <?php
          $params = array(array(
            'title' => html_escape($this->payment->{$this->router->fetch_class()}->nama),
            'links' => array(
                array('Overview', site_url('admin/payments/'.$payment_key), 'fa fa-eye', true),
                array('Mutasi', site_url('admin/payments/'.$payment_key.'/mutasi'), 'fa fa-history'),
                array('Settings', site_url('admin/payments/'.$payment_key.'/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-eye"></i> Overview</h3>
            </div>
            <div class="table-responsive">
              <table class="table">
                <tbody>
                  <tr><td style="width: 120px;">IB Username</td><td>: <?php echo html_escape($this->payment->{$payment_key}->data->api->username);?></td></tr>
                  <tr><td style="width: 120px;">Nomor Rekening</td><td>: <?php echo html_escape($this->payment->{$payment_key}->data->nomor_rekening);?></td></tr>
                  <tr><td style="width: 120px;">Nama Rekening</td><td>: <?php echo html_escape($this->payment->{$payment_key}->data->nama_rekening);?></td></tr>
                  <tr><td style="width: 120px;">Saldo</td><td>: <?php echo format_uang2(@$this->payment->{$payment_key}->saldo, @$this->payment->{$payment_key}->rate, $this->payment->{$payment_key}->template, $this->payment->{$payment_key}->round);?></td></tr>
                  <tr><td style="width: 120px;">Mutasi</td><td>: <a href="<?php echo site_url('admin/payments/'.$payment_key.'/mutasi');?>"><?php echo $this->db->query("SELECT COUNT(*) AS total FROM mutasi WHERE bank = '$payment_key'")->row()->total;?> transaksi</a></td></tr>
                  <tr><td style="width: 120px;">Status</td><td>: <?php echo $this->payment->{$payment_key}->status == 'on' ? 'Aktif' : 'Tidak aktif';?></td></tr>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
    <?php include_once(VIEWPATH.'includes/foot.php'); ?>
  </body>
</html>