<script type="text/javascript" src="<?= VIS_PATH_SCRIPT; ?>datatables/data-tables/DT_bootstrap.js"></script>
<? 
    global $vis_language;
     
    if($audit_log!=-1) { 
	 $operators=array(1=>$vis_language['TXTCLIENT'], 2=>$vis_language['TXTSTAFF'], 3=>$vis_language['TXTSTAFF']);
				 
	 
	?>
<table cellpadding="0" cellspacing="0" border="0" class="table table-hover b-t b-light m-b-none" id="datatable" style="top:100px;">

<thead class="table_head">
		
		<tr> 
		<th><? echo $vis_language['TXTSUMMARY']; ?></th> 
		<th><? echo  $vis_language['TXTTOTAL'].": ".$avgTimeCount =count_remain_time($total_time ); ?></th> 
		<th><? echo $vis_language['TXTCREATIONDATE'].":" .format_datetime($audit_log[0]['creation_date']);?></th> 
		<th><? echo $vis_language['TXTCLOSETICKETDATE'].":".format_datetime($audit_log[0]['closed_time']); ?></th>
  <th></th>
		
		 
		</tr>
		 
 			 <tr>
			<th><? echo $vis_language['TXTTICKETHASH']; ?></th>  
			<th><? echo $vis_language['TXTSUBJECT']; ?></th>
			<th><? echo $vis_language['TXTOPERATION']; ?></th>	
			<th><? echo $vis_language['TXTOPERATOR']; ?></th>
			<th><? echo $vis_language['TXTDEPARTMENT']; ?></th>
			 
 		
		</tr>	
</thead>		
          <?        
  
		 for($i=0;$i<count($audit_log);$i++) {
        echo '<tr><td class="txt_nowrap"> <a href="#/ticket/ticket_details/'.$audit_log[$i]['ticket_hash'].'/'.$audit_log[$i]['ticket_id'].'">'.$audit_log[$i]['ticket_hash'].'</a></td><td class="txt_nowrap">'.$audit_log[$i]['subject'].'</td> <td class="txt_nowrap">'.$audit_log[$i]['audit_log_operation'].'</td><td class="txt_nowrap">'.($audit_log[$i]['operator_id']==0?$vis_language['TXTSYSTEM']:($operators[$audit_log[$i]['operator']].' ('.$audit_log[$i]['operators'].')')).'</td><td class="txt_nowrap">'. $audit_log[$i]['department_name'].'</td></tr>';
    }?>  
		  
               
            </table>
        <script>
			$("#vis_export_rpt_<?= $operation['vis_operation'] ?>").show(); 
		    $("#vis_export_rpt_<?= $operation['vis_operation'] ?>").html('<a href="javascript:void(0);" class="vis_button_export btn btn-primary btn-sm" data-toggle="ajaxModal" data-modal-arguments="vis_module=report&vis_operation=add_report_inqueue&vis_static_area=vis_open_new_dialog&duration=<? echo $data['duration']; ?>&from_date=<? echo strtotime($data['from_date']); ?>&to_date=<? echo strtotime($data['to_date']);?>&domain_id=<? echo $data['domain_id'];?>&staff_id=<? echo $data['staff_id'];?>&vis_criteria=<? $data['vis_criteria'];?>&vis_new_ticket_list_client1=<? echo $data['vis_new_ticket_list_client1'];?>&report_type=63" onclick="" type="button"><? echo $vis_language['TXTEXPORT']; ?></a>'); 
		    
		    $("#vis_schedule_rpt_<?= $operation['vis_operation'] ?>").show(); 
		    $("#vis_schedule_rpt_<?= $operation['vis_operation'] ?>").html('<a href="javascript:void(0);" class="vis_button_export btn btn-primary btn-sm" data-toggle="ajaxModal" data-modal-arguments="vis_module=report&vis_operation=add_schedule_report_inqueue&vis_static_area=vis_open_new_dialog&duration=<? echo $data['duration']; ?>&from_date=<? echo strtotime($data['from_date']); ?>&to_date=<? echo strtotime($data['to_date']);?>&domain_id=<? echo $data['domain_id'];?>&staff_id=<? echo $data['staff_id'];?>&vis_criteria=<? $data['vis_criteria'];?>&vis_new_ticket_list_client1=<? echo $data['vis_new_ticket_list_client1'];?>&report_type=63" onclick="" type="button"><? echo $vis_language['TXTSCHEDULE']; ?></a>'); 
		</script> <?
    }
    else  {
	$operation['no_record']=1;
       include(VIS_PATH_TEMPLATE.'no_record_yet.php');
        ?>
             <script> $("#vis_export_rpt_<?= $operation['vis_operation'] ?>").hide();</script>          
        <?php
    } ?>
	
<script>
$(document).ready(function() {	
$('#datatable').dataTable({		
       "bPaginate" : true,
       "aaSorting":  [],
       "iDisplayLength": <?php echo SECURITY_DATA_PER_PAGE;?>,		
	   "sDom": '<"top"iflp<"clear">>rt<"bottom"iflp<"clear">>', 		
	   "bFilter" : false,
	   "bLengthChange": false,
	   "bInfo": false,
	   "aoColumns": [
			{ "bSortable": true },
			{ "bSortable": true },	
		  	{ "bSortable": true },	
			{ "bSortable": true },	
		  	{ "bSortable": true }
		]
	});
	
});	
</script>
