<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>
  <head>
    <title>Admin &gt; Pengaturan &amp; Lainnya</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><a href="<?php echo site_url('admin/pengaturan');?>">Pengaturan</a></li>
        <li class="active"><span>Perijinan &amp; Lainnya</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> Perijinan &amp; Lainnya</h3>
            </div>
            <div class="panel-body">
              <?php echo form_open();?>
                <div class="form-group">
                  <label>Ijinkan pendaftaran member baru?</label>
                  <div>
                    <div class="radio-inline"><label><input type="radio" name="allow_reguser" value="yes" <?php echo ($this->system->perm->allow_reguser == 'yes' ? 'checked="checked"' : '');?>/> Ya</label></div>
                    <div class="radio-inline"><label><input type="radio" name="allow_reguser" value="no" <?php echo ($this->system->perm->allow_reguser == 'no' ? 'checked="checked"' : '');?>/> Tidak</label></div>
                  </div>                    
                </div>
                <div class="form-group">
                  <label>Gunakan captcha di form pendaftaran member baru?</label>
                  <div>
                    <div class="radio-inline"><label><input type="radio" name="captcha_reg" value="yes" <?php echo ($this->system->perm->captcha_reg == 'yes' ? 'checked="checked"' : '');?>/> Ya</label></div>
                    <div class="radio-inline"><label><input type="radio" name="captcha_reg" value="no" <?php echo ($this->system->perm->captcha_reg == 'no' ? 'checked="checked"' : '');?>/> Tidak</label></div>
                  </div>                    
                </div>
                <div class="form-group">
                  <label>Domain email yang diperbolehkan untuk melakukan pendaftaran</label>
                  <input class="form-control" name="email_reg" maxlength="255" value="<?php echo set_value('email_reg', str_replace(',',', ', @$this->system->perm->email_reg));?>" placeholder="Contoh: gmail.com, yahoo.co.id"/>
                  <p class="help-block">Pisahkan domain dengan tanda koma atau kosongkan untuk menonaktifkan filter ini</p>
                </div>
                <div class="form-group">
                  <label>Gunakan captcha di form masuk / login?</label>
                  <div>
                    <div class="radio-inline"><label><input type="radio" name="captcha_login" value="yes" <?php echo ($this->system->perm->captcha_login == 'yes' ? 'checked="checked"' : '');?>/> Ya</label></div>
                    <div class="radio-inline"><label><input type="radio" name="captcha_login" value="no" <?php echo ($this->system->perm->captcha_login == 'no' ? 'checked="checked"' : '');?>/> Tidak</label></div>
                  </div>                    
                </div>
                <div class="form-group">
                  <label>Kirimkan pemberitahuan masuk melalui email?</label>
                  <div>
                    <div class="radio-inline"><label><input type="radio" name="email_login" value="yes" <?php echo (@$this->system->perm->email_login == 'yes' ? 'checked="checked"' : '');?>/> Ya</label></div>
                    <div class="radio-inline"><label><input type="radio" name="email_login" value="no" <?php echo (@$this->system->perm->email_login == 'no' ? 'checked="checked"' : '');?>/> Tidak</label></div>
                  </div>                    
                </div>
                <div class="form-group">
                  <label>Mengharuskan verifikasi Email?</label>
                  <div>
                    <div class="radio-inline"><label><input type="radio" name="verify_email" value="1" <?php echo ($this->system->perm->verify_email == 1 ? 'checked="checked"' : '');?>/> Ya</label></div>
                    <div class="radio-inline"><label><input type="radio" name="verify_email" value="0" <?php echo ($this->system->perm->verify_email == 0 ? 'checked="checked"' : '');?>/> Tidak</label></div>
                  </div>                    
                </div>
                <div class="form-group">
                  <label>Mengharuskan verifikasi Nomor HP?</label>
                  <div>
                    <div class="radio-inline"><label><input type="radio" name="verify_phone" value="1" <?php echo ($this->system->perm->verify_phone == 1 ? 'checked="checked"' : '');?>/> Ya</label></div>
                    <div class="radio-inline"><label><input type="radio" name="verify_phone" value="0" <?php echo ($this->system->perm->verify_phone == 0 ? 'checked="checked"' : '');?>/> Tidak</label></div>
                  </div>                    
                </div>
                <div class="form-group">
                  <label>Mengharuskan verifikasi KTP?</label>
                  <div>
                    <div class="radio-inline"><label><input type="radio" name="verify_ktp" value="1" <?php echo (@$this->system->perm->verify_ktp == 1 ? 'checked="checked"' : '');?>/> Ya</label></div>
                    <div class="radio-inline"><label><input type="radio" name="verify_ktp" value="0" <?php echo (@$this->system->perm->verify_ktp == 0 ? 'checked="checked"' : '');?>/> Tidak</label></div>
                  </div>                    
                </div>
                <div class="form-group">
                  <label>Data verifikasi User</label>
                  <div>
                    <div class="checkbox-inline"><label><input type="checkbox" name="user_verified[]" value="email" <?php echo (in_array('email', $this->system->perm->user_verified) ? 'checked="checked"' : '');?>/> Email Terverifikasi</label></div>
                    <div class="checkbox-inline"><label><input type="checkbox" name="user_verified[]" value="phone" <?php echo (in_array('phone', $this->system->perm->user_verified) ? 'checked="checked"' : '');?>/> Nomor HP Terverifikasi</label></div>
                    <div class="checkbox-inline"><label><input type="checkbox" name="user_verified[]" value="ktp" <?php echo (in_array('ktp', $this->system->perm->user_verified) ? 'checked="checked"' : '');?>/> KTP Terverifikasi</label></div>
                  </div>                    
                </div>
                <div class="form-group">
                  <label>Perbolehkan user merubah Nomor HP?</label>
                  <div>
                    <div class="radio-inline"><label><input type="radio" name="edit_phone" value="1" <?php echo (@$this->system->perm->edit_phone == 1 ? 'checked="checked"' : '');?>/> Ya</label></div>
                    <div class="radio-inline"><label><input type="radio" name="edit_phone" value="0" <?php echo (@$this->system->perm->edit_phone == 0 ? 'checked="checked"' : '');?>/> Tidak</label></div>
                  </div>                    
                </div>
                <div class="form-group">
                  <label>Mengharuskan semua member untuk menggunakan One Time Password (OTP)</label>
                  <div>
                    <div class="radio-inline"><label><input type="radio" name="required_otp" value="email" <?php echo (@$this->system->perm->required_otp == 'email' ? 'checked="checked"' : '');?>/> Mengharuskan dan kirim OTP melalui Email</label></div>
                    <div class="radio-inline"><label><input type="radio" name="required_otp" value="sms" <?php echo (@$this->system->perm->required_otp == 'sms' ? 'checked="checked"' : '');?>/> Mengharuskan dan kirim OTP melalui SMS</label></div>
                    <div class="radio-inline"><label><input type="radio" name="required_otp" value="" <?php echo (@$this->system->perm->required_otp == '' ? 'checked="checked"' : '');?>/> Tidak mengharuskan</label></div>
                  </div>
                </div>
                <div id="user-otp" style="<?php echo (@$this->system->perm->required_otp == '' ? 'display:block' : 'display:none');?>">
                  <div class="form-group">
                    <label>Perijinan member untuk menggunakan One Time Password (OTP)</label>
                    <div>
                      <div class="radio-inline"><label><input type="radio" name="otp" value="2" <?php echo (@$this->system->perm->otp == 2 ? 'checked="checked"' : '');?>/> Hanya Administrator</label></div>
                      <div class="radio-inline"><label><input type="radio" name="otp" value="1" <?php echo (@$this->system->perm->otp == 1 ? 'checked="checked"' : '');?>/> Semua Member</label></div>
                      <div class="radio-inline"><label><input type="radio" name="otp" value="0" <?php echo (@$this->system->perm->otp == 0 ? 'checked="checked"' : '');?>/> Tidak Semua</label></div>
                    </div>                    
                    <p class="help-block">Pengaturan OTP terletak pada halaman Akun &gt; Pengaturan &gt; Keamanan</p>
                  </div>
                  <div class="form-group">
                    <label>Jalur pengiriman One Time Password (OTP)</label>
                    <div>
                      <div class="checkbox-inline"><label><input type="checkbox" name="otp_gateway[]" value="email" <?php echo (@in_array('email', $this->system->perm->otp_gateway) ? 'checked="checked"' : '');?>/> Email</label></div>
                      <div class="checkbox-inline"><label><input type="checkbox" name="otp_gateway[]" value="sms" <?php echo (@in_array('sms', $this->system->perm->otp_gateway) ? 'checked="checked"' : '');?>/> SMS</label></div>
                    </div>                    
                  </div>
                </div>
                <div>
                  <button type="submit" class="btn btn-primary" name="submit" value="save">Simpan</button>
                </div>
              <?php echo form_close();?>
            </div>
          </div>
        </div>
      </div>
    </div>
    <?php include_once(VIEWPATH.'includes/foot.php'); ?>
    <script type="text/javascript">$('input[name="required_otp"]').on("click", function(){if ($('input[name="required_otp"]:checked').val() == "") {$("#user-otp").show();} else {$("#user-otp").hide();}});</script>
  </body>
</html>