{include file="public/seller_top" /} 
<div class="seller_main w1200">
    {include file="public/seller_left" /}
    <div class="seller_right">
        <div class="seller_items">
            {include file="public/seller_items" /}
        </div>
        
        
   
        
<style>
.bill-alert-block {
    padding-bottom: 14px;
    padding-top: 14px;
}
.bill_alert {
    background-color: #F9FAFC;
    border: 1px solid #F1F1F1;
    margin-bottom: 20px;
    padding: 8px 35px 8px 14px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
	line-height:30px;
}
</style>
  <div class="bill_alert bill-alert-block mt10">
    <div style="width:800px"><h3 style="float:left">本期结算</h3><div style="float:right;">
    <?php if ($bill_info['ob_state'] == BILL_STATE_CREATE){?>
    <a class="dssc-btn mt5" onclick="ajax_get_confirm('一旦确认将无法恢复，系统将自动进入结算环节,<BR/>确认系统出账单计算无误吗?', "{:url('/home/sellervrbill/confirm_bill',['ob_no'=>$Think.param.ob_no])}");" href="javascript:void(0)">本期结算无误，我要确认</a>
    <?php } elseif ($bill_info['ob_state'] == BILL_STATE_SUCCESS) {?>
    <a class="dssc-btn mt5" target="_blank" href="{:url('/home/sellervrbill/bill_print',['ob_no'=>$Think.param.ob_no])}">打印结算单</a>
    <?php } ?>
    </div>
    <div style="clear:both"></div>
    </div>
    <ul>
      <li>结算单号：<?php echo $bill_info['ob_no'];?>&emsp;
      <?php echo date('Y-m-d',$bill_info['ob_start_date']);?> &nbsp;至&nbsp; <?php echo date('Y-m-d',$bill_info['ob_end_date']);?></li>
      <li>出账时间：<?php echo date('Y-m-d',$bill_info['ob_create_date']);?></li>
      <li>本期应收：<?php echo $bill_info['ob_result_totals'];?> = <?php echo $bill_info['ob_order_totals'];?> (消费金额) - <?php echo $bill_info['ob_commis_totals'];?> (佣金金额)</li>
      <li>结算状态：<?php echo billState($bill_info['ob_state']);?>
      <?php if ($bill_info['ob_state'] == BILL_STATE_SUCCESS){?>
      	，结算日期：<?php echo date('Y-m-d',$bill_info['ob_pay_date']);?>
      <?php }?>
      </li>
    </ul>
  </div>
        <div class="seller_items">
            {include file="public/seller_items" /}
        </div>



  <form method="get" id="formSearch">
    <table class="search-form">
      <input type="hidden" name='ob_no' value='{$Think.param.ob_no}' />
      <input type="hidden" name='type' value='{$Think.get.type}' />
      <tr>
        <td>&nbsp;</td>
        <th>订单编号</th>
        <td class="w180"><input type="text" class="text"  value="{$Think.get.query_order_no}" name="query_order_no" /></td>
        <th>{if condition="$Think.get.type eq 'timeout'"}过期时间{else/}消费时间{/if}</th>
        <td class="w180">
        	<input type="text" class="text w70" name="query_start_date" id="query_start_date" value="{$Think.get.query_start_date}"/>
          &#8211;
          <input type="text" class="text w70" name="query_end_date" id="query_end_date" value="{$Think.get.query_end_date}"/>
        </td>
        <td class="tc w200">
        <label class="submit-border"><input type="button" id="ncsubmit" class="submit" value="{$Think.lang.ds_search}" /></label>
        <label class="submit-border"><input type="button" id="ncexport" class="submit" value="导出" /></label>
        </td>
    </table>
  </form>
<table class="dssc-default-table">
    <thead>
      <tr>
        <th class="w10"></th>
        <th>兑换码</th>
        <th>{if condition="$Think.get.type eq 'timeout'"}过期时间{else/}消费时间{/if}</th>
        <th>会员</th>
        <th>订单号</th>
        <th>消费金额</th>
        <th>佣金金额</th>
        <th>{$Think.lang.ds_handle}</th>
      </tr>
    </thead>
    <tbody>
      <?php if (is_array($code_list) && !empty($code_list)) { ?>
      <?php foreach($code_list as $code_info) { ?>
      <tr class="bd-line">
        <td></td>
        <td class="w90"><?php echo $code_info['vr_code'];?></td>
        <td>
        {if condition="$Think.get.type eq 'timeout'"}
        <?php echo date("Y-m-d H:i:s",$code_info['vr_indate']);?></td>
        {else/}
        <?php echo date("Y-m-d H:i:s",$code_info['vr_usetime']);?></td>
        {/if}
        <td><?php echo $order_list[$code_info['order_id']]['buyer_name'];?></td>
        <td><?php echo $order_list[$code_info['order_id']]['order_sn'];?></td>
        <td><?php echo $code_info['pay_price'];?></td>
        <td><?php echo dsPriceFormat($code_info['pay_price'] * $code_info['commis_rate']/100);?></td>
        <td>
       	<a target="_blank" href="{:url('/home/sellervrorder/show_order',['order_id'=>$code_info.order_id])}">{$Think.lang.ds_view}</a>
        </td>
      </tr>
      <?php } ?>
      <?php } else { ?>
      <tr>
        <td colspan="20" class="norecord"><i>&nbsp;</i><span>{$Think.lang.no_record}</span></td>
      </tr>
      <?php } ?>
    </tbody>
    <tfoot>
      <?php if (is_array($code_list) && !empty($code_list)) { ?>
      <tr>
        <td colspan="20"><div class="pagination">分页带完善</div></td>
      </tr>
      <?php } ?>
    </tfoot>
  </table>
<script type="text/javascript">
$(function(){
    $('#ncexport').click(function(){
    	$('input[name="op"]').val('export_order');
    	$('#formSearch').submit();
    });
    $('#ncsubmit').click(function(){
    	$('input[name="op"]').val('show_bill');
    	$('#formSearch').submit();
    });
});
</script>




<script type="text/javascript">
$(document).ready(function(){
	$('#query_start_date').datepicker({dateFormat: 'yy-mm-dd'});
	$('#query_end_date').datepicker({dateFormat: 'yy-mm-dd'});
});
</script> 
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    </div>
</div>
{include file="public/mall_footer" /}