 
<script type="text/javascript" src="<?= VIS_PATH_SCRIPT; ?>datatables/data-tables/DT_bootstrap.js"></script>
<script>
$(".selectpicker").selectpicker();
</script>

<? if(isset($operation['vis_tab']) && $operation['vis_tab']!=1 && $operation['vis_tab']!=6){ ?>
<!-- Sparkline Chart -->
<script src="<?= VIS_PATH_SCRIPT; ?>charts/sparkline/jquery.sparkline.min.js"></script>
<? }?>

<? global $vis_language; ?>
<div class="wrapper-sm b-b">
<div class="row">
<div class="col-sm-10">
     <?if($operation['vis_tab']!=7){?>
	<h5 class="m-t-none pull-left m-r">
 <!--<option value="0"><? //echo $vis_language['TXTSELDOM']; ?></option>-->
		   <div class="text-muted pull-center label_page"><? echo $vis_language['TXTDOMAIN'].":"; ?>
			 <select  name="domain_id" class="selectpicker domain_id " <? if(count($domain) > 10) echo 'data-live-search="true"' ?>>
				 
				 <?php if($domain!=-1) for($i=0;$i<count($domain);$i++) if($data['domain_id']==$domain[$i]['domain_id']){ echo '<option value="'.$domain[$i]['domain_id'].'" selected>'.$domain[$i]['domain_name'].'</option>'; }else{echo '<option value="'.$domain[$i]['domain_id'].'">'.$domain[$i]['domain_name'].'</option>';} ?>
			 </select>
    </div>
	</h5>
	<h5 class="m-t-none pull-left m-r">
	  <div class="text-muted pull-center label_page"><? echo $vis_language['TXTDURATION'].":"; ?>
	  <button data-toggle="dropdown" class="btn btn-sm btn-default dropdown-toggle" id="criteria" >
		<span class="dropdown-label"><?
		 if(isset($data['criteria']) && $data['criteria']==1){
		 echo $vis_language['TXTLAST30DAYS'];
		}elseif(isset($data['criteria']) && $data['criteria']==2){
			echo $vis_language['TXTLAST7DAYS'];
		}elseif(isset($data['criteria']) && $data['criteria']==3){
			echo $vis_language['TXTLAST24HOURS'];
		}elseif(isset($data['criteria']) && $data['criteria']==4){
			echo $vis_language['TXTCUSTOM'];
		}?></span>
		<span class="caret"></span>
	  </button>
	  <ul class="dropdown-menu dropdown-select" >
		   <li <? if(isset($data['criteria']) && $data['criteria']==1){ echo 'class="active"';}?> ><a href="javascript:void(0)" onclick="setCriteria(1); showData(1)"><input type="radio" name="b"><? echo $vis_language['TXTLAST30DAYS']; ?></a></li>
		  <li <? if(isset($data['criteria']) && $data['criteria']==2){ echo 'class="active"';}?> ><a href="javascript:void(0)" onclick="setCriteria(2); showData(2)"><input type="radio" name="b"><? echo $vis_language['TXTLAST7DAYS']; ?></a></li>
		  <li <? if(isset($data['criteria']) && $data['criteria']==3){ echo 'class="active"';}?> ><a href="javascript:void(0)" onclick="setCriteria(3); showData(3)"><input type="radio" name="b"><? echo $vis_language['TXTLAST24HOURS']; ?></a></li>
    <li <? if(isset($data['criteria']) && $data['criteria']==4){ echo 'class="active"';}?> ><a href="javascript:void(0)" onclick="setCriteria(4); showData(4)"><input type="radio" name="b"><? echo $vis_language['TXTCUSTOM']; ?></a></li>
	  </ul>
	</div>
 </h5>
 <?
 	if($data['criteria']==4){
		$style = '';
	}else{
		$style = ' style="display:none;"';
	}
 ?>	
 <h5 id="divid" class="m-t-none pull-left m-r"<? echo $style;?>>
                      <span class=""><? echo $vis_language['TXTFROM']; ?>:</span>
                      <span class="from_date"> <input type="text" name="from_date" id="vis_<?= $operation['vis_operation'] ?>_from_date" value="<?= date(VIS_EDITDATETIMEPICKER_FORMAT,strtotime(date('Y-m-d H:i')." -3 months") + VIS_TIMEZONE);?>" class="input-sm form-control reporttxtb" /></span>
                  </h5>
  <h5 id="divid1" class="m-t-none pull-left m-r"<? echo $style;?>>
                     <span class=""><? echo $vis_language['TXTTO']; ?>:</span>
                      <span class="to_date"> <input type="text" name="to_date" id="vis_<?= $operation['vis_operation'] ?>_to_date" value="<? echo date(VIS_EDITDATETIMEPICKER_FORMAT,strtotime(date('Y-m-d H:i')) + VIS_TIMEZONE);?>" class="input-sm form-control reporttxtb" /></span>
                  </h5>
					  
<?} else{?>	
       <?  if (isset($operation['vis_action']) && $operation['vis_action'] != '') {
            $data = parse_form_array($operation['vis_action']);
        } ?>
  <h5 class="m-t-none pull-left m-r">
	<div class="text-muted pull-center label_page"><? echo $vis_language['TXTDEPARTMENT'].":"; ?>
	  <select name="department_id" class="selectpicker department_id" id="department_id"  <? if(count($departments) > 10) echo 'data-live-search="true"' ?>>
	 <option value="0"  ><? echo $vis_language['TXTALLDEPARTMENTS']; ?></option>
				  <?php if($departments!=-1) for($i=0;$i<count($departments);$i++) {
					$select=($departments[$i]['department_id']==$data['department_id'])? 'selected="selected"':'';
					 echo '<option value="'.$departments[$i]['department_id'].'"'.$select.'>'.$departments[$i]['domain_name'].' :'.$departments[$i]['department_name'].'</option>';} ?>
                  </select>
				  </div>
   </h5> 
   
<?}?>
	<input type="hidden" name="criteria" value="<? echo $data['criteria'];?>" id="vis_criteria">
  <input type="hidden" name="domain_id" value="<? echo $data['domain_id'];?>" id="vis_domain">
  	<input type="hidden" name="department_id" value="<? echo $data['department_id'];?>" id="department_id">
	<input type="hidden" name="vis_range" value="<? echo $data['vis_range'];?>" id="vis_range">
	
	
     
</div>
<?if($operation['vis_tab']!=7){?>
	<div class="col-sm-2 pull-right"><a class="btn btn-primary btn-sm" onclick="$('#tickets_overview_div').visExecution('load_operations', {'vis_module':'report', 'vis_operation':'report_list', 'show_report': '1','vis_form':'vis_tickets_overview_report_frm' <? if(isset($operation['vis_tab'])){?>,'vis_tab':'<? echo $operation['vis_tab'];?>'<? }?>});"><?= $vis_language['TXTGENERATE'] ?></a></div>
	 <?}else{?> 
	  
	  <div class="col-sm-1 pull-right"><a type="button" onclick="" data-modal-arguments="vis_module=report&vis_operation=add_report_inqueue&vis_static_area=vis_open_new_dialog&department_id=<? echo $data['department_id'];?>&vis_criteria=&report_type=79" data-toggle="ajaxModal" class="vis_button_export btn btn-primary btn-sm" href="javascript:void(0);"><?echo $vis_language['TXTEXPORT'];?></a></div> 
	  
	 <div class="col-sm-1 pull-right"><a class="btn btn-primary btn-sm" onclick="$('#tickets_overview_div').visExecution('load_operations', {'vis_module':'report', 'vis_operation':'report_list', 'show_report': '1','vis_form':'vis_tickets_overview_report_frm' <? if(isset($operation['vis_tab'])){?>,'vis_tab':'<? echo $operation['vis_tab'];?>'<? }?>});"><?= $vis_language['TXTSHOW'] ?></a></div>
	 
	 
	 <?}?>
</div>
</div>	


<? if(isset($operation['vis_tab']) && $operation['vis_tab']==1){ ?>
<!--ticket overvew-->
<div class="m-t" >
					<div class="panel-body text-center">
					  <div class="list-group no-radius no-border text-xs text-left">
         <div class="rnd text-center" id="billing_quickview">
            <ul class="lg">
			    <li>
				    <h4><? echo $report['totalTicks']; ?></h4>
					<p><? echo $vis_language['TXTTOTALTICKETS']; ?></p>
				</li>
				<li>
					<h4><? echo $report['avgTicksHour']; ?></h4>
                    <p><? echo $vis_language['TXTTICKETSPERHOUR']; ?></p>
                </li>
			    <li>
					<h4><? echo $report['totalTicksReplied']; ?></h4>
					<p><? echo $vis_language['TXTTOTALTICKETSREPLIED']; ?></p>
				</li>
				<li>
					<h4><? echo $report['avgTicksReplHour']; ?></h4>
					<p><? echo $vis_language['TICKETSREPLEDPERHOUR']; ?></p>
                </li>
                <li>
				    <h4><? echo $report['totalTicksClosed']; ?></h4>
					<p><? echo $vis_language['TXTTOTALTICKETSCLOSED']; ?></p>
				</li>
				<li>
				  <h4><? echo $report['avgTicksClosedHour']; ?></h4>
				  <p> <? echo $vis_language['TXTTICKETSCLOSEDPERHOUR']; ?></p>
                </li>
                <li>
				   <h4><? echo $report['totalOverdueTicks']; ?></h4>
					<p><? echo $vis_language['TXTOTALOVERDUETICKETS']; ?></p>
				 </li>
				<li>
					<h4>
						<?	
							/*if($total_sla_seconds > $sla_used){
								$avg_sla_response_time = round($total_time,2);
							}else{*/
								$avg_sla_response_time = round($total_time/$total_post,2);
							//}
                        	echo ($total_post==0?'0':count_remain_time($avg_sla_response_time)); 
						?>
                    </h4>
					<p><? echo $vis_language['TXTAVGRESPONSE']; ?></p>
                </li>
                <li>
					<? /*?><h4><? echo (($report_cnt==0)?0:round(((($responseCount+$resolutionCount)/count($report2))*100), 2)).'%' ?></h4><? */?>
                    <h4><? echo (($report_cnt==0)?0:round(((($responseCount)/$total_post)*100), 2)).'%' ?></h4>
					<p><? echo $vis_language['TXTAVGSLAMAINTAINED']; ?></p>
                </li>
			</ul>
         </div>
          
</div>
</div>
</div>
<!--ticket overvew-->
<? }elseif(isset($operation['vis_tab']) && $operation['vis_tab']==2){?>
<!--ticket by type-->
<div class="m-t" >
<div class="panel-body text-center">
		<div class="col-sm-6 portlet" id="reportTypes">
			  <section class="panel-info portlet-item ">
				<div class="panel-body text-center">
				  <div class="list-group no-radius no-border text-xs text-left pull-left" id="typesOps" style=" width:100%;">
      <div style="width:100%;" class="text-right vh-lg">Loading...<script>$('#typesOps').width('auto');</script></div>
				  <?
					$typeCount = $typeName = array();
					$total = 0;
					if($graphReport['ticket_types']!=-1)
					{
						if(is_array($graphReport['ticket_types']))
						{
							foreach($graphReport['ticket_types'] as $ticket)
							{
								$typeCount[] = $ticket['typeCnt'];
								$typeName[] = $ticket['ticket_type'];
							}
							$types = json_encode($typeCount);
							$typeNms = json_encode($typeName);
							$colors = $this->generateUniqueHexColors(count($typeCount)+5);
							$uniqueColorsChannels = json_encode(array_unique($colors));
							$opArea = "#typesOps";$chartArea = "#types_sparkline";
							echo "<script>display_pie_charts_data($types,$typeNms,$uniqueColorsChannels,'".$opArea."','".$chartArea."');</script>";
						}
					}
				?>
				   </div>
				  <div id="types_sparkline"> <? if($graphReport['channels'] ==-1) { echo $vis_language['TXTNOTHINGTODISPLAY']; } ?></div>
				</div>
				</section>
		</div>
  </div>
  </div>
<!--ticket by type-->
<? }elseif(isset($operation['vis_tab']) && $operation['vis_tab']==3){?>
  
<!--ticket by chanel-->
<div class="m-t" >
<div class="panel-body text-center">
		<div class="col-sm-6 portlet" id="reportChannels">
		  <section class="panel-info portlet-item">
			<div class="panel-body text-center">
			  <div class="list-group no-radius no-border text-xs text-left pull-left" id="channelOps" style=" width:100%;"> 
     <div style="width:100%;" class="text-right vh-lg">Loading...<script>$('#channelOps').width('auto');</script></div>
			  <?
				$channelCount = $channelName = $perCnt = array();
				$total = 0;
				if($graphReport['channels']!=-1)
				{
					if(is_array($graphReport['channels']))
					{
						foreach($graphReport['channels'] as $ticket)
						{
							$channelCount[] = $ticket['channelCnt'];
							$channelName[] = $ticket['channel_name'];
						}
						$channels = json_encode($channelCount);
						$channelNms = json_encode($channelName);
						$colors = $this->generateUniqueHexColors(count($channelCount)+5);
						$uniqueColorsChannels = json_encode(array_unique($colors));
						$opArea = "#channelOps";$chartArea = "#channels_sparkline";
						echo "<script>display_pie_charts_data($channels,$channelNms,$uniqueColorsChannels,'".$opArea."','".$chartArea."');</script>";
					}
				}
			?>
			   </div>
			  <div id="channels_sparkline"> <? if($graphReport['channels'] ==-1) { echo $vis_language['TXTNOTHINGTODISPLAY']; } ?></div>
			  </div>
		   </section>
		</div>
  </div>
  </div>
<!--ticket by chanel-->
<? }elseif(isset($operation['vis_tab']) && $operation['vis_tab']==4){?>  
<!--ticket by priority-->
<div class="m-t" >
<div class="panel-body text-center">
		<div class="col-sm-6 portlet" id="reportPriority">
		  <section class="panel-info portlet-item">
			<div class="panel-body text-center">
			  <div class="list-group no-radius no-border text-xs text-left pull-left" id="priorityOps" style=" width:100%;">
     <div style="width:100%;" class="text-right vh-lg">Loading...<script>$('#priorityOps').width('auto');</script></div>
			   <?
				$priorityCount = $perCnt = $priorityName = array();
				$total = 0;
				if($graphReport['priorities']!=-1)
				{

					if(is_array($graphReport['priorities']))
					{
						foreach($graphReport['priorities'] as $priority)
						{
							$priorityCount[] = $priority['priorityCnt'];
							$priorityName[] = $priority['ticket_priority'];
						}
						$priorities = json_encode($priorityCount);
						$priorityName = json_encode($priorityName);
						$colors = $this->generateUniqueHexColors(count($priorityCount)+5);
						$uniqueColorsPriority = json_encode(array_unique($colors));
						$opAreaPriority = "#priorityOps";$chartAreaPriority = ".priorities_sparkline";
						echo "<script>display_pie_charts_data($priorities,$priorityName,$uniqueColorsPriority,'".$opAreaPriority."','".$chartAreaPriority."');</script>";
					}
				}
			?>
			</div>
			<div class="priorities_sparkline"><? if($graphReport['priorities'] ==-1) { echo $vis_language['TXTNOTHINGTODISPLAY']; } ?></div>
			</div>
			</section>
			</div>
   </div>
   </div>
<!--ticket by priority-->
<? }elseif(isset($operation['vis_tab']) && $operation['vis_tab']==5){?>   
<!--ticket by status-->
<div class="m-t" >
<div class="panel-body text-center">
			<div class="col-sm-6 portlet" id="reportStatus">
			  <section class="panel-info portlet-item">
				<div class="panel-body text-center">
				  <div class="list-group no-radius no-border text-xs text-left pull-left" id="statusOps" style=" width:100%;">
      <div style="width:100%;" class="text-right vh-lg">Loading...<script>$('#statusOps').width('auto');</script></div>
				   <?
					$statusCount = $perCnt = $statusName = array();
					$total = 0;
					if($graphReport['tickStatus']!=-1)
					{

						if(is_array($graphReport['tickStatus']))
						{
							foreach($graphReport['tickStatus'] as $status)
							{
								$statusCount[] = $status['statusCnt'];
								$statusName[] = $status['status_name'];
							}
							$statusRecs = json_encode($statusCount);
							$statName = json_encode($statusName);
							$colors = $this->generateUniqueHexColors(count($statusCount)+5);
							$uniqueColorsPriority = json_encode(array_unique($colors));
							$opAreaPriority = "#statusOps";$chartAreaPriority = ".status_sparkline";
							echo "<script>display_pie_charts_data($statusRecs,$statName,$uniqueColorsPriority,'".$opAreaPriority."','".$chartAreaPriority."');</script>";
						}
					}
				?>
				</div>
				<div class="status_sparkline"><? if($graphReport['tickStatus'] ==-1) { echo $vis_language['TXTNOTHINGTODISPLAY']; } ?></div>
				</div>
				</section>
			</div>
   </div>
   </div>
<!--ticket by status-->
<? }elseif(isset($operation['vis_tab']) && $operation['vis_tab']==6){?>   

<div class="panel-body">
			
				<? if($report_details!=-1 && count($report_details)>0 ) {  ?>
  <table cellpadding="0" cellspacing="0" border="0" class="table table-hover b-t b-light m-b-none" id="datatable">
   <thead class="table_head">  
    <tr>
	    <th><? echo $vis_language['TXTSTAFFNAME']; ?></th>
		<th><? echo $vis_language['TXTSOLVEDTICKETS']; ?></th>
		<th><? echo $vis_language['AVGFIRSTREPLY']; ?></th>
		<th><? echo $vis_language['TXTAVGRESPONSETIME']; ?></th>
		<th><? echo $vis_language['TXTAVGSLATIME']; ?></th>
	</tr>
    </thead> 
	 
	 <?  
		foreach($report_details as $report)
		{ 
			echo '<tr> <td class="txt_nowrap">'.$report['staff_name'].'</td><td class="txt_nowrap">'.$report['total_ticket_count'].'</td><td class="txt_nowrap">'.$report['avgFirstresponse'].'</td><td class="txt_nowrap">'.$report['avgresponsetime'].' </td><td class="txt_nowrap">'.$report['avgresponsesla'];
			echo '</td></tr>';
    	}
	
	 ?>           
      </table>
			 
       
   <? } else { ?>
   <div class="status_sparkline"><? echo $vis_language['TXTNOTHINGTODISPLAY'];  ?></div>  <? } ?>
       
   </div>
   
<? }elseif(isset($operation['vis_tab']) && $operation['vis_tab']==7){?> 

  <div id="tickets_load_div">
 
  <div class="wrapper clear">
							<div class="row">
							  <div class="col-md-12 bg-white">
								<section class="panel btn-inactive portlet-item m-b-n">
								  <div class="row m-t-xs m-b-xs">
								  <div class="col-md-3 b-r">
									
								<span class="vh-over vh-over-2x pull-left m-r-sm">
									  <i class="vh-over-base vh vh-ticket"></i>
									  <i class="over vh-inverse vh vh-round md bottom"></i>
									  <i class="over new vh vh-round bottom"></i>
								  </span>
									<span class="clear">
									<span class="h3 block m-t-xs" id="totaltkt_cnt"><?echo $total_tickets;?></span>
										<small class="text-muted text-u-c"><? echo $vis_language['TXTTOTALTICKETS']; ?></small>
									  </span>
									
								  </div>
								  <div class="col-md-3 b-r">
									
								  <span class="vh-over vh-over-2x pull-left m-r-sm">
									  <i class="vh-over-base vh vh-ticket"></i>
									  <i class="over assigned vh vh-round md bottom"></i>
									  <i class="over vh-inverse vh vh-user bottom"></i>
								  </span>
									  <span class="clear">
										<span class="h3 block m-t-xs" id="assigned_cnt"><?if($temp_arr!=-1 && count($temp_arr)>0 ) { echo $total_assigned;} else {echo '0';} ?></span>
										<small class="text-muted text-u-c"><? echo $vis_language['TXTASSIGNEDTICKETS']; ?></small>
									  </span>
									
								  </div>
								  <div class="col-md-3 b-r">
									
								  <span class="vh-over vh-over-2x pull-left m-r-sm">
									  <i class="vh-over-base vh vh-ticket"></i>
									  <i class="over vh-red-color vh vh-round md bottom"></i>
									  <i class="over vh-inverse vh vh-user bottom"></i>
								  </span>
									  <span class="clear">
										<span class="h3 block m-t-xse" id="unassigned_cnt"><?echo $unassigned_cnt;?></span>
										<small class="text-muted text-u-c"><? echo $vis_language['TXTTOTALUNASSIGNED']; ?></small>
									  </span>
									
								  </div>
								  <div class="col-md-3">
									
							 <span class="vh-over vh-over-2x pull-left m-r-sm">
									  <i class="vh-over-base vh vh-ticket"></i>
									  <i class="over assigned vh vh-round md bottom"></i>
									  <i class="over vh-inverse vh vh-users bottom"></i>
								  </span>
									  <span class="clear">
										<span class="h3 block m-t-xs" id="multiassign_cnt"><?echo $mul_count;?></span>
										<small class="text-muted text-u-c"><? echo $vis_language['TXTTOTALMULASSIGNED']; ?></small>
									  </span>
									
								  </div>
								</div>
								</section>
							  </div>
							</div>
						  </div>

    <? 
   
    if($temp_arr!=-1 && count($temp_arr)>0 ) {
      
	 ?>
	   
		<div class="panel body">
<table cellpadding="0" cellspacing="0" border="0" class="table table-hover b-t b-light m-b-none" id="vis_more_details">
   <thead class="table_head">  
  
	<tr>
	    <th><? echo $vis_language['TXTSTAFFNAME']; ?></th>
		<th><? echo $vis_language['TXTTOTALASSIGNED']; ?></th>
	     <?for($i=0;$i<count($status_list);$i++)
		 {
		echo '<th>'.$status_list[$i]['status_name'].'</th>';
		 }
			 
		 ?>
	</tr>
    </thead> 
	 
	 <? 
		foreach($temp_arr as $report)
		{   
			echo '<tr> <td class="txt_nowrap">'.$report['first_name'].' '.$report['last_name'].'</td><td class="txt_nowrap">'.$report['assing_cnt'].'</td>';
			for($i=0;$i<count($status_list);$i++)
			{   echo '<td class="txt_nowrap">';
	if(array_key_exists($status_list[$i]['status_id'],$report['status'])){
	echo $report['status'][$status_list[$i]['status_id']];
	}
	else{
		echo '0';
	    }
	    echo '</td>';
			}
         echo '</tr>';
	    }
	?>   
       	
		</div>
        </table>
		
		      <? if($total_pages>1) {?> 
			  
		     <div id="load_more_details" onclick="javascript:load_more_staff_details();">
		    <div style="text-align: center;">
                            <span class="link vis-pointer"><?= $vis_language['TXTLOADMORE'];?></span>
                        </div>
						</div>
			  <? } ?>
				
						<input type="hidden" id="temp_page" name="temp_page" value="<?echo $page; ?>">
						
		 </div>
		</div>	 
	
    <?
    }
    else  {
		$operation['no_record']=1;
        include(VIS_PATH_TEMPLATE.'no_record_yet.php');
         } ?>
	
	<script>
	function load_more_staff_details(){
    var total_pages = <?php echo $total_pages; ?>;
	var page = document.getElementById("temp_page").value;
    var new_page = Math.round(page)+1;
	document.getElementById("temp_page").value = new_page;
	if(total_pages <= new_page)
	{
	document.getElementById('load_more_details').style.visibility = 'hidden';
	}

	$.post("index.php?vis_module=report&vis_operation=load_more_staff_details&vis_tmpst="+new Date().getTime(),{'vis_page': new_page,'department_id':<?echo $data['department_id'];?>,'vis_range':<?echo $data['vis_range'];?>}, function(data) {
		//$("#vis_more_details").last().remove();
        $("#vis_more_details").last().append(data);
		
     });
	
}

	
	/*
$(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": false },
		  	{ "bSortable": false },
			<? for($i=0;$i<count($status_list);$i++){
			echo '{ "bSortable": false }';	
			if($i<count($status_list)-1) echo ',';
			}?>
		]
	});
	
});	*/
</script>

 
 <? } elseif(isset($operation['vis_tab']) && $operation['vis_tab']==8){?>   
<!--ticket by label-->
<div class="m-t" >
<div class="panel-body text-center">
			<div class="col-sm-6 portlet" id="reportStatus">
			  <section class="panel-info portlet-item">
				<div class="panel-body text-center">
				  <div class="list-group no-radius no-border text-xs text-left pull-left" id="labelOps" style=" width:100%;">
      <div style="width:100%;" class="text-right vh-lg">Loading...<script>$('#labelOps').width('auto');</script></div>
				   <?
					$labelCount = $perCnt = $labelName = $lablColor = array();
					$total = 0;
					if($graphReport['tickLabel']!=-1)
					{

						if(is_array($graphReport['tickLabel']))
						{
							foreach($graphReport['tickLabel'] as $label)
							{
								$labelCount[] = $label['labelCnt'];
								$labelName[] = $label['label_name'];
								$lablColor[] = $label['label_color'];
							}
							$labelRecs = json_encode($labelCount);
							$lablName = json_encode($labelName);
							//$colors = $this->generateUniqueHexColors(count($statusCount)+5);
							$uniqueColorsPriority = json_encode(array_unique($lablColor));
							$opAreaPriority = "#labelOps";$chartAreaPriority = ".label_sparkline";
							echo "<script>display_pie_charts_data($labelRecs,$lablName,$uniqueColorsPriority,'".$opAreaPriority."','".$chartAreaPriority."');</script>";
						}
					}
				?>
				</div>
				<div class="label_sparkline"><? if($graphReport['tickLabel'] ==-1) { echo $vis_language['TXTNOTHINGTODISPLAY']; } ?></div>
				</div>
				</section>
			</div>
   </div>
   </div>
<!--ticket by label-->
<? 
	}?> 
 
   <?if($operation['vis_tab']!=7){?>
<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": false },
		  	{ "bSortable": false },	
			{ "bSortable": false },	 
			{ "bSortable": false },			
		  	{ "bSortable": false }
		]
	});
	
});	

$('.from_date').datetimepicker({
        format: "<?php echo VIS_DATETIMEPICKER_FORMAT;?>"
	 });
	 $('.to_date').datetimepicker({
			format: "<?php echo VIS_DATETIMEPICKER_FORMAT;?>"
	 });
	 $('.to_date').click();
	 $('.bootstrap-datetimepicker-widget').hide();
		
		$('.rtpcls').click(function() {
   $('.rtpcls').removeClass('btn-primary');
			$(this).addClass('btn-primary');
  });
</script>
   <?}?>
   <script>
   $(document).ready(function() {	
$('#vis_more_details').dataTable({		
        "bPaginate" : false,
        "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 }			
		  
		]
	});
	
});	
   </script>
 
