<? global $vis_language;  
if($customfield_details==-1 || $customfield_details[0] == ''){ 
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	echo '<script> $("#view_action").hide(); $("#vis_customfield_form .panel-footer").hide(); $("#vis_customfield_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { ?>
<script> $("#view_action").show(); $("#vis_customfield_form .panel-footer").show(); $("#vis_customfield_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['TXTFIELDNAME']; ?></th>
         <th class="txt_nowrap"><? echo$vis_language['TXTTYPE']; ?></th>
         <th class="txt_nowrap"><? echo$vis_language['TXTFORMGROUP']; ?></th>
         <th class="txt_nowrap"><? echo$vis_language['TXTDISPLAYORDER']; ?></th>		 
		 <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>			 
         <th></th>
      </tr>
   </thead>
   <tbody>
      <?
         $type=array('', 'Textbox', 'Password', 'Textarea', 'Checkbox', 'Radio', 'Select', 'Listbox','Date Time','File','Note');
         if($customfield_details!=-1) for($i=0;$i<$customfield_info['customfield_count'];$i++) {
			$custom_field_name=str_replace("/","",stripslashes($customfield_details[$i]['field_name']));
 			if($customfield_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="'.$customfield_details[$i]['formfield_id'].'" /><i></i></label></td><td><a href="#/setting/formfield_details/'.$custom_field_name.'/'.$customfield_details[$i]['field_group'].'">'.$customfield_details[$i]['field_name'].'</a></td>';
             echo '<td><a href="#/setting/formfield_details/'.$custom_field_name.'/'.$customfield_details[$i]['field_group'].'">'.$type[$customfield_details[$i]['field_type']].'</a></td>';
             echo '<td><a href="#/setting/formfield_details/'.$custom_field_name.'/'.$customfield_details[$i]['field_group'].'">'.$customfield_details[$i]['formgroup_name'].'</a></td>';
             echo '<td><a href="#/setting/formfield_details/'.$custom_field_name.'/'.$customfield_details[$i]['field_group'].'">'.$customfield_details[$i]['display_order'].'</a></td>';
             echo '<td><span class="label '.$lbl.'">'.$status.'</span></td>';?>
      <td align="center"> <a class="text-muted" data-toggle="ajaxModal" data-modal-arguments="vis_module=setting&vis_operation=get_formfield_delete&vis_fieldgroup_id=<? echo $customfield_details[$i]['field_group']; ?>&vis_static_area=vis_customfield_delete_form&vis_page=<? echo $customfield_info['page']; ?>" title="<? echo $vis_language['TXTDELETE']; ?>" href="javascript:void(0);" ><i class="vh vh-delete-round"></i></a></td>
      <?
         echo '</tr>';
         }?>
   </tbody>
</table><? } ?>
<script type="text/javascript">
   $(".selectpicker").selectpicker();
   $(document).ready(function() {	
   $('[data-ride="datatables"]').dataTable({	
    "aaSorting": [], 	
           "bPaginate" : false,	
   		"sDom": 't', "bAutoWidth": false,
   		"aoColumns": [
   			{ "bSortable": false },
   		  	null,
   		  	null,
   		  	null,
   		  	null,
   		  	null,												
   			{ "bSortable": false }
   		]
   	});
   });
</script>

