<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>
  <head>
    <title>Admin &gt; Pembelian Massal</title>
    <?php include_once(VIEWPATH.'includes/head.php'); ?>
    <style type="text/css">.checkbox>label,.checkbox-inline>label,.radio>label,.radio-inline>label{font-weight: normal;}</style>
  </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>Pembelian Massal</span></li>
      </ul>
      <div class="row">
        <div class="col-sm-4 col-md-3">
          <?php include_once(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-cogs"></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 == 'umum' ? 'active' : '';?>"><a href="#umum" aria-controls="umum" role="tab" data-toggle="tab">Umum</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 == 'umum' ? 'active' : '';?>" id="umum">
                  <?php echo form_open('admin/modules/mass-order/index/umum');?>
                    <div class="form-group">
                      <label class="control-label">Produk yang diijinkan</label>
                      <?php foreach ($produk as $key=>$val): ?>
                      <div class="checkbox" style="margin-top: 2px;margin-bottom: 2px;">
                        <label style="font-weight: normal;"><input type="checkbox" name="produk[]" value="<?php echo $key;?>" <?php echo in_array($key, $set['produk']) ? 'checked="checked"' : '';?>/> <?php echo ($val['status'] == 'on' ? $val['nama'] : '<span class="text-muted">'.$val['nama'].' (Tidak aktif)</span>');?></label>
                      </div>
                      <?php endforeach;?>
                    </div>
                    <div class="form-group">
                      <label for="max" class="control-label">Maksimal jumlah pembelian</label>
                      <input type="number" class="form-control" name="max" id="max" value="<?php echo $set['max'];?>" required="required"/>
                    </div>
                    <div>
                      <button type="submit" class="btn btn-primary" name="submit" value="simpan">Simpan</button>
                    </div>
                  <?php echo form_close();?>
                </div>
                <div role="tabpanel" class="tab-pane <?php echo $active_tab == 'lisensi' ? 'active' : '';?>" id="lisensi">
                  <?php echo form_open('admin/modules/mass-order/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', @$set['lisensi']);?>" placeholder="" maxlength="64" />
                        <span class="input-group-btn"><button class="btn btn-primary" type="submit" name="submit" value="simpan">Simpan</button></span>
                      </div>
                      <p class="help-block" style="margin-bottom: 0;"><a href="http://w38s.com/lisensi/mass-order" target="_blank">Klik di sini</a> untuk mendapatkan kode lisensi</p>
                    </div>
                  <?php echo form_close();?>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <?php include_once(VIEWPATH.'includes/foot.php'); ?>
  </body>
</html>