<script type="text/javascript" src="<?= VIS_PATH_SCRIPT; ?>datatables/data-tables/DT_bootstrap.js"></script>
<? 
    global $vis_language;
    $start=0;
    $operations=array(0=>$vis_language['MSGNEWTKTCRT'], 1=>$vis_language['MSGTKTRPLD'], 2=>$vis_language['MSGSTSUPD'], 3=>$vis_language['MSGPRIOUPD'], 4=>$vis_language['MSGDEPTCHNG'], 5=>$vis_language['MSGTKTTYPCHG'], 6=>$vis_language['MSGFLGCHG'], 7=>$vis_language['MSGTKTASSIG'], 8=>$vis_language['TXTTKTUPDATE'], 9=>$vis_language['MSGTKTMRGD'], 10=>$vis_language['MSGTKTMRGD'], 11=>$vis_language['MSGTKTFRWD'], 12=>$vis_language['MSGTKTDELETED'], 13=>$vis_language['MSGSLACHG'], 14=>$vis_language['MSGSPAMMRK'], 15=>$vis_language['MSGUNSPAM'],16=>$vis_language['MSGTASKLINKED'],18=>$vis_language['MSGCILINKED'],20=>$vis_language['MSGPROBLEMLINKED'],22=>$vis_language['MSGCHANGESLINKED'],24=>$vis_language['MSGTICKETLINKED'],25=>$vis_language['MSGTICKETPOSTDELETE'], 26=>$vis_language['MSGTICKETSPLIT'], 44=>$vis_language['MSGNEWSCHEDULETKTCRT'], 45=>$vis_language['MSGTICKETLEVELCHANGED'], 46=>$vis_language['MSGTICKETCATEGORYCHANGED'], 47=>$vis_language['MSGTICKETSUBCATEGORYCHANGED'], 48=>$vis_language['MSGTICKETITEMCHANGED'], 49=>$vis_language['MSGITILLOCATIONCHANGED']);
    if($report!=-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 style="cursor:none;">
			<th><? echo $vis_language['TXTSUMMARY']; ?> </th> 
			 <th> <? echo $vis_language['TXTTOTALTICKET'];   echo ': '.$counts['total']; ?></th>
			<th> <?  echo $vis_language['TXTTOTALOPEN']; echo ': '.$counts['closetotal']; ?>   </th>
			<th>   <?  echo $vis_language['TXTTOTALCLOSE'] ; echo ': '.$counts['opentotal']; ?></th>
			<th>   <? echo $vis_language['TXTTOTALPROGRESS'] ; echo ': '.$counts['awaiting']; ?></th>
			 
			    
			</tr> 
 			 <tr>
			<th><? echo $vis_language['TXTDEPARTMENTNAME']; ?></th>
			<th><? echo $vis_language['TXTTOTAL']; ?></th>
			<th><? echo $vis_language['TXTOPEN']; ?></th>
			<th><? echo $vis_language['TXTCLOSE']; ?></th>
			<th><? echo $vis_language['TXTPROINPROGRESS']; ?></th>
			
			 
			 											
		</tr>	
</thead>		
          <?         foreach($report as $row) {
			  
			  echo '<tr> <td class="txt_nowrap">';
            echo $row['department_name'];
            echo "</td> ";
			   
            echo ' <td class="txt_nowrap">'.$row['total'].'</td><td class="txt_nowrap">';
			 
            echo $row['openicket'];
            echo '</td><td class="txt_nowrap">';
            echo $row['closeticket'];
			
            echo "</td>"; 
			echo ' <td class="txt_nowrap">';
            echo $row['waitticket'];
            echo "</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'];?>&vis_criteria=<? $data['vis_criteria'];?>&report_type=23" 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'];?>&vis_criteria=<? $data['vis_criteria'];?>&report_type=23" onclick="" type="button"><? echo $vis_language['TXTSCHEDULE']; ?></a>'); 
		</script> <?
    }
    else  {
	$operation['no_record']=1;
       include(VIS_PATH_TEMPLATE.'no_record_yet.php');
        ?>	<script> $("#vis_schedule_rpt_<?= $operation['vis_operation'] ?>").hide();</script>
             <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>
