<? global $vis_language; 
if($mailqueue_details==-1){   
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	echo '<script> $("#view_action").hide(); $("#vis_mailqueue_form .panel-footer").hide(); $("#vis_mailqueue_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { ?>
<script> $("#view_action").show(); $("#vis_mailqueue_form .panel-footer").show(); $("#vis_mailqueue_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['TXTEMAIL']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTFETCHTYPE']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTDEPARTMENT']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
         <th></th>
         <th></th>
      </tr>
   </thead>
   <tbody>
      <?
         $type=array(0=>'Pipe', 1=>'POP3', 2=>'POP3 SSL', 3=>'POP3 TLS', 4=>'IMAP', 5=>'IMAP SSL',6=>'IMAP TLS');
         for($i=0;$i<$mailqueue_info['mailqueue_count'];$i++) {        
          if($mailqueue_details[$i]['is_enabled']==1){ $status = $vis_language['TXTENABLED'];$lbl='vh-green-bg';} elseif($mailqueue_details[$i]['is_enabled']==2){ $status = $vis_language['TXTAUTHENTICATIONERROR'];$lbl='vh-brown-bg';} elseif($mailqueue_details[$i]['is_enabled']==3){ $status = $vis_language['TXTCONNECTIONERROR'];$lbl='vh-brown-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="'.$mailqueue_details[$i]['mailqueue_id'].'" /><i></i></label></td>';
          echo '<td><a href="#/setting/mailqueue_details/'.$mailqueue_details[$i]['email'].'/'.$mailqueue_details[$i]['mailqueue_id'].'">'.$mailqueue_details[$i]['email'].'</a></td>';
          echo '<td><a href="#/setting/mailqueue_details/'.$mailqueue_details[$i]['email'].'/'.$mailqueue_details[$i]['mailqueue_id'].'">'.$type[$mailqueue_details[$i]['mailqueue_type']].'</a></td>';
          echo '<td><a href="#/setting/mailqueue_details/'.$mailqueue_details[$i]['email'].'/'.$mailqueue_details[$i]['mailqueue_id'].'">'.$mailqueue_details[$i]['domain_name'].' : '.$mailqueue_details[$i]['department_name'].'</a></td>';
          echo '<td><span class="label '.$lbl.'">'.$status.'</span></td>'; 
          echo '<td align="right"><a class="link" href="#/setting/clone_mailqueue/'.$mailqueue_details[$i]['mailqueue_id'].'">'.$vis_language['TXTCLONE'].'</a></td>'; ?>
      <td align="center"> <a class="text-muted" href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=setting&vis_operation=get_mailqueue_delete&vis_mailqueue_id=<? echo $mailqueue_details[$i]['mailqueue_id']; ?>&vis_static_area=vis_mailqueue_delete_form" title="<? echo $vis_language['TXTDELETE']; ?>"><i class="vh vh-delete-round"></a></td>
      <?
         echo '</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 },
   			{ "bSortable": false }
   		]
   	});
   });
</script>
