<? global $vis_language;

         if($ticket_details==-1){ ?>
			<? include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
			 echo '<script> $("#view_action").hide(); $("#vis_ticket_form .panel-footer").hide(); $("#vis_ticket_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
		 }else {
?>
 <script type="application/javascript"> $("#view_action").show(); $("#vis_ticket_form .panel-footer").show(); $("#vis_ticket_list").show(); </script>

<table class="table table-hover m-b-none" data-ride="datatables">
    <thead class="table_head">
      <tr>
      		<th></th>
        <th><? echo $vis_language['TXTTICKETHASH'];?></th>
        <th><? echo $vis_language['TXTSUBJECT'];?></th>
        <th><? echo $vis_language['TXTEMAIL'];?></th>
        <th><? echo $vis_language['TXTDEPARTMENT'];?></th>
        <th><? echo $vis_language['TXTPRIORITY'];?></th>
        <th><? echo $vis_language['TXTSTATUS'];?></th>
        <th><? echo $vis_language['TXTCREATIONDATE'];?></th>
       </tr>
    </thead>
    <tbody>			
    
    <? for($i=0; $i<count($ticket_details); $i++){ ?>
    <tr>
    <td class="p-l-none" align="center">
    <?
				 if($ticket_details[$i]['channel_id']<=19 && strstr($ticket_details[$i]['icon_path'], "vh vh-")) {
  echo ($ticket_details[$i]['ticket_lock'] != -1 && !empty($ticket_details[$i]['ticket_lock'])) ? '<i class="vh vh-lock vh-lg vis_fl"></i>' : '<i class="'.$ticket_details[$i]['icon_path'].' vh-lg"></i>';
				}else
				{
					if(file_exists(VIS_PATH_PROFILE.$ticket_details[$i]['icon_path']))
						echo '<img src="'.VIS_PATH_PROFILE.$ticket_details[$i]['icon_path'].'" class="thumb-xxs">';
					else
						echo '<i class="vh vh-channel vh-lg"></i>';
				}
				?>
    </td>
    <td><a href="#/ticket/ticket_details/<?=$ticket_details[$i]['ticket_hash']?>/<?=$ticket_details[$i]['ticket_id']?>"><? echo $ticket_details[$i]['ticket_hash'];?></a></td>
    <td><a href="#/ticket/ticket_details/<?=$ticket_details[$i]['ticket_hash']?>/<?=$ticket_details[$i]['ticket_id']?>"><? echo $ticket_details[$i]['subject'];?></a></td>
    <td><a href="#/ticket/ticket_details/<?=$ticket_details[$i]['ticket_hash']?>/<?=$ticket_details[$i]['ticket_id']?>"><? echo $ticket_details[$i]['email'];?></a></td>
    <td><a href="#/ticket/ticket_details/<?=$ticket_details[$i]['ticket_hash']?>/<?=$ticket_details[$i]['ticket_id']?>"><? echo $ticket_details[$i]['department_name'];?></a></td>
    <td><a href="#/ticket/ticket_details/<?=$ticket_details[$i]['ticket_hash']?>/<?=$ticket_details[$i]['ticket_id']?>"><? echo $ticket_details[$i]['ticket_priority'];?></a></td>
    <td><a href="#/ticket/ticket_details/<?=$ticket_details[$i]['ticket_hash']?>/<?=$ticket_details[$i]['ticket_id']?>"><? echo $ticket_details[$i]['ticket_status'];?></a></td>
    <td><a href="#/ticket/ticket_details/<?=$ticket_details[$i]['ticket_hash']?>/<?=$ticket_details[$i]['ticket_id']?>"><? echo format_datetime($ticket_details[$i]['receive_date']);?></a></td>
    
    </tr>  
       
			<? }?>
    </tbody>
</table>


<? 
    }?>


<script type="text/javascript">
    $(document).ready(function() {	
				
    	   $('[data-ride="datatables"]').dataTable({
    		"bAutoWidth": false,
            "bPaginate" : false,
												"bDeferRender": true,
    		"sDom": 't', 
    		"aoColumns": [
				{ "bSortable": false },
null,null,null,null,null,null,null    		]
    	});
    });
</script>
