<? global $vis_language; 
//$paging_list='';
  // for($i=0;$i<$view_info['page_count'];$i++) $paging_list.='<option value="'.$i.'" '.(($relation_info['page']==$i)?'selected="selected"':'').'>'.($i+1).'</option>'; ?>
<!--<div id="relationships" class="tab-pane active">
<div class="wrapper">
 <form name="vis_<?php echo $operation['vis_operation']; ?>_form" id="vis_<?php echo $operation['vis_operation']; ?>_form">
 <div class="col-md-10">
      <div class="row">-->
 <?php /*if($attach_relation_details==-1){   
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 	
 } else { ?>
   <div class="col-md-10">
      <?  for($i=0;$i<count($attach_relation_details);$i++){
		     if($operation['vis_assets_id']==$attach_relation_details[$i]['rel_assets_id']){
				 $relation_type = $attach_relation_details[$i]['forward'];
				 $assets_id = $attach_relation_details[$i]['inverse_assets_id'];
			 }else{	 
			 	 $relation_type = $attach_relation_details[$i]['inverse'];
				 $assets_id = $attach_relation_details[$i]['rel_assets_id'];
			 }
			// echo $attach_relation_details[$i]['org_assets_id'];		 	 
			 $attach_assets=$cmdb->get_cmdb_relations_assets('assets_id='.$assets_id,'',VIS_STAFF_ID, VIS_LOCATION_AREA);
			 echo '<div class="col-md-2 m-t">'.ucfirst($relation_type).'</div>';
             echo '<div class="col-md-3 m-t"><a href="#/cmdb/cmdb_assets_details/'.$attach_assets[0]['name'].'/'.$assets_id.'" class="link">'.ucfirst($attach_assets[0]['name']).'<a></div>';
		     ?>
      <div class="col-md-7 m-t"><a class="text-muted link"  href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=cmdb&vis_operation=get_cmdb_relationship_delete&vis_relation_id=<? echo $attach_relation_details[$i]['relation_id'];?>&vis_assets_id=<? echo $operation['vis_assets_id']; ?>&vis_attach_id=<? echo $assets_id; ?>&vis_static_area=vis_cmdb_relationship_delete_form" title="<? echo $vis_language['TXTDELETE']; ?>"><? echo $vis_language['TXTITILDETACH']; ?></a><? //} ?>
      </div>
      <?
         } ?>
   </div>
<? }*/ ?>
       <!-- </div>
      </div>-->
      <!--<div class="row wrapper clr" id="view_action">
            <div  class="col-md-6 text-right text-center-xs" id="paging">
               <select name="pageing" id="paging" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="$(this).parents('#vis_workpanel_div').visExecution('load_area',{'vis_module':'<?php echo $operation['vis_current_module']; ?>', 'vis_operation':'<?php echo $operation['vis_current_operation']; ?>', 'vis_page':this.value})">
               <? echo $paging_list;?>
               </select>
               <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE']; ?>:</div>
            </div>
      </div>-->
  <!-- </form>
    </div>
 </div>   -->
      
 <script type="text/javascript">
  /* $(document).ready(function() {	
   $('[data-ride="datatables"]').dataTable({		
           "bPaginate" : false,	
   		"sDom": 't', "bAutoWidth": false,
   		"aoColumns": [
   		  	null,
   		  	null,
   		  	null,
			null,
			{ "bSortable": false }
   		]
   	});
   });*/
</script>
<?  global $vis_language;?>
<div class="col-md-12">
<div class="row m-b-sm">
<? if($attach_relation_details != -1){?>	
	<ul class="list-group no-radius m-b-none m-t-n-xxs list-group-lg no-border">
	<?  for($i=0;$i<count($attach_relation_details);$i++){
		     if($operation['vis_assets_id']==$attach_relation_details[$i]['rel_assets_id']){
				 $relation_type = $attach_relation_details[$i]['forward'];
				 $assets_id = $attach_relation_details[$i]['inverse_assets_id'];
			 }else{	 
			 	 $relation_type = $attach_relation_details[$i]['inverse'];
				 $assets_id = $attach_relation_details[$i]['rel_assets_id'];
			 }
			  $attach_assets=$cmdb->get_cmdb_relations_assets('assets_id='.$assets_id,'',VIS_STAFF_ID, VIS_LOCATION_AREA);
	?>
			<li class="list-group-item">
			 <div class="clear">
             <a class="text-muted link pull-right"  href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=cmdb&vis_operation=get_cmdb_relationship_delete&vis_relation_id=<? echo $attach_relation_details[$i]['relation_id'];?>&vis_assets_id=<? echo $operation['vis_assets_id']; ?>&vis_attach_id=<? echo $assets_id; ?>&vis_static_area=vis_cmdb_relationship_delete_form" title="<? echo $vis_language['TXTDELETE']; ?>"><? echo $vis_language['TXTITILDETACH']; ?></a>
              <div class="block"><? echo ucfirst($relation_type); ?></div>
              <div class="pull-left m-r-lg"> <a href="#/cmdb/cmdb_assets_details/<?= $attach_assets[0]['name']?>/<?= $assets_id?>" class="link"><?= ucfirst($attach_assets[0]['name'])?><a></div>
             </div>
		    </li>
	<? } ?>
	</ul>
<? }else{ ?>
<? include(VIS_PATH_TEMPLATE.'no_record_yet.php'); ?>
<? } ?>
</div>
</div>
