<script type="text/javascript" src="<?= VIS_PATH_SCRIPT; ?>datatables/data-tables/DT_bootstrap.js"></script>
<? 
 
    global $vis_language;
    $start=0;
    if($staff_info!=-1 ) { ?>
			<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['TXTTOTAL']." ".$vis_language['TXTPOINTS']." " ; echo $details['staff_point']; ?>   </th>
		<?  if($details ['quest_type'] == 1) {?>
		<th> <? echo $vis_language['TXTRESOLVINGTYPE']." "; echo $totalticket1 ;?> </th>  <? }elseif($details ['quest_type'] == 2){?>
		<th> <? echo $vis_language['TXTSELFHELFARTICLE']." ";  echo $quest_details['count_article'];  ?></th>  <? }?> 
			 
			<!--<th></th><th></th><th></th> <th></th><th></th><th></th><th></th><th></th>-->				
			</tr>  
			</thead> 
			 <?        
			 	echo '<thead class="table_head">					
						<tr>
							    
							 <th>'.$vis_language['TXTQUESTTYPE'].'</th>	
							 
							 <th>'.$vis_language['TXTTOTAL'].'</th>
							 <th>'.$vis_language['TXTPOINTS'].'</th>
							 <th>'.$vis_language['TXTRATING'].'</th> 
							 <th></th>
							 <th></th>
							 <th></th>
							 <th></th>
							 <th></th>
							    <th></th>
						</tr>
					 </thead>';  
		 	    if($staff_info!=-1) foreach($staff_info as $ticket_id => $details)  
				{
					 
					
					 
				echo '<tr> ';
					
					if($details ['quest_type'] == 1)$quest_type = $vis_language['TXTRESOLVINGTYPE']; 
					elseif($details ['quest_type'] == 2)$quest_type = $vis_language['TXTSELFHELFARTICLE'];
				echo '<td>   '.$quest_type.'</td> '; 
					 						
				 	if($details ['quest_type'] == 1)
					{
						echo '<td> '.$count_ticket.' </td>';
						echo '<td> '.$total_ticket.' </td> ';
						echo '<td>'.$ticket_rating.'</td>'; 
						echo '<td></td>';
						echo '<td></td>';						
					}		
					if($details ['quest_type'] == 2)
					{
						echo '<td> '.$artical.' </td>';
						echo '<td> '.$total_article.' </td>';
						echo '<td>'.$article_rating.'</td>';						
						echo '<td></td>';
						echo '<td></td>';
					}
					 
					 
					echo '<td></td>';
					echo '<td></td>';
					echo '<td></td>';
					echo '<td></td>';
					echo'</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']);?>&staff_id=<? echo $data['staff_id'];?>&quest_id=<? echo $data['quest_id'];?>&department_id=<? echo $data['department_id'];?>&vis_status_id=<?echo $data['status_id']; ?>&vis_client_id=<? echo $data['vis_client_id'];?>&vis_criteria=<? $data['vis_criteria'];?>&report_type=33" 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']);?>&staff_id=<? echo $data['staff_id'];?>&quest_id=<? echo $data['quest_id'];?>&department_id=<? echo $data['department_id'];?>&vis_status_id=<?echo $data['status_id']; ?>&vis_client_id=<? echo $data['vis_client_id'];?>&vis_criteria=<? $data['vis_criteria'];?>&report_type=33" onclick="" type="button"><? echo $vis_language['TXTSCHEDULE']; ?></a>'); 
		 </script> <?
    }
    else  {
	$operation['no_record']=1;
       include(VIS_PATH_TEMPLATE.'no_record_yet.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 },
			{ "bSortable": true },
			{ "bSortable": true },
			{ "bSortable": true },
			{ "bSortable": true },
		  	{ "bSortable": true }
		]
	});
	
});	

</script>
