<div class="row">
      <div class="col-sm-12">
      <section id="test" class="scrollable wrapper">
      <div class="row m-b">
      <div class="col-md-12">
      <form method="post" role="form" class="form-horizontal" name="vis_relationships_form" id="vis_relationships_form">
      <div class="form-group">
         <div class="col-sm-6">
         <select data-container="body" data-size="auto" class="form-control selectpicker" name="vis_configuration_item" id="vis_configuration_item" <? if(count($confi_item_details) > 10) echo 'data-live-search="true"' ?>>
              <option value="0"><?=$vis_language['TXTITILSELECTCITYPE']?></option>
              <?php for($p=0;$p<count($confi_item_details);$p++){ 
                  echo '<option value="'.$confi_item_details[$p]['item_id'].'">'.$confi_item_details[$p]['name'].'</option>';
              }?>
            </select>
         </div>
         <div class="col-sm-6">
         <input type="text" id="search_language_variables" onkeyup="vis_apply_filter(this.value);" placeholder="Search CI item..." class="form-control">
         </div>
         <div class="col-sm-3"></div>
      </div>
      <div class="form-group" id="vis_show_amt_balance">
          <div class="col-sm-12">
              <div id="configuration_item">
                  <div style="text-align:center;"><?= $vis_language['TXTITILSELECTCITYPEORITEM'];?></div>
              </div>                        
          </div>
      </div>
      <input type="hidden" name="vis_assets_id" id="vis_assets_id" value="<?= $operation['vis_assets_id'];?>">
       <input type="hidden" name="vis_relation_id" id="vis_relation_id" value="<?= $operation['vis_relation_id'];?>">
       <input type="hidden" name="vis_relation_type" id="vis_relation_type" value="<?= $operation['vis_relation_type'];?>">
	   
    </form>
    </div>
    </div>
    </section>
    
    </div>
  </div>
  <script type="application/javascript">
  $("#vis_configuration_item").change(function () {
	var filter = $("#search_language_variables").val();
	if(this.value=='0' && filter==''){
		$("#configuration_item").html('<div style="text-align:center;"><?= $vis_language['TXTITILSELECTCITYPEORITEM'];?></div>');
	}
	if(this.value!='0'){
	var data = {'vis_configuration_id':this.value, 'attached_id':'<?= $attached_id;?>','vis_department':'<?= $assets_details['department_access'];?>','vis_assets_id':'<?= $operation['vis_assets_id'];?>'};   
	$.ajax({
		url: 'index.php?vis_module=cmdb&vis_operation=change_cofiguration',
		data: data,
		type: "POST",
		dataType: "json",
		success: function(data) {
			$("#configuration_item").html(data.list);
		},
		error: function(xhr, ajaxOptions, thrownError) {$("#vis_global_msg_div").visInterface("load_global_message", "Error: "+xhr.status+" - "+thrownError);}
	});
	}
});
function vis_apply_filter(){
	
	var filter = $("#search_language_variables").val();
	var config_item = $("#vis_configuration_item").val();
	//alert(filter);
	var data = {'vis_filter_enable':'1', 'vis_filter':''+filter+'', 'attached_id':'<?= $attached_id;?>', 'vis_department':'<?= $assets_details['department_access'];?>','vis_assets_id':$("#vis_assets_id").val()};
	//alert(filter);
	if(filter=='' && config_item=='0'){
		$("#configuration_item").html('<div style="text-align:center;"><?= $vis_language['TXTITILSELECTCITYPEORITEM'];?></div>');
	}
	if(filter!=''){
		var len = filter.length;
		if(len>2){
		$.ajax({
			url: 'index.php?vis_module=cmdb&vis_operation=change_cofiguration',
			data: data,
			type: "POST",
			dataType: "json",
			success: function(data){
				//alert(data);
				$("#configuration_item").html(data.list);
				
			},
			error: function(xhr, ajaxOptions, thrownError) {$("#vis_global_msg_div").visInterface("load_global_message", "Error: "+xhr.status+" - "+thrownError);}
		}); 
		}else{
			  $("#configuration_item").html('<div style="text-align:center;"><?= $vis_language['TXTGLOBALSEARCHERROR'];?></div>');
		} 
	}else{
		$("#configuration_item").html('<div style="text-align:center;"><?= $vis_language['TXTITILSELECTCITYPEORITEM'];?></div>');
	}
	
}
  </script>