<div class="col-12">
  <div class="card card-primary card-outline card-outline-tabs" id="content-box-1">
    <div class="card-header p-0 border-bottom-0">
      <ul class="nav nav-tabs" id="custom-tabs-four-tab" role="tablist">
        <?php $urut = 0 ; foreach ($data as $key){ $urut++; ?>
          <li class="nav-item">
            <a class="nav-link <?php if($urut == 1){ echo 'active'; $service_name_aktif = $key->service_name; } ?>" id="custom-<?php echo $key->id ?>-tab" data-toggle="pill" href="#custom-<?php echo $key->id ?>" role="tab" aria-controls="custom-<?php echo $key->id ?>" aria-selected="true" onclick="load_tabel('<?php echo $key->service_name ?>')"><?php echo $key->value ?></a>
          </li>
        <?php } ?>
      </ul>
    </div>
    <div class="card-body">
      <div class="tab-content" id="custom-tabs-tabContent">
        <?php $urut = 0 ; foreach ($data as $key){ $urut++; ?>
          <div class="tab-pane fade <?php if($urut == 1) echo 'show active' ?>" id="custom-<?php echo $key->id ?>" role="tabpanel" aria-labelledby="custom-<?php echo $key->id ?>-tab">
            <?php if($key->update == 'Ya'){ ?>
              <button type="button" class="btn btn-primary btn-sm float-sm-right"onclick="update_data('<?php echo $key->service_name ?>')"><i class="fas fa-sync-alt"></i> Update</button>
            <?php } ?> 
            <?php if($key->update == 'Update 2'){ ?>
              <button type="button" class="btn btn-primary btn-sm float-sm-right"onclick="update_data_2('<?php echo $key->service_name ?>')"><i class="fas fa-sync-alt"></i> Update</button>
            <?php } ?>
            <div id="<?php echo $key->service_name ?>"></div>
          </div>
        <?php } ?>
      </div>
    </div>
  </div>

  <div class="card card-default" id="content-box-2">
    <div id="content-tabel-2">
    </div>                
  </div>
</div>

<script type="text/javascript">
  var base_url        = url.protocol+'<?php echo str_replace("http:", "", base_url()); ?>';
  var controller_url  = base_url+'<?php echo $this->uri->segment(1); ?>';
</script>

<script type="text/javascript">
  $(document).ready(function(){
    load_tabel('<?php echo $service_name_aktif ?>');
  }) 

  <?php $this->load->view(basename(__DIR__).'/_script.js') ?>

</script>