<ul class="nav nav-tabs" role="tablist" style="margin-bottom: 15px;">
  <li role="presentation" class="active"><a href="#tambah" aria-controls="tambah" role="tab" data-toggle="tab"><i class="fa fa-pencil"></i> Tambah Manual</a></li>
  <li role="presentation" class=""><a href="#upload" aria-controls="upload" role="tab" data-toggle="tab"><i class="fa fa-upload"></i> Upload Data</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" id="tambah" class="tab-pane active fade in">
    <?php echo form_open();?>
      <div class="form-group">
        <label>Nomor HP / ID Pelanggan</label>
        <input class="form-control" name="nomor" value="<?php echo set_value('nomor');?>" required="required" maxlength="32"/>
      </div>
      <div class="form-group">
        <label>Alasan Pemblokiran</label>
        <textarea class="form-control" name="alasan" maxlength="160" rows="4"><?php echo set_value('alasan');?></textarea>
      </div>
      <div>
        <button type="submit" class="btn btn-primary"><i class="fa fa-check"></i> Simpan</button>
      </div>
    <?php echo form_close();?>
  </div>
  <div role="tabpanel" id="upload" class="tab-pane fade">
    <?php echo form_open_multipart('admin/modules/blokir-nomor/upload');?>
      <div class="input-group" style="margin-bottom: 15px;">
        <label class="input-group-btn">
          <span class="btn btn-default">Pilih... <input type="file" onchange="fileChanged(this)" style="display: none;" name="daftar_blokir"/></span>
        </label>
        <input id="filename" type="text" class="form-control" value="Tidak ada file" readonly="readonly"/>
        <span class="input-group-btn">
          <button type="submit" class="btn btn-primary"><i class="fa fa-upload"></i> Upload</button>
        </span>
      </div>
      <div>
        <div class="checkbox"><label style="font-weight: normal;"><input type="checkbox" name="reason" value="1" checked="checked"> Simpan alasan pemblokiran</label></div>
      </div>
    <?php echo form_close();?>
  </div>
</div>
<script type="text/javascript">
function fileChanged(input) {
  var filename = input.value.replace(/\\/g, '/').replace(/.*\//, '');
  if (filename.length > 1) {
    document.getElementById("filename").value = filename;
  } else {
    document.getElementById("filename").value = "Tidak ada file";
  }
}
</script>