<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>

<head>
  <title>Okepay</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>Okepay</span></li>
    </ul>
    <div class="alert alert-info"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>Untuk menggunakan modul ini kamu harus terdaftar di Okepay, untuk pendaftaran silakan <a class="alert-link" href="https://play.google.com/store/apps/details?id=co.id.okepay.native" target="_blank">klik di sini</a>.</div>
    <div class="row">
      <div class="col-sm-12 col-md-12">
        <?php if (!$servers) : ?>
          <div class="alert alert-warning">Belum ada daftar Server.</div>
        <?php else : ?>
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3><i class="fa fa-server"></i> Server</h3>
            </div>
            <div class="table-responsive">
              <table class="table table-bordered table-hover" style="margin-bottom: 0;">
                <thead>
                  <tr>
                    <th>Nama Server</th>
                    <th>Jalur Transaksi</th>
                    <th>User ID</th>
                    <th>API Key</th>
                    <th style="text-align: center; width: 54px;">Status</th>
                    <th style="text-align: center; width: 73px;">Tindakan</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
                  foreach ($servers as $server) :
                    $sv_data = json_decode($server->sv_data, true);
                  ?>
                    <tr>
                      <td><a href="<?php echo site_url('admin/pengaturan/server/edit/' . $server->sv_id); ?>"><?php echo html_escape($server->sv_nama) ?></a></td>
                      <td><?php echo $this->server_model->gateway_label($server->sv_gateway); ?></td>
                      <td><?php echo (isset($sv_data['okepay']) ? $sv_data['okepay']['userid'] : ''); ?></td>
                      </td>
                      <td><?php echo (isset($sv_data['okepay']) ? $sv_data['okepay']['key'] : ''); ?></td>
                      <td style="text-align: center; width: 54px;"><?php echo (isset($sv_data['okepay']) ? ($sv_data['okepay']['status'] == 1 ? '<span class="text-success" data-toggle="tooltip" data-title="Aktif"><i class="fa fa-check"></i></span>' : '<span class="text-danger" data-toggle="tooltip" data-title="Tidak aktif"><i class="fa fa-times"></i></span>') : ''); ?></td>
                      <td style="text-align: center; width: 73px;"><a style="margin-right: 4px;" class="btn btn-default btn-xs" href="<?php echo site_url('admin/modules/okepay/login/' . $server->sv_id); ?>" title="Masuk"><i class="fa fa-sign-in"></i></a><a style="margin-left: 4px;" class="btn btn-danger btn-xs" data-toggle="modal" data-target="#myModal" href="<?php echo site_url('admin/modules/okepay/delete-data/' . $server->sv_id); ?>" title="Hapus Data"><i class="fa fa-times"></i></a></td>
                    </tr>
                  <?php endforeach; ?>
                </tbody>
              </table>
            </div>
          </div>
        <?php endif; ?>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-6 col-md-8">
        <div class="media" style="margin-bottom: 20px">
          <div class="media-left hidden-xs">
            <a href="http://portal.okepay.id" target="_blank">
              <img class="media-object" style="background-color: #d9244d; padding: 4px;border-radius:3px;width:110px" src="<?php echo base_url('assets/okepay-logo.png'); ?>" alt="Logo">
            </a>
          </div>
          <div class="media-body">
            <h5 class="media-heading">PT Oke Digital Media</h5>
            Mandiri Tower Lt 12, Surabaya
            <br>
            Jawa Timur, Indonesia
          </div>
        </div>
      </div>
      <div class="col-xs-6 col-md-4">
        <div class="media" style="margin-bottom: 20px">
          <div class="media-body text-right">
            <h5 class="media-heading">Kontak</h5>
            Telegram Care: <a href="https://t.me/okepay" target="_blank">@okepay</a>
            <br>
            Website: <a href="https://okepay.id" target="_blank">okepay.id</a>
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php include_once(VIEWPATH . 'includes/foot.php'); ?>
</body>

</html>