<? global $vis_language; 
if($department_details==-1){   
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	echo '<script> $("#view_action").hide(); $("#vis_department_form .panel-footer").hide(); $("#vis_department_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { ?>
<script> $("#view_action").show(); $("#vis_department_form .panel-footer").show(); $("#vis_department_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['TXTDEPARTMENT']; ?></th>
			<th class="txt_nowrap"><? echo $vis_language['TXTDOMAIN']; ?></th>
			<th class="txt_nowrap"><? echo $vis_language['TXTISPAID']; ?></th>					
			<th class="txt_nowrap"><? echo $vis_language['TXTACCESS']; ?></th>
			<th class="txt_nowrap"><? echo $vis_language['TXTDISPLAYORDER']; ?></th>
			<th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>									
			<th></th>
            <th></th>
		</tr>
	</thead>
	<tbody>			  
	 <? if($department_details!=-1) for($i=0;$i<$department_info['department_count'];$i++) {
        if($department_details[$i]['is_enabled']==1){ $status = $vis_language['TXTENABLED'];$lbl='vh-green-bg';} else {$status = $vis_language['TXTDISABLED'];$lbl='label-default';}
        $access=($department_details[$i]['access_type']==1)?$vis_language['TXTPRIVATE']:$vis_language['TXTPUBLIC'];
        $paid=($department_details[$i]['is_paid']==1)?$vis_language['TXTYES']:$vis_language['TXTNO'];
        echo '<tr><td width="30"><label class="checkbox m-n m-r-sm i-checks"><input type="checkbox"  name="vis_global_mass_chk_'.$i.'" id="vis_global_mass_chk_'.$i.'" value="'.$department_details[$i]['department_id'].'" /><i></i></label></td>';
        echo '<td><a href="#/setting/department_details/'.rawurlencode(str_replace('/', ' ', $department_details[$i]['domain_name'].' : '.$department_details[$i]['department_name'])).'/'.$department_details[$i]['department_id'].'">'.$department_details[$i]['department_name'].'</a></td>';
        echo '<td><a href="#/setting/department_details/'.rawurlencode(str_replace('/', ' ', $department_details[$i]['domain_name'].' : '.$department_details[$i]['department_name'])).'/'.$department_details[$i]['department_id'].'">'.$department_details[$i]['domain_name'].'</a></td>';
        echo '<td><a href="#/setting/department_details/'.rawurlencode(str_replace('/', ' ', $department_details[$i]['domain_name'].' : '.$department_details[$i]['department_name'])).'/'.$department_details[$i]['department_id'].'">'.$paid.'</a></td>';
        echo '<td><a href="#/setting/department_details/'.rawurlencode(str_replace('/', ' ', $department_details[$i]['domain_name'].' : '.$department_details[$i]['department_name'])).'/'.$department_details[$i]['department_id'].'">'.$access.'</a></td>';
        echo '<td><a href="#/setting/department_details/'.rawurlencode(str_replace('/', ' ', $department_details[$i]['domain_name'].' : '.$department_details[$i]['department_name'])).'/'.$department_details[$i]['department_id'].'">'.$department_details[$i]['display_order'].'</a></td>';
        echo '<td><span class="label '.$lbl.'">'.$status.'</span></td>';      
        echo '<td align="right"><a class="link" href="#/setting/clone_department/'.$department_details[$i]['department_id'].'">'.$vis_language['TXTCLONE'].'</a></td>'; ?>  
        <td align="center"> <a href="javascript:void(0);" title="<? echo$vis_language['TXTDELETE']; ?>" class="text-muted" data-toggle="ajaxModal" data-modal-arguments="vis_module=setting&vis_operation=get_department_delete&vis_domain_id=<? echo $department_details[$i]['domain_id']; ?>&vis_department_id=<? echo $department_details[$i]['department_id']; ?>&vis_static_area=vis_department_delete_form&vis_page=<? echo $department_info['page']; ?>" ><i class="vh vh-delete-round"></a></td>
        <?
        echo '</tr>';
    }?>	  
	
	</tbody>
</table><? } ?>
<script type="text/javascript">
$(document).ready(function() {
$(".selectpicker").selectpicker(); 	
$('[data-ride="datatables"]').dataTable({		
         "bPaginate" : false,	
		"sDom": 't', "bAutoWidth": false,
		"aoColumns": [
			{ "bSortable": false },
		  	null,
		  	null,
		  	null,
		  	null,	
		  	null,	
		  	null,	
            { "bSortable": false },
			{ "bSortable": false }
		]
	});
});
</script>



