<?php
$this->db->select('*');
$this->db->from('web_management');
$this->db->join('web_style_2', 'web_management.style_web = web_style_2.id_web_style');
$wb_style = $this->db->get();
foreach ($wb_style->result() as $data) {
  $web_name = $data->nama_web;
  $web_description = $data->deskripsi;
  $web_meta_color = $data->meta_color;
  $web_navbar_color = $data->navbar_color;
  $web_box_color = $data->box_color;
  $web_box_bottom = $data->box_bottom;
}
?>
<div id="content" class='content'>
  <div class='row'>
    <div class='col-lg-12'>
      <div class='panel <?= $web_box_color ?>'>
        <div class='panel-heading'>
          <h3 class='panel-title bold'>Tambah User</h3>
        </div>
        <!-- <form action="" method="post"> -->
        <?php echo form_open("auth/create_user"); ?>
        <div class='panel-body'>
          <div class="row">
            <div class="col-md-12">
              <div class="form-group">
                <label for="exampleInputEmail1">Nama : </label><?php echo form_error('first_name');
                                                                ?>
                <?php echo form_input($first_name);
                ?>

              </div>
            </div>
            <div class="col-md-4">
              <div class="form-group">
                <?php
                if ($identity_column !== 'email') {
                  echo '<label for="exampleInputEmail1">Username : </label>';
                  echo form_error('identity');
                  echo form_input($identity);
                }
                echo '<label for="exampleInputEmail1">Email : </label>';
                echo form_error('email');
                echo form_input($email);
                ?>
              </div>
            </div>
            <div class="col-md-4">
              <div class="form-group">
                <label for="exampleInputEmail1"> NIP/NRPTT : </label>
                <?php echo form_input($phone);
                echo form_error('phone');
                ?>
              </div>
            </div>
            <div class="col-md-4">
              <div class="form-group">
                <label for="exampleInputEmail1">Hak Akses : </label>
                <?php echo form_error('company'); ?>
                <select class="form-control" name="company">
                  <option value="">-Pilih Hak Akses-</option>
                  <?php
                  $menu = $this->db->get_where('groups', array('name !=' => 'superadmin'));
                  foreach ($menu->result() as $m) {
                    if ($m->name == 'members') {
                    } else {
                  ?>
                      <option style="text-transform: capitalize;" value="<?= $m->name ?>"><?= $m->name ?></option>
                  <?php }
                  }
                  ?>
                </select>
              </div>
            </div>
            <div class="col-md-6">
              <div class="form-group">
                <label for="exampleInputEmail1"> Password : </label>
                <?php
                echo form_error('password');
                echo form_input($password);
                ?>
              </div>
            </div>
            <div class="col-md-6">
              <div class="form-group">
                <label for="exampleInputEmail1"> Ulangi Password : </label>
                <?php
                echo form_error('password_confirm');
                echo form_input($password_confirm);
                ?>
              </div>
            </div>
          </div>
        </div>
        <div class="panel-footer">
          <!-- <button type="submit" class="btn btn-primary pull-right">Simpan</button> -->
          <?php echo form_submit('submit', 'Simpan', array('class' => 'btn btn-primary pull-right')); ?>
          <a href="javascript:window.history.go(-1);" class="btn btn-default">Batal</a>
        </div>
        <?php echo form_close(); ?>
        <!-- </form> -->
      </div>
    </div>
  </div>
</div>