   <ul>
                <li>Setelah Semua Beres, silakan login ke Feeder untuk cek dan memastikan data yang di restore berhasil</li>
              </ul> 
   <form class="form-horizontal">
 <div class="form-group">
                        <label for="Semester" class="control-label col-lg-2">NIM</label>
                        <div class="col-lg-4" >
                       <input type="text" name="value_nim" id="value_nim" class="form-control" placeholder="Input ID Registrasi atau NIM Mahasiswa" required="">
            </div>
                      </div><!-- /.form-group -->
                      
                      <div class="form-group">
                        <label for="tags" class="control-label col-lg-2">&nbsp;</label>
                        <div class="col-lg-10">
                        <span class="btn btn-primary" id="filter_lainya"><i class="fa fa-refresh"></i> Tampilkan Data</span>
                        </div>
                      </div><!-- /.form-group -->
                    </form>

<div class="isi-biodata">
  
</div>

<div class="nav-tabs-custom">
            <ul class="nav nav-tabs">
              <li class="active"><a href="#nilai" data-toggle="tab" aria-expanded="true"><i class="fa fa-unlock"></i> Restore Krs/Nilai</a></li>
              <li class=""><a href="#akm" data-toggle="tab" aria-expanded="false"><i class="fa fa-unlock"></i> Restore AKM</a></li>
              <li><a href="#transfer" data-toggle="tab"><i class="fa fa-unlock"></i> Restore Nilai Tranfer</a></li>
            <!--   <li><a href="#aktivitas" data-toggle="tab"><i class="fa fa-unlock"></i> Restore Aktivitas</a></li>
            <li><a href="#prestasi" data-toggle="tab"><i class="fa fa-unlock"></i> Restore Prestasi</a></li> -->
            </ul>
            <div class="tab-content">
              <div class="tab-pane active" id="nilai">
                <?php
                include "tab_lain/tab_nilai.php";
                ?>
              </div>
              <!-- /.tab-pane -->
              <div class="tab-pane" id="akm">
                <?php
                include "tab_lain/tab_akm.php";
                ?>
              </div>
              <div class="tab-pane" id="transfer">
                <?php
                include "tab_lain/tab_nilai_transfer.php";
                ?>
              </div>
<!--               <div class="tab-pane" id="aktivitas">
  <?php
  //include "tab_lain/tab_aktivitas.php";
  ?>
</div>
<div class="tab-pane" id="prestasi">
  <?php
  //include "tab_lain/tab_prestasi.php";
  ?>
</div> -->
              <!-- /.tab-pane -->
            </div>
            <!-- /.tab-content -->
          </div>
<script type="text/javascript">
  
$('#filter_lainya').on('click', function() {
  $("#loadnya").show();
        $.ajax({
            type: 'POST',
            url: '<?=base_admin();?>modul/restore_mahasiswa/isi_biodata.php',
            data: {nipd:$("#value_nim").val()},
            success: function(result) {
                $('.isi-biodata').html(result);
                $('#loadnya').hide();
            },
        });

dataTable_nilai = $("#tab_nilai").DataTable({
     destroy: true,
           'bProcessing': true,
            'bServerSide': true,
             "paging" : false,
              "searching": false,
               "ordering": false,
            "ajax":{
              url :"<?=base_admin();?>modul/restore_mahasiswa/tab_lain/tab_nilai_data.php",
            type: "post",  // method  , by default get
            data: function ( d ) {
                    d.nipd = $("#value_nim").val();
                  },
          error: function (xhr, error, thrown) {
            console.log(xhr);
            }
          }

        });
dataTable_akm = $("#tab_akm").DataTable({
     destroy: true,
           'bProcessing': true,
            'bServerSide': true,
             "paging" : false,
              "searching": false,
               "ordering": false,
            "ajax":{
              url :"<?=base_admin();?>modul/restore_mahasiswa/tab_lain/tab_akm_data.php",
            type: "post",  // method  , by default get
            data: function ( d ) {
                    d.nipd = $("#value_nim").val();
                  },
          error: function (xhr, error, thrown) {
            console.log(xhr);
            }
          }

        });
dataTable_transfer = $("#tab_transfer").DataTable({
     destroy: true,
           'bProcessing': true,
            'bServerSide': true,
             "paging" : false,
              "searching": false,
               "ordering": false,
            "ajax":{
              url :"<?=base_admin();?>modul/restore_mahasiswa/tab_lain/tab_nilai_transfer_data.php",
            type: "post",  // method  , by default get
            data: function ( d ) {
                    d.nipd = $("#value_nim").val();
                  },
          error: function (xhr, error, thrown) {
            console.log(xhr);
            }
          }

        });
});

function jml_checked(table_id) {
      var selected = check_selected(table_id);
      var btn_hide = $('.restore-'+table_id);
      if (selected.length > 0) {
          btn_hide.attr("disabled",false);
      } else {
          btn_hide.attr("disabled",true);
      }
}

$(".bulk-check").on('click',function() { // bulk checked
          table_id = $(this).data('id');
          var status = this.checked;
          if (status) {
            select_deselect('select',table_id);
          } else {
            select_deselect('unselect',table_id);
          }

          $(".check-selected").each( function() {
            $(this).prop("checked",status);

          });
});
function select_deselect(type,table_id) {
    if (type == 'select') {
        $('#tab_'+table_id+' tbody tr').addClass('DTTT_selected selected')
    } else {
        $('#tab_'+table_id+' tbody tr').removeClass('DTTT_selected selected')
    }
  jml_checked(table_id)
}
function check_selected(name_id) {
  var table_select = $('#tab_'+name_id+' tbody tr.selected');
  var array_data_delete = [];
  table_select.each(function() {
      var check_data = $(this).find('.check-selected').val();
      if (typeof check_data != 'undefined') {
          array_data_delete.push(check_data)
      }
  });
  return array_data_delete
}


/* Add a click handler for the delete row */
  $('.kirim-data').click( function() {
    table_id = $(this).data('id');
    $("#loadnya").show();
    var dTable = eval('dataTable_'+table_id);
    var data_array_id = check_selected(table_id);
        $.ajax({
            type: 'POST',
            url: '<?=base_admin();?>modul/restore_mahasiswa/restore_mahasiswa_action.php?act='+table_id,
            data: {data_ids:data_array_id},
            success: function(result) {
                $('.hasil-restore-'+table_id).html(result);
               $('#loadnya').hide();
                  $(".bulk-check").prop("checked",0);
                  select_deselect('unselect',table_id);
                  dTable.draw(false);
            },
        });
  });


  $(document).on('click', '#tab_nilai tbody tr .check-selected', function(event) {
      $(this).parents('tr').toggleClass('DTTT_selected selected');
      var selected = jml_checked('nilai');
  });
  $(document).on('click', '#tab_akm tbody tr .check-selected', function(event) {
      $(this).parents('tr').toggleClass('DTTT_selected selected');
      var selected = jml_checked('akm');
  });
    $(document).on('click', '#tab_transfer tbody tr .check-selected', function(event) {
      $(this).parents('tr').toggleClass('DTTT_selected selected');
      var selected = jml_checked('transfer');
  });
/*    $(document).on('click', '#tab_aktivitas tbody tr .check-selected', function(event) {
      $(this).parents('tr').toggleClass('DTTT_selected selected');
      var selected = jml_checked('aktivitas');
  });*/
</script>