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

<head>
  <title>Server Pulsa</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/pengaturan'); ?>">Pengaturan</a></li>
      <li class="active"><span>Server Pulsa</span></li>
    </ul>
    <div class="row">
      <div class="col-sm-4 col-md-3">
        <?php include(dirname(__FILE__) . '/../_sidebar.php'); ?>
      </div>
      <div class="col-sm-8 col-md-9">
        <div class="row">
          <div class="col-sm-4 col-lg-3" style="margin-bottom: 15px;">
            <a class="btn btn-default btn-block" href="<?php echo site_url('admin/pengaturan/server/add'); ?>"><i class="fa fa-plus"></i> Tambah Server</a>
          </div>
          <div class="col-sm-offset-4 col-sm-4 col-lg-offset-6 col-lg-3" style="margin-bottom: 15px;">
            <a class="btn btn-default btn-block" href="<?php echo site_url('admin/servers'); ?>"><i class="fa fa-server"></i> Daftar Server</a>
          </div>
        </div>
        <?php if (!$servers) : ?>
          <div class="alert alert-warning">Belum ada server, silakan <a class="alert-link" href="<?php echo site_url('admin/pengaturan/server/add'); ?>">Tambah Server</a>.</div>
        <?php else : ?>
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3><i class="fa fa-server"></i> Server Pulsa</h3>
            </div>
            <div class="table-responsive">
              <table class="table table-bordered table-hover">
                <thead>
                  <tr>
                    <th>Nama Server</th>
                    <th>Saldo</th>
                    <th>SMS Center</th>
                    <th>Jabber Center</th>
                    <th>Jalur Transaksi</th>
                    <th>Voucher</th>
                    <th style="text-align: center; width: 74px;">Tindakan</th>
                  </tr>
                </thead>
                <tbody>
                  <?php foreach ($servers as $server) : ?>
                    <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 format_uang2($server->sv_saldo); ?></td>
                      <td><?php echo $server->sv_sms_center; ?></td>
                      <td><?php echo html_escape($server->sv_jabber_center); ?></td>
                      <td><?php echo $this->server_model->gateway_label($server->sv_gateway); ?></td>
                      <td><?php echo $this->server_model->count_vouchers($server->sv_id); ?></td>
                      <td style="text-align: center; width: 74px; white-space: nowrap">
                        <a href="<?php echo site_url('admin/pengaturan/server/edit/' . $server->sv_id); ?>" class="btn btn-default btn-xs" style="margin-right: 4px"><i class="fa fa-edit"></i></a>
                        <a href="<?php echo site_url('admin/pengaturan/server/delete/' . $server->sv_id); ?>" class="btn btn-danger btn-xs" data-toggle="modal" data-target="#myModal" style="margin-left: 4px"><i class="fa fa-remove"></i></a>
                      </td>
                    </tr>
                  <?php endforeach; ?>
                </tbody>
              </table>
            </div>
          <?php endif; ?>
          </div>
      </div>
    </div>
  </div>
  <?php include_once(VIEWPATH . 'includes/foot.php'); ?>
</body>

</html>