<?php
use \common\libs\MyLib;
?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
    $(function(){
        //返回按钮
        $('#back-btn').click(function(){
            window.location.href='/finance/pay-list3?year=<?=$year?>&month=<?=$month?>&name=<?=$name?>';
        });
        //导出Excel
        $('#export-btn').click(function(){
            var params = $('#theFrm').serialize();
            window.open('/finance/pay-list3-info-export?' + params);
        });
    });
</script>
<form id="theFrm">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
    <input type="hidden" name="sale_id" value="<?=$info->id?>">
    <input type="hidden" name="year" value="<?=$year?>">
    <input type="hidden" name="month" value="<?=$month?>">
    <tr>
        <td class="bg_tr">工号:</td>
        <td class="td_bg"><?=$info->username?></td>
        <td class="bg_tr">真实姓名:</td>
        <td class="td_bg"><?=$info->name?></td>
        <td class="bg_tr">工资月份:</td>
        <td class="td_bg"><?=$year.'-'.$month?></td>
        <td colspan="2" class="td_bg">
            <input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 ">
            <input id="export-btn" type="button" class="ACT_btn" name="Submit3" value=" 导出Excel ">
        </td>
    </tr>
    <tr>
        <td class="bg_tr">每单提奖:</td>
        <td class="td_bg"><?=$gz_info?$gz_info->price:0?></td>
        <td class="bg_tr">基本工资:</td>
        <td class="td_bg"><?=$gz_info?$gz_info->base_money:0?></td>
        <td class="bg_tr">话补:</td>
        <td class="td_bg"><?=$gz_info?$gz_info->phone_money:0?></td>
        <td class="bg_tr">其他:</td>
        <td class="td_bg"><?=$gz_info?$gz_info->other_money:0?></td>
        <td class="bg_tr">应发:</td>
        <td class="td_bg"><?=$gz_info?$gz_info->pay_money:0?></td>
    </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
    <tr>
        <td width="24" align="center" class="bg_tr" nowrap>序号</td>
        <td width="50" align="center" class="bg_tr" nowrap>车牌号码</td>
        <td width="60" align="center" class="bg_tr" nowrap>被保险人</td>
        <td width="60" align="center" class="bg_tr" nowrap>保险起期</td>
        <td width="80" align="center" class="bg_tr" nowrap>商业签单</td>
        <td align="center" class="bg_tr" nowrap>跟单手续费</td>
        <td width="60" align="center" class="bg_tr" nowrap>交强签单</td>
        <td align="center" class="bg_tr" nowrap>跟单手续费</td>
        <td width="60" align="center" class="bg_tr" nowrap>商交实收</td>
        <td width="60" align="center" class="bg_tr" nowrap>共计签单</td>
        <td width="60" align="center" class="bg_tr" nowrap>实收金额</td>
        <td width="60" align="center" class="bg_tr" nowrap>优惠金额</td>
        <td width="60" align="center" class="bg_tr" nowrap>优惠率</td>
        <td width="60" align="center" class="bg_tr" nowrap>保险公司</td>
        <td width="60" align="center" class="bg_tr" nowrap>正本日期</td>
        <td width="60" align="center" class="bg_tr" nowrap>车主</td>
        <td width="60" align="center" class="bg_tr" nowrap>联系人</td>
    </tr>
    <?php
    foreach($items as $index => $item) {
        $order_info = $item->order;
        ?>
        <tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
            <td align="center" class="td_bg"nowrap ><?=$index+1?></td>
            <td class="td_bg" nowrap><?=$order_info->car_no?></td>
            <td class="td_bg" nowrap><?=$order_info->id_man?></td>
            <td class="td_bg" nowrap><?=$order_info->insurer1_begin_date?></td>
            <td class="td_bg" nowrap><?=$order_info->total1_clear?></td>
            <td class="td_bg" nowrap><?=$order_info->total1_rate?></td>
            <td class="td_bg" nowrap><?=$order_info->total2?></td>
            <td class="td_bg" nowrap><?=$order_info->total2_rate?></td>
            <td class="td_bg" nowrap><?=$order_info->total_real - $order_info->total3?></td>
            <td class="td_bg" nowrap><?=$order_info->total_all?></td>
            <td class="td_bg" nowrap><?=$order_info->total_real?></td>
            <td class="td_bg" nowrap><?=$order_info->total1_dis?></td>
            <td class="td_bg" nowrap><?=$order_info->total1_percent?></td>
            <td class="td_bg" nowrap><?=$order_info->company?$order_info->company->name:''?></td>
            <td class="td_bg" nowrap><?=$order_info->print_date?></td>
            <td class="td_bg" nowrap><?=$order_info->car_man?></td>
            <td class="td_bg" nowrap><?=$order_info->link_man?></td>
        </tr>
        <?php
    }
    ?>
</table>
</form>
