<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>
  
  <head>
    <title>
      Metode Pembayaran
    </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 class="active"><span>Metode Pembayaran</span></li>
      </ul>
      <div class="row">
        <div class="col-sm-4 col-md-3">
          
        </div>
        <div class="col-sm-8 col-md-9">
          <div class="row">
            <div class="col-sm-6">
              <?php
              $payments = $this->payment->get();
              unset($payments['balance']);
              $x = round(count($payments) / 2);
              $i = 0;
              foreach ($payments as $payment):
              if (!is_file(VIEWPATH . 'admin/payments/' . $payment->key.'/main.php'))
                continue;
              ?>
              <?php echo $i == $x ? '</div><div class="col-sm-6">' : '';?>
              <div class="panel panel-default" id="<?php echo $payment->key;?>">
                <div class="panel-heading">
                  <h3>
                    <span class="pull-right">
                      <i class="fa fa-toggle-<?php echo $payment->status == 'on' ? 'on' : 'off';?>"></i>
                    </span>
                    <a href="<?php echo site_url('admin/payments/'.$payment->key);?>">
                      <?php echo html_escape($payment->nama) . PHP_EOL;?>
                    </a>
                  </h3>
                </div>
                <?php include (VIEWPATH . 'admin/payments/' . $payment->key . '/main.php');?>
                <div class="panel-footer">
                  <a class="btn btn-default btn-sm pull-right" href="<?php echo site_url('admin/payments/'.$payment->key.'/settings');?>"><i class="fa fa-cog"></i> Settings</a>
                  <a class="btn btn-default btn-sm" href="<?php echo site_url('admin/payments/'.$payment->key.'/mutasi');?>"><i class="fa fa-history"></i> Mutasi</a>
                </div>
              </div>
              <?php $i++; endforeach;?>
            </div>
          </div>
        </div>
      </div>
    </div>
    <?php include_once(VIEWPATH.'includes/foot.php'); ?>
  </body>

</html>