<div class="row-fluid">
  <div class="span2">
    <ul class="nav nav-tabs nav-stacked" style="min-height:800px;background:#f5f5f5;">
      <legend style="border:none;">订单邮件发送管理</legend>
      <li class="<?php if($nav_status=='index') echo 'active'; ?>"><a style="border-right: none;" href="<?php echo site_url('sendmail/index');?>">待发送邮件</a></li>
      <li class="<?php if($nav_status=='sent_mail') echo 'active'; ?>"><a style="border-right: none;" href="<?php echo site_url('sendmail/index/1');?>">已发送邮件</a></li>
      <li class="<?php if($nav_status=='loglist') echo 'active'; ?>"><a style="border-right: none;" href="<?php echo site_url('sendmail/log_list');?>">投递失败邮件</a></li>
      <li><a style="border-right: none;" href="<?php echo site_url('sendmail/send_mail');?>" target="_blank">触发邮件发送</a></li>
      <legend style="border:none;margin-top:30px;">HT邮件发送管理</legend>
      <li class="<?php if($nav_status=='failed_nav') echo 'active'; ?>"><a style="border-right: none;" href="<?php echo site_url('sendmail/ht_failed_mail/0');?>">投递失败邮件</a></li>
      <li class="<?php if($nav_status=='unsend_nav') echo 'active'; ?>"><a style="border-right: none;" href="<?php echo site_url('sendmail/ht_failed_mail/2');?>">待发送邮件</a></li>
      <li class="<?php if($nav_status=='success_nav') echo 'active'; ?>"><a style="border-right: none;" href="<?php echo site_url('sendmail/ht_failed_mail/1');?>">已发送邮件</a></li>
      <li><a style="border-right: none;" href="<?php echo site_url('sendmail/is_ht_mail_running');?>" target="_blank">发送程序状态</a></li>
    </ul>
  </div>
  <div class="span10">
      <ul id="myTab" class="nav nav-tabs">
        <li class="active"><a href="#birthday_mail" data-toggle="tab">生日邮件</a></li>
        <li class=""><a href="#batchftp_mail" data-toggle="tab">报价信邮件</a></li>
        <li class=""><a href="#stranded_mail" data-toggle="tab">供应商平台</a></li>
      </ul>
      <div id="myTabContent" class="tab-content">
        <div class="tab-pane fade active in" id="birthday_mail">
        	<?php if(!empty($birthday_mail)){ ?>
		    	<table class="table table-striped">
				  <thead>
				    <tr>
				      <th>#</th>
				      <th>ID</th>
				      <th>发送日期</th>
				      <th>收件人</th>
				      <th>发送者</th>
				      <th>标题</th>
				    </tr>
				  </thead>
				  <tbody>
				    <?php foreach ($birthday_mail as $key_cbc => $cbc) { ?>
				    <tr>
				      <td><?php echo $key_cbc+1; ?></td>
				      <td><?php echo $cbc->CBC_SN; ?></td>
				      <td><?php echo $cbc->CBC_Birthday; ?></td>
				      <td><?php echo $cbc->CBC_CusEmail; ?></td>
				      <td><?php echo $cbc->CBC_SenderName; ?></td>
				      <td><?php $text=get_text_short($cbc->CBC_Subject,40,'...'); echo $text['content']; ?></td>
				    </tr>
				    <?php } ?>
				  </tbody>
				</table>
		    <?php } ?>
        </div>
        <div class="tab-pane fade" id="batchftp_mail">
        	<?php if(!empty($batchftp_mail)){ ?>
		    	<table class="table table-striped">
				  <thead>
				    <tr>
				      <th>#</th>
				      <th>ID</th>
				      <th>发送日期</th>
				      <th>BAT_FileName</th>
				      <th>BAT_Source</th>
				    </tr>
				  </thead>
				  <tbody>
				    <?php foreach ($batchftp_mail as $key_bat => $bat) { ?>
				    <tr>
				      <td><?php echo $key_bat+1; ?></td>
				      <td><?php echo $bat->BAT_SN; ?></td>
				      <td><?php echo $bat->LastEditDate; ?></td>
				      <td><?php echo $bat->BAT_FileName; ?></td>
				      <td><?php echo $bat->BAT_Source; ?></td>
				    </tr>
				    <?php } ?>
				  </tbody>
				</table>
		    <?php } ?>
        </div>
        <div class="tab-pane fade" id="stranded_mail">
        	<?php if(!empty($stranded_mail)){ ?>
		    	<table class="table table-striped">
				  <thead>
				    <tr>
				      <th>#</th>
				      <th>ID</th>
				      <th>发送日期</th>
				      <th>收件人</th>
				      <th>标题</th>
				      <th>内容</th>
				    </tr>
				  </thead>
				  <tbody>
				    <?php foreach ($stranded_mail as $key_m => $m) { ?>
				    <tr>
				      <td><?php echo $key_m+1; ?></td>
				      <td><?php echo $m->M_SN; ?></td>
				      <td><?php echo $m->M_AddTime; ?></td>
				      <td><?php echo $m->M_ToEmail; ?></td>
				      <td><?php echo $m->M_Title; ?></td>
				      <td><?php $text=get_text_short($m->M_Body,40,'...'); echo $text['content']; ?></td>
				    </tr>
				    <?php } ?>
				  </tbody>
				</table>
		    <?php } ?>
        </div>
      </div>
  </div>
</div>