<? global $vis_language;?>    
<table class="table table-hover b-t b-light m-b-none m-t" data-ride="datatables">
	<thead class="table_head">
		<tr>         
			<th><? echo $vis_language['TXTLINK']; ?></th>
			<th><? echo $vis_language['TXTTICKETHASH']; ?></th>
			<th><? echo $vis_language['TXTSUBJECT']; ?></th>
			<th><? echo $vis_language['TXTDEPARTMENT']; ?></th>
			<th><? echo $vis_language['TXTSTATUS']; ?></th>
			<th></th>
		</tr>
	</thead>
	<tbody>
     <?
	 $link_type_arr = array( 1 => $vis_language['TXTRELATESTO']
							, 2 => $vis_language['TXTISRELATEDTO']
							, 3 => $vis_language['TXTISAPARENTOF']
							, 4 => $vis_language['TXTISACHILDOF']
							, 5 => $vis_language['TXTDEPENDSON']
							, 6 => $vis_language['TXTISDEPENDEDON']
							, 7 => $vis_language['TXTDUPLICATES']
							, 8 => $vis_language['TXTISADUPLICATEDBY']
							);
		$link_type_oppose_arr = array( 1 => $vis_language['TXTISRELATEDTO']
									, 2 => $vis_language['TXTRELATESTO']
									, 3 => $vis_language['TXTISACHILDOF']
									, 4 => $vis_language['TXTISAPARENTOF']
									, 5 => $vis_language['TXTISDEPENDEDON']
									, 6 => $vis_language['TXTDEPENDSON']
									, 7 => $vis_language['TXTISADUPLICATEDBY']
									, 8 => $vis_language['TXTDUPLICATES']
									);
    for($i=0; $i<count($link_details); $i++) {
		
		$link_type= ($operation['vis_ticket_id']==$link_details[$i]['parent_ticket_id']) ? $link_type_arr[$link_details[$i]['link_type']] : $link_type_oppose_arr[$link_details[$i]['link_type']]; 	
		
        echo '<tr><td><i class="vh vh-link-2"></i> '.$link_type.'</td><td><a href="#/ticket/ticket_details/'.$link_details[$i]['ticket_hash'].'/'.$link_details[$i]['ticket_id'].'" class="link">'.$link_details[$i]['ticket_hash'].'</a></td><td>'.$link_details[$i]['subject'].'</td><td>'.$link_details[$i]['department_name'].'</td><td>'.$link_details[$i]['status'].'</td><td>';?>
        <a class="link"  href="javascript:void(0);"  data-toggle="ajaxModal" data-modal-arguments="vis_module=ticket&vis_operation=confirm_delete_link&vis_ticket_id=<?= $operation['vis_ticket_id'];?>&vis_del_id=<?= $link_details[$i]['ticket_id'];?>&vis_link_id=<?= $link_details[$i]['link_id'];?>&vis_del_type=<?=$link_details[$i]['del_type']?>" title="<? echo $vis_language['TXTUNLINK']; ?>"><? echo $vis_language['TXTUNLINK']; ?></a>
        <? echo '</td></tr>';
    } ?>
   </tbody>
</table>
<script type="text/javascript">
   $(document).ready(function() {	
   $('[data-ride="datatables"]').dataTable({		
           "bPaginate" : false,	
   		"sDom": 't', "bAutoWidth": false,
   		"aoColumns": [
   		  	null,
   		  	null,
   		  	null,
   		  	null,
   		  	null,
   		  	{ "bSortable": false }
   		]
   	});
   });
</script>