<? 	global $vis_language; 
if($default==0){
	if($domain != -1){ 
	for($i=0; $i<count($domain); $i++) {
		if($domain[$i]['domain']['domain_id'] != $operation['vis_last_domain']){ 
			?>
	<div class="text-md hidden-nav-xs text-black vis_leftpanel_domain_span"  onclick="$('#vis_lf_domain_content_<? echo $domain[$i]['domain']['domain_id']; ?>').slideToggle();"><? echo $domain[$i]['domain']['domain_name']; ?></div>
		
	<nav class="nav-stacked hidden-xs" id="vis_lf_domain_content_<? echo $domain[$i]['domain']['domain_id']; ?>">
		<ul class="nav nav-main" data-ride="collapse">
  	<? } ?>
    <? if($domain[$i]['domain']['domain_id'] == $operation['vis_last_domain']){ ?>
    
    <? for($j=0; $j<count($domain[$i]['departments']); $j++) { ?>
		<?	$deptd='<li class="active"><a href="#" class="auto bg-white text-black"><span class="pull-right text-muted"><i class="vh vh-angle-down text"></i><i class="vh vh-angle-up text-active"></i></span><span>'.$domain[$i]['departments'][$j]['department_name'].'</span></a>';
    
				$deptd .='<ul class="nav bg-white">'; ?>
				<?  for($k=0; $k<count($domain[$i]['departments'][$j]['status']); $k++) { ?>
				<?	$deptd .='<li><a href="#/ticket/filter_queue_ticket/'.str_replace('/', ' ', $domain[$i]['domain']['domain_name'].' : '.$domain[$i]['departments'][$j]['department_name'].' : '.$domain[$i]['departments'][$j]['status'][$k]['status_name']).'/'.$domain[$i]['departments'][$j]['department_id'].'/'.$domain[$i]['departments'][$j]['status'][$k]['status_id'].'" class="auto dept_nav">';
							$deptd .='<span id="vis_lp_department_'.$domain[$i]['departments'][$j]['department_id'].'_status_'.$domain[$i]['departments'][$j]['status'][$k]['status_id'].'" class="badge bg-gradient pull-right font-normal text-xs">'.$domain[$i]['departments'][$j]['status'][$k]['ticket_count'].'</span><span class="m-l-md text-sm"> '.$domain[$i]['departments'][$j]['status'][$k]['status_name'].'</span></a></li>'; ?>
				<? }//for k ?>
				<? $deptd .='</ul></li><div class="line dk hidden-nav-xs"></div>';
			
			echo "<script>$('#vis_lf_domain_content_".$operation['vis_last_domain']." ul.nav-main').append('".$deptd."');</script>";
			?>
			<? }//for j ?>
    
    
    <? }else{?>
			<? for($j=0; $j<count($domain[$i]['departments']); $j++) { ?>
			<li class="active">
				<a href="#" class="auto bg-white text-black">
				<span class="pull-right text-muted">
					<i class="vh vh-angle-down text"></i>
					<i class="vh vh-angle-up text-active"></i>
				</span>
				<span><? echo $domain[$i]['departments'][$j]['department_name']; ?></span>
				</a>
				<ul class="nav bg-white">
				<?  for($k=0; $k<count($domain[$i]['departments'][$j]['status']); $k++) { ?>
					<li>
						<a href="#/ticket/filter_queue_ticket/<? echo str_replace('/', ' ', $domain[$i]['domain']['domain_name'].' : '.$domain[$i]['departments'][$j]['department_name'].' : '.$domain[$i]['departments'][$j]['status'][$k]['status_name']); ?>/<? echo $domain[$i]['departments'][$j]['department_id']; ?>/<? echo $domain[$i]['departments'][$j]['status'][$k]['status_id']; ?>" class="auto dept_nav">
							<span id="vis_lp_department_<? echo $domain[$i]['departments'][$j]['department_id']; ?>_status_<? echo $domain[$i]['departments'][$j]['status'][$k]['status_id']; ?>" class="badge bg-gradient pull-right font-normal text-xs"><? echo $domain[$i]['departments'][$j]['status'][$k]['ticket_count']; ?></span>
							<span class="m-l-md text-sm"> <? echo $domain[$i]['departments'][$j]['status'][$k]['status_name'];?></span>
						</a>
					</li>
				<? }//for k ?>
				</ul>
			</li>
			<div class="line dk hidden-nav-xs"></div>
			<? }//for j
			
	}
	?>
 <? if($domain[$i]['domain']['domain_id'] != $operation['vis_last_domain']){ ?>
		</ul>
	</nav>
 <? }?>
	<? }//for i 
	if($load_more_lp_dept != ''){ ?>        
		<div id="load_more_lp_dept" onclick="javascript:load_more_lp_dept(<?= $load_more_lp_dept; ?>,'<?= $last_domain_id;?>');">
			<div class="text-sm hidden-nav-xs text-black vis_leftpanel_domain_span"  style="text-transform: none;
	font-weight: normal; text-align: right;">
				<span data-loading-text="Loading..."><?= $vis_language['TXTLOADMORE'];?></span>
			</div>
		</div>
		<? } 
	}	
}else{  ###lable list code starts ?>
<div class="text-md hidden-nav-xs text-black vis_leftpanel_domain_span"  onclick="$('#vis_lf_label_content').slideToggle();"><? echo $vis_language['TXTLABELS']; ?></div>
	<ul class="nav bg-white" >	
		<? if($label_details!=-1){
			for($j=0; $j<count($label_details); $j++) { ?>
			<li style="padding-top: 5px;">
				<a href="#/ticket/search_label_tickets/<?php echo $label_details[$j]['label_name'].'&-'.$label_details[$j]['label_id'].'/'.$label_details[$j]['label_id']; ?>" class="auto dept_nav" >
				<span class="badge bg-gradient pull-right font-normal text-xs" id="vis_lbl_cnt<?php echo $label_details[$j]['label_id']; ?>"><? echo $label_details[$j]['lbl_count']; ?></span>
				<span class="badge bg-gradient  font-normal text-xs  m-l-md " style="background-color: <? echo $label_details[$j]['label_color']; ?>; color: #fff;padding: 7px; margin-right:-10px;"> </span> 
				<span class="m-l-md text-sm " ><? echo $label_details[$j]['label_name']; ?></span>
				</a>			 
			</li>		
		<?    }//for j
		  }else{
			 echo '<li style="padding-top: 5px; padding-left: 25px;">'.$vis_language['TXTNOTHINGTODISPLAY'].'</li>';
		  } ?>
	</ul>

<?php } ##lable list code end ?>
