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

<head>
  <title>Multi Biller Solution API</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>Multi Biller Solution API</span></li>
    </ul>
    <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 style="text-align: center; width: 54px;">Status</th>
                    <th style="text-align: center; width: 74px;">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['mbs']) ? $sv_data['mbs']['userid'] : ''); ?></td>
                      </td>
                      <td style="text-align: center; width: 54px;"><?php echo (isset($sv_data['mbs']) ? ($sv_data['mbs']['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: 74px; white-space: nowrap"><a style="margin-right: 4px;" class="btn btn-default btn-xs" href="<?php echo site_url('admin/modules/mbs/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/mbs/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">
            <img class="media-object" style="width: 64px" height="64px" src="<?php echo base_url('assets/mbs-logo.png'); ?>" alt="Logo">
          </div>
          <div class="media-body">
            <h5 class="media-heading">PT Lima Tambah Dua</h5>
            Bumi Mandiri Tower II Lt.12
            <br>
            Jl. Panglima Sudirman Kav. 66-68 Surabaya 60271, Jawa Timur, Indonesia
            <br>
            PSTN +6231 60018522
          </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">Telegram Care</h5>
            Helpdesk 085336777576 | <a href="https://t.me/helpdeskMBS" target="_blank">@helpdeskMBS</a>
            <br>
            Customer Care 081556588882 | <a href="https://t.me/CustomerCareMBS" target="_blank">@CustomerCareMBS</a>
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php include_once(VIEWPATH . 'includes/foot.php'); ?>
</body>

</html>