<? global $vis_language; 
if($group==-1){   
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	echo '<script> $("#view_action").hide(); $("#vis_client_group_form .panel-footer").hide(); $("#vis_client_group_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { ?>
 <script> $("#view_action").show(); $("#vis_client_group_form .panel-footer").show(); $("#vis_client_group_list").show(); </script>
<table class="table table-hover b-t b-light m-b-none" data-ride="datatables">
   <thead class="table_head">
      <tr>
         <th width="70">
            <div class="btn-group">
               <label class="checkbox m-n m-r-sm i-checks"  style="float: left;"><input type="checkbox"><i></i></label>		
            </div>
         </th>
         <th><? echo $vis_language['TXTTITLE']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTCLIENTS']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTTICKETS']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
         <th></th>
      </tr>
   </thead>
   <tbody>
      <?
      if($group!=-1) for($i=0;$i<count($group);$i++) { 
			if($group[$i]['is_enable']==1){ $status = $vis_language['TXTENABLED'];$lbl='vh-green-bg';} else {$status = $vis_language['TXTDISABLED'];$lbl='label-default';} ?>
             <tr><td width="30"><label class="checkbox m-n i-checks"><input type="checkbox" name="vis_global_mass_chk_<? echo $i; ?>" id="vis_global_mass_chk_<? echo $i; ?>" value=<? echo $group[$i]['group_id'];?> <? if($group[$i]['group_id']==1) { ?> onclick='$("#vis_global_msg_div").visInterface("load_global_message", "<? echo $vis_language['MSGCOREORGSTATUS']; ?>"); return false;' <? }  if($group[$i]['group_id']==1) { ?> disabled="disabled" <?}?>/><i></i></label></td>
             <td><a href="#/client/organizations_details/<? echo $group[$i]['group_name'];?>/<? echo $group[$i]['group_id'];?>"><?echo $group[$i]['group_name'];?></a></td>
             <? 
			/*	$cnt=0;
				for($j=0;$j<count($client_details);$j++)
				{
					if($client_details[$j]['group_id'] == $group[$i]['group_id'])
					$cnt++;
				}*/
			?>
             <td><a href="#/client/view_clients/<? echo $group[$i]['group_name'];?>/<? echo $group[$i]['group_id'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $group[$i]['group_name'];?>/<? echo $group[$i]['group_id'];?>',{'vis_module':'client','vis_operation':'view_clients','vis_group_id':'<? echo $group[$i]['group_id'];?>','vis_group_name':'<? echo $group[$i]['group_name'];?>'});"><? echo $group[$i]['clientcount'];?></a></td>
             <? 
				/*$cnt=0;
				for($j=0;$j<count($client_details);$j++)
				{
					for($k=0;$k<count($ticket_details);$k++)
					{
						if($ticket_details[$k]['client_id'] == $client_details[$j]['client_id'])
						{
							if($client_details[$j]['group_id'] == $group[$i]['group_id'])
							$cnt++;
						}
					}
				}*/
		?>
             <td><a href="#/ticket/filter_ticket_group/<? echo $group[$i]['group_name'];?>/<? echo $group[$i]['group_id'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $group[$i]['group_name'];?>/<? echo $group[$i]['group_id'];?>',{'vis_module':'ticket','vis_operation':'filter_ticket_group','vis_group_id':'<? echo $group[$i]['group_id'];?>','vis_group_name':'<? echo $group[$i]['group_name'];?>'});"><? echo $group[$i]['ticketcount'];?></a></td>
             <td><span class="label <? echo $lbl; ?>"><? echo $status; ?></span></td>
      <td align="center"> <? if($group[$i]['group_id']!=1){?><a class="text-muted" href="javascript:void(0);" title="<? echo $vis_language['TXTDELETE']; ?>" data-toggle="ajaxModal" data-modal-arguments="vis_module=client&vis_operation=get_client_group_delete&vis_group_id=<? echo $group[$i]['group_id']; ?>&vis_static_area=vis_group_delete_form" ><i class="vh vh-delete-round"></i></a><? }?>
      </td>
		</tr> 
        <? } ?>
   </tbody>
</table>
<? } ?>
<script type="text/javascript">
	$(".selectpicker").selectpicker();
   $(document).ready(function() {	
   $('[data-ride="datatables"]').dataTable({		
          "bPaginate" : false,	
   		"sDom": 't', "bAutoWidth": false,
   		"aoColumns": [
   			{ "bSortable": false },
   		  	null,
   		  	null,
   		  	null,
   		  	null,													
   			{ "bSortable": false }
   		]
   	});
   });
</script>
