<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>
  <head>
    <title>Admin &gt; Telegram Bot</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>Telegram Bot</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="panel panel-default">
            <div class="panel-heading">
              <h3><i class="fa fa-cog"></i> Pengaturan</h3>
            </div>
            <div class="panel-body">
              <ul class="nav nav-tabs" role="tablist" style="margin-bottom: 15px;">
                <li role="presentation" class="<?php echo $active_tab == 'bot' ? 'active' : '';?>"><a href="#bot" aria-controls="bot" role="tab" data-toggle="tab">Bot</a></li>
                <li role="presentation" class="<?php echo $active_tab == 'lisensi' ? 'active' : '';?>"><a href="#lisensi" aria-controls="lisensi" role="tab" data-toggle="tab">Lisensi</a></li>
              </ul>
              <div class="tab-content">
                <div role="tabpanel" class="tab-pane <?php echo $active_tab == 'bot' ? 'active' : '';?>" id="bot">
                  <div style="margin-bottom: 15px;">
                    <?php echo form_open();?>
                      <div class="form-group">
                        <label>API Token</label>
                        <div class="input-group">
                          <input type="text" class="form-control" name="token" value="<?php echo set_value('token', $tg_bot['token']);?>" placeholder="12345678:BlaBlaBla........" />
                          <span class="input-group-btn"><button class="btn btn-primary" type="submit" name="submit" value="simpan">Simpan</button></span>
                        </div>
                        <p class="help-block">Silakan baca <a href="<?php echo site_url('admin/modules/telegram-bot/tentang');?>">panduan</a> membuat bot, kosongkan jika tidak ingin mengaktifkan.</p>
                      </div>
                    <?php echo form_close();?>
                  </div>
                  <div class="table-responsive">
                    <table class="table table-striped">
                      <body>
                        <tr><td style="width: 140px;">ID</td><td>: <?php echo $tg_bot['id'];?></td></tr>
                        <tr><td style="width: 140px;">Username</td><td>: <a href="http://t.me/<?php echo $tg_bot['username'];?>" target="_blank"><?php echo $tg_bot['username'] ? '@'.$tg_bot['username'] : '';?></a></td></tr>
                        <tr><td style="width: 140px;">Name</td><td>: <?php echo html_escape($tg_bot['name']);?></td></tr>
                        <tr><td style="width: 140px;">API Token</td><td>: <?php echo $tg_bot['token'];?></td></tr>
                        <tr><td style="width: 140px;">Web Hook Info</td><td>: <a href="<?php echo site_url('admin/modules/telegram-bot/webhook-info');?>" data-toggle="modal" data-target="#myModal">Cek Status</a></td></tr>
                      </tbody>
                    </table>
                  </div>
                </div>
                <div role="tabpanel" class="tab-pane <?php echo $active_tab == 'lisensi' ? 'active' : '';?>" id="lisensi">
                  <?php echo form_open('admin/modules/telegram-bot/index/lisensi');?>
                    <div class="form-group" style="margin-bottom: 0;">
                      <label>Kode Lisensi</label>
                      <div class="input-group">
                        <input type="text" class="form-control" name="lisensi" value="<?php echo set_value('lisensi', @$tg_bot['lisensi']);?>" placeholder="" maxlength="64" />
                        <span class="input-group-btn"><button class="btn btn-primary" type="submit" name="submit_lisensi" value="simpan">Simpan</button></span>
                      </div>
                      <p class="help-block"><a href="http://w38s.com/lisensi/telegram-bot" target="_blank">Klik di sini</a> untuk mendapatkan kode lisensi, jika kode lisensi benar maka kamu akan mendapatkan bot premium</p>
                    </div>
                  <?php echo form_close();?>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <?php include_once(VIEWPATH.'includes/foot.php'); ?>
  </body>
</html>