<? global $vis_language; ?>
<section class="panel bg-white">
<div class="panel-heading b-light bg-light">
<div class="col-sm-8">
	<div class=""> <strong><? echo $cnt.' '.$vis_language['TXTMATCHFOUND'];?></strong></div>
 </div>
 <div class="col-sm-4">
 <div class="text-right"><a href="javascript:void(0);" id="backtosearch" onclick="backtosearch();" class="link"><? echo $vis_language['TXTBACK'];?></a></div>
 </div>
 <div class="clearfix"></div>
 </div>
	<div class="list-group list-group-alt<? if($cnt > 6) echo ' search_result_list'?>">
	<? if($client!=-1) for($i=0; $i<count($client); $i++){
		$image = is_file(VIS_PATH_PROFILE.$client[$i]['image_name']) ? (VIS_PATH_PROFILE.$client[$i]['image_name']) : (VIS_PATH_PROFILE.'default.jpg');
		?>		
		<a href="#/client/client_details/<?= $client[$i]['first_name'].' '.$client[$i]['last_name'] ?>/<?= ($client[$i]['parent_id']==0)?$client[$i]['client_id']:$client[$i]['parent_id']; ?>" class="media list-group-item" id="client"  data-client-id="<?= ($client[$i]['parent_id']==0)?$client[$i]['client_id']:$client[$i]['parent_id']; ?>"> 
			<? if(is_file(VIS_PATH_PROFILE.$client[$i]['image_name']) && $client[$i]['image_name']!='default.jpg'){?>
<div class="l-avatar pull-left">
<img src="<?=VIS_PATH_PROFILE.$client[$i]['image_name']?>" class="sm img-circle">
</div>
<? }else{ ?>
<div class="l-avatar pull-left">
<? if($client[$i]['first_name']!=''){
	$firstname=preg_split('//u', $client[$i]['first_name'], -1, PREG_SPLIT_NO_EMPTY);
$lastname=preg_split('//u', $client[$i]['last_name'], -1, PREG_SPLIT_NO_EMPTY);
	?>
<div class="sm"><? echo ucfirst($firstname[0]).ucfirst($lastname[0]);?></div>
    <? }else{ ?>
    <img class="sm" src="<?= VIS_PATH_PROFILE.'default.jpg';?>">
    <? }?>

</div>
<? }?>
   <!--<span class="pull-left thumb-sm"> <img src="<? //= $image?>" alt="..." class="img-circle"> </span>--> 
   <?php 
   $clientName = ($client[$i]['first_name']=="" && $client[$i]['last_name'] =="")?$client[$i]['user_name']:$client[$i]['first_name'].' '.$client[$i]['last_name'];
   ?>
			<span class="media-body block m-b-none"><? echo ($clientName).' - '.$client[$i]['domain_name']; ?></span> 
   <span class="media-body block m-b-none"><? echo ($client[$i]['email'].' - '.$client[$i]['contact_number']); ?></span>
		</a>
	<? }
	if($tickets!=-1) for($i=0; $i<count($tickets); $i++){ ?>
		<a style="display: block;" href="#/ticket/ticket_details/<?= ($tickets[$i]['ticket_hash']).'/'.$tickets[$i]['ticket_id']?>" class="media list-group-item" data-ticket-id="<?= $tickets[$i]['ticket_id']?>" id="ticket">
			<span class="pull-left thumb-sm text-center">
				<i class="vh vh-ticket vh-brown vh-2x"></i>
			</span>
			<span class="media-body block m-b-none"><? echo ($tickets[$i]['ticket_hash'].' - '.$tickets[$i]['domain_name']); ?></span>
   <span class="media-body block m-b-none"><? echo ($tickets[$i]['subject']); ?></span>
		</a>
	<? }
		if($organization!=-1) for($i=0; $i<count($organization); $i++){ ?>
		<a style="display: block;" href="#/client/organizations_details/<?= ($organization[$i]['group_name']).'/'.$organization[$i]['group_id']?>" class="media list-group-item" data-ticket-id="<?= $organization[$i]['group_id']?>" id="ticket">
			<span class="pull-left thumb-sm text-center">
				<i class="vh vh-staff-group vh-brown vh-2x"></i>
			</span>
			<span class="media-body block m-b-none"><? echo ($organization[$i]['group_name']); ?></span>
		</a>
	<? }
	if($solution!=-1) for($i=0; $i<count($solution); $i++){ ?>
		<a style="display: block;" href="#/solutions/view_article/<?= ($solution[$i]['article_title']).'/'.$solution[$i]['article_id']?>" class="media list-group-item" data-ticket-id="<?= $solution[$i]['article_id']?>" id="solution">
			<span class="pull-left thumb-sm text-center">
				<i class="vh vh-self-help vh-red vh-2x"></i>
			</span>
			<span class="media-body block m-b-none"><? echo ($solution[$i]['article_title']); ?></span>
			<span class="text-sm link" style="font-size:10px;"><? echo $solution[$i]['title_selfhelp']; ?></span>
		</a>
	<? }
	if($forums!=-1) for($i=0; $i<count($forums); $i++){ ?>
		<a style="display: block;" href="#/forums/topic_details/<?= ($forums[$i]['title']).'/'.$forums[$i]['topic_id']?>" class="media list-group-item" data-ticket-id="<?= $forums[$i]['topic_id']?>" id="forums">
			<span class="pull-left thumb-sm text-center">
				<i class="vh vh-staff-group vh-green vh-2x"></i>
			</span>
			<span class="media-body block m-b-none"><? echo ($forums[$i]['title']); ?></span>
		</a>
	<? }
	if($problems!=-1) for($i=0; $i<count($problems); $i++){ ?>
		<a style="display: block;" href="#/problem/problems_details/<?= ($problems[$i]['problem_hash']).'/'.$problems[$i]['problem_id']?>" class="media list-group-item" data-ticket-id="<?= $problems[$i]['problem_id']?>" id="ticket">
			<span class="pull-left thumb-sm text-center">
				<i class="vh vh-problem-management vh-red vh-2x"></i>
			</span>
			<span class="media-body block m-b-none"><? echo ($problems[$i]['problem_hash'].' - '.$problems[$i]['subject']); ?></span>
		</a>
  	<? }
	if($release!=-1) for($i=0; $i<count($release); $i++){ ?>
		<a style="display: block;" href="#/releases/releases_details/<?= ($release[$i]['release_hash']).'/'.$release[$i]['release_id']?>" class="media list-group-item" data-ticket-id="<?= $release[$i]['release_id']?>" id="release">
			<span class="pull-left thumb-sm text-center">
				<i class="vh vh-release-management vh-green vh-2x"></i>
			</span>
			<span class="media-body block m-b-none"><? echo ($release[$i]['release_hash'].' - '.$release[$i]['subject']); ?></span>
		</a>
  	<? }
	if($change!=-1) for($i=0; $i<count($change); $i++){ ?>
		<a style="display: block;" href="#/changes/changes_details/<?= ($change[$i]['changes_hash']).'/'.$change[$i]['changes_id']?>" class="media list-group-item" data-ticket-id="<?= $change[$i]['changes_id']?>" id="change">
			<span class="pull-left thumb-sm text-center">
				<i class="vh vh-change-management vh-brown vh-2x"></i>
			</span>
			<span class="media-body block m-b-none"><? echo ($change[$i]['changes_hash'].' - '.$change[$i]['subject']); ?></span>
		</a>
	<? }
	if($search_res_msg != "") { ?>
		<a href="#" class="media list-group-item"><span class="media-body block m-b-none"><?= $search_res_msg;?></span></a>
	<? } ?>
	</div>
 
</section>
