<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'>MENU</h3>
        </div>
        <div class='panel-body'>
          <form action="<?= $action; ?>" method="post">
            <table class='table table-striped'>
              <tr>
                <td width="120">Name <?= form_error('name') ?></td>
                <td><input type="text" class="form-control" name="name" id="name" placeholder="Name" value="<?= $name; ?>" />
                </td>
              <tr>
                <td>Link <?= form_error('link') ?></td>
                <td><input type="text" class="form-control" name="link" id="link" placeholder="Link" value="<?= $link; ?>" />
                </td>
              <tr>
                <td>Icon <?= form_error('icon') ?></td>
                <td><input type="text" class="form-control" name="icon" id="icon" placeholder="Icon" value="<?= $icon; ?>" />
                </td>
              <tr>
                <td>Pengguna <?= form_error('is_active') ?></td>
                <td>
                  <?= form_dropdown('is_active', array('1' => 'Admin', '2' => 'Absensi', '3' => 'Pegawai', '4' => 'Kesor', '5' => 'PTP', '0' => 'Tidak Aktif'), $is_active, "class='form-control'"); ?>
                </td>
              <tr>
                <td>Is Parent <?= form_error('is_parent') ?></td>
                <td>
                  <select name="is_parent" class="form-control">
                    <option value="0">YA</option>
                    <?php
                    $menu = $this->db->get('menu');
                    foreach ($menu->result() as $m) {
                      echo "<option value='$m->id' ";
                      echo $m->id == $is_parent ? 'selected' : '';
                      echo ">" .  strtoupper($m->name) . "</option>";
                    }
                    ?>
                  </select>
                </td>
                <input type="hidden" name="id" value="<?= $id; ?>" />
            </table>
          </form>
        </div>
        <div class="panel-footer">
          <a href="javascript:window.history.go(-1);" class="btn btn-default">Batal</a>
          <button type="submit" class="btn btn-primary pull-right"><?= $button ?></button>
        </div>
      </div>
    </div>
  </div>