<? global $vis_language; 
if($sentlog_details==-1){   
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	echo '<script> $("#view_action").hide(); $("#vis_sentmail_form .panel-footer").hide(); $("#vis_sentmail_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { ?>
<script> $("#view_action").show(); $("#vis_sentmail_form .panel-footer").show(); $("#vis_sentmail_list").show(); </script>
<? if($is_inbox_page==1) { 
	$visoperation = 'sentmail_details';
} else {
	$visoperation = 'sentmail_details_log';
} ?>
<table class="table table-hover b-t b-light m-b-none" data-ride="datatables">
   <thead class="table_head">		   
	  <tr>
         <? if($is_inbox_page!=1) { ?>
		 <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 class="txt_nowrap"><? echo $vis_language['TXTSUBJECT']; ?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTFROM']; ?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTTO']; ?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTDATE']; ?></th>					 
		 <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
	  </tr>
   </thead>		   
   <tbody>
	  <?
		   if($sentlog_details!=-1) for($i=0;$i<count($sentlog_details);$i++) {
			if($sentlog_details[$i]['mail_status']==0){ $status = $vis_language['TXTFAILED'];$lbl='label-default';} else {$status = $vis_language['TXTSUCCESS'];$lbl='vh-green-bg';}  
            if($is_inbox_page!=1) { 
            echo '<tr><td width="30" id="checkbox_data"><label class="checkbox m-n i-checks"><input type="checkbox" name="vis_global_mass_chk_'.$i.'" id="vis_global_mass_chk_'.$i.'" value="'.$sentlog_details[$i]['sent_mail_id'].'" /><i></i></label></td>'; }
			 echo '<td><a href="#/setting/'.$visoperation.'/'.$vis_language['MSGMAILDETAILS'].'/'.$sentlog_details[$i]['sent_mail_id'].'">'.($sentlog_details[$i]['subject']).'</a></td>';
			 echo '<td><a href="#/setting/'.$visoperation.'/'.$vis_language['MSGMAILDETAILS'].'/'.$sentlog_details[$i]['sent_mail_id'].'">'.htmlentities($sentlog_details[$i]['mail_from']).'</a></td>';
			 echo '<td><a href="#/setting/'.$visoperation.'/'.$vis_language['MSGMAILDETAILS'].'/'.$sentlog_details[$i]['sent_mail_id'].'">'.str_replace(",",",  ",$sentlog_details[$i]['mail_to']).'</a></td>';
			 echo '<td class="txt_nowrap"><a href="#/setting/'.$visoperation.'/'.$vis_language['MSGMAILDETAILS'].'/'.$sentlog_details[$i]['sent_mail_id'].'">'.format_datetime($sentlog_details[$i]['send_date']).'</a></td>';
			echo '<td><span class="label '.$lbl.'">'.$status.'</span></td></tr>';
		 } ?>
   </tbody>
</table>
<? } ?>
<script>
$(".selectpicker").selectpicker();
$(document).ready(function() {	
$('[data-ride="datatables"]').dataTable({
	<? if($is_inbox_page==1) { ?> "aaSorting" : [],<? } ?>
	"bPaginate" : false,				
	"paginate": false,
	"sDom": 't', "bAutoWidth": false,
	"aoColumns": [
        <? if($is_inbox_page!=1) { ?>{ "bSortable": false },<? } ?>
		null,
		null,
		null,
		null,												
		null
	]
});
});
</script>
