<? global $vis_language; 
if($channel_details==-1 || $channel_details==''){   
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	echo '<script> $("#view_action").hide(); $("#vis_'.$operation['vis_operation'].'_form .panel-footer").hide(); $("#vis_domain_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { ?>
<script> $("#view_action").show(); $("#vis_<?php echo $operation['vis_operation']; ?>_form .panel-footer").show(); $("#vis_domain_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['TXTTITLE']; ?></th>
                  <th class="txt_nowrap"><? echo $vis_language['TXTIMG']; ?></th>
                  <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
				  <th></th>
               </tr>
            </thead>
            <tbody>
                <?
         for($i=0;$i<count($channel_details);$i++){
			 $link=($channel_details[$i]['channel_id']<=23 )?"javascript:link();return false;":"";
             if($channel_details[$i]['is_enabled']==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 $channel_details[$i]['channel_id']; ?>" <? if($channel_details[$i]['channel_id']==1) { ?> disabled="disabled" <? } ?> /><i></i></label></td><?
              echo '<td><a href="#/setting/channel_details/'.rawurlencode(str_replace('/', ' ', $channel_details[$i]['channel_name'])).'/'.$channel_details[$i]['channel_id'].'" onclick="'.$link.'">'.$channel_details[$i]['channel_name'].'</a></td>';
              echo '<td><a href="#/setting/channel_details/'.rawurlencode(str_replace('/', ' ', $channel_details[$i]['channel_name'])).'/'.$channel_details[$i]['channel_id'].'" onclick="'.$link.'">';
               if($channel_details[$i]['channel_id']<=23 && strstr($channel_details[$i]['icon_path'], "vh vh-"))
				{
					echo '<i class="'.$channel_details[$i]['icon_path'].' vh-lg"></i>';
				}
				else
				{
					if(file_exists(VIS_PATH_PROFILE.$channel_details[$i]['icon_path']))
						echo '<img src="'.VIS_PATH_PROFILE.$channel_details[$i]['icon_path'].'" class="thumb-xxs">';
					else
						echo '<i class="vh vh-channel vh-lg"></i>';
				}
               echo '</a></td>';
             echo '<td><span class="label '.$lbl.'">'.$status.'</span></td>'; ?>
      <td align="center"> <? if($channel_details[$i]['channel_id']>23) {?><a class="text-muted"  href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=setting&vis_operation=get_channel_delete&vis_channel_id=<? echo $channel_details[$i]['channel_id']; ?>&vis_static_area=vis_channel_delete_form&vis_page=<? echo $ticket_info['page']; ?>" title="<? echo $vis_language['TXTDELETE']; ?>"><i class="vh vh-delete-round"></i></a>
		   <? }?>

		  </td>
      </tr> <?
         } ?>
            </tbody>
 </table> <? } ?>
<script type="text/javascript">
   $(document).ready(function() {	
   $('[data-ride="datatables"]').dataTable({		
           "bPaginate" : false,	
   		"sDom": 't', "bAutoWidth": false,
   		"aoColumns": [
   			{ "bSortable": false },
   		  	null,
   		  	{ "bSortable": false },
   		  	null,
   			{ "bSortable": false }
   		]
   	});
   });
 </script>

<script> 
   function link()
   {
	  $("#vis_global_msg_div").visInterface("load_global_message", "<? echo $vis_language['MSGCHLNOTUP'];?>");
   }
</script>
