<? global $vis_language; 
if($custom_group_details==-1 || $custom_group_details[0] == ''){ 
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	echo '<script> $("#view_action").hide(); $("#vis_custom_group_form .panel-footer").hide(); $("#vis_custom_group_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { ?>
<script> $("#view_action").show(); $("#vis_custom_group_form .panel-footer").show(); $("#vis_custom_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>
					<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['TXTFORMGROUPNAME']; ?></th>
				<th><? echo $vis_language['TXTFORMTYPE']; ?></th>						
				<th class="txt_nowrap"><? echo $vis_language['TXTDISPLAYORDER']; ?></th>					
				<th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
				<!-- <th class="txt_nowrap"><? echo $vis_language['TXTFORMFIELD']; ?></th> -->				
				<th></th>
			</tr>
		</thead>
	<tbody>			  
<? if($custom_group_details!=-1) for($i=0;$i<count($custom_group_details);$i++) { $tp = ($custom_group_details[$i]['form_type']==1)?$vis_language['TXTEMAIL']:$vis_language['TXTCALL'];
	    $custom_fieldgr_name=rawurlencode(str_replace("/","",stripslashes($custom_group_details[$i]['customgroup_name'])));
		if($custom_group_details[$i]['is_enabled']==1){ $status = $vis_language['TXTENABLED'];$lbl='vh-green-bg';} else {$status = $vis_language['TXTDISABLED'];$lbl='label-default';}
		
		echo '<tr><td width="30"><label class="checkbox m-n i-checks"><input type="checkbox" name="vis_global_mass_chk_'.$i.'" id="vis_global_mass_chk_'.$i.'" value="'.$custom_group_details[$i]['formgroup_id'].'" /><i></i></label></td><td><a href="#/setting/form_group_details/'.$custom_fieldgr_name.'/'.$custom_group_details[$i]['formgroup_id'].'">'.$custom_group_details[$i]['form_name'].'</a></td><td><a href="#/setting/form_group_details/'.$custom_fieldgr_name.'/'.$custom_group_details[$i]['formgroup_id'].'">'.$tp.'</a></td>';
		echo '<td><a href="#/setting/form_group_details/'.$custom_fieldgr_name.'/'.$custom_group_details[$i]['formgroup_id'].'">'.$custom_group_details[$i]['display_order'].'</a></td>';
		echo '<td><span class="label '.$lbl.'">'.$status.'</span></td>';
		
		/*echo '<td><a title="'.$vis_language['TXTADDNEWFORMFIELD'].'" class="link" href="#/setting/new_form_field/Add-form-field/'.$custom_group_details[$i]['formgroup_id'].'"  >'.$vis_language['TXTADD'].'</a> | <a title="'.$vis_language['TXTEDITFORMFIELD'].'"  class="link" href="#/setting/view_formfield/'.$vis_language['TXTFORMFIELD'].'/'.$custom_group_details[$i]['formgroup_id'].'" >'.$vis_language['TXTEDIT'].'</a></td>'; */ ?>
		
<td align="center"> <a class="text-muted" data-toggle="ajaxModal" data-modal-arguments="vis_module=setting&vis_operation=get_formgroup_delete&vis_formgroup_id=<? echo $custom_group_details[$i]['formgroup_id']; ?>&vis_static_area=vis_formgroup_delete_form&vis_page=<? echo $group_info['page']; ?>" title="<? echo $vis_language['TXTDELETE']; ?>" href="javascript:void(0);" ><i class="vh vh-delete-round"></i></a> 
</td>
<? } ?>
				</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>
<script src="<?= VIS_PATH_SCRIPT; ?>dropdown_dropup.js"></script>