<?php
use \common\libs\MyLib;
use \common\models\PriceT;
?>
<link href="/css/tabs.css" rel="stylesheet" type="text/css">
<link href="/css/account.css" rel="stylesheet" type="text/css">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
    <tr>
        <td colspan="13" height="22" class="td_bg">
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TBODY>
                <TR>
                    <TD height="30" align="center" class="tab-on" name="navcell"><?=$year?>年<?=$month?>月工资信息</TD>
                </TR>
                </TBODY>
            </TABLE>
        </td>
    </tr>
    <tr>
        <td height="22" colspan="2" class="td_bg">
            <table width="100%" align="center" height="120" border="0" cellpadding="0" cellspacing="0" id="mainTable">
                <tr>
                    <td height="120" valign="top" class="td_bg">
                        <TABLE id=tb cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
                            <TR>
                                <TD vAlign=top>
                                    <form id="orderFrm">
                                        <div class="big_box">
                                            <div style="width:98%; margin: 0 auto;">
                                                <h3 onclick="show('Box1')">
                                                    <span id="OnBox1Title">人事</span>
                                                    <span id="OnBox1">▼</span>
                                                    <span id="OffBox1Title" style="display:none">人事</span>
                                                    <span id="OffBox1" style="display:none">▲</span>
                                                </h3>
                                            </div>
                                            <div id="Box1" style="margin-bottom: 20px;">
                                                <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
                                                    <tr class="bg_tr" align="center">
                                                        <td>职务</td>
                                                        <td>姓名</td>
                                                        <td>入职时间</td>
                                                        <td>试用时间</td>
                                                        <td>工作制</td>
                                                        <td>试用工资</td>
                                                        <td>转正时间</td>
                                                        <td>转正工资</td>
                                                    </tr>
                                                    <tr class="td_bg" align="center">
                                                        <td><?=$user_info->group->name?></td>
                                                        <td><?=$user_info->name?></td>
                                                        <td><?=$user_info->entry_time?date('Y-m-d',strtotime($user_info->entry_time)):'----'?></td>
                                                        <td><?=$user_info?$user_info->trialTime:''?></td>
                                                        <td><?=$user_info?$user_info->workCycle:''?></td>
                                                        <td><?=$user_info?$user_info->trial_wages:'----'?></td>
                                                        <td><?=$user_info->formal_time?date('Y-m-d',strtotime($user_info->formal_time)):'----'?></td>
                                                        <td><?=$user_info?$user_info->formal_wages:'----'?></td>
                                                    </tr>
                                                </table>
                                                <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
                                                    <tr class="bg_tr" align="center">
                                                        <td colspan="13">应发</td>
                                                    </tr>
                                                    <tr class="bg_tr" align="center">
                                                        <td>基本工资</td>
                                                        <td>职务工资</td>
                                                        <td>岗位工资</td>
                                                        <td>考勤</td>
                                                        <td>通时</td>
                                                        <td>提成</td>
                                                        <td>业绩激励</td>
                                                        <td>奖金</td>
                                                        <td>加班</td>
                                                        <td>交通</td>
                                                        <td>话费</td>
                                                        <td>组长</td>
                                                        <td>社保补助</td>
                                                    </tr>
                                                    <tr class="td_bg" align="center">
                                                        <td><?=$wage_info?$wage_info->basic_wages:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->duties_wages:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->post_wages:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->check_work:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->call_long:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->commission:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->encourage:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->reward:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->overtime:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->traffic:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->bill:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->leader:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->subsidy:'----'?></td>
                                                    </tr>
                                                </table>
                                                <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
                                                    <tr class="bg_tr" align="center">
                                                        <td colspan="6">应扣</td>
                                                    </tr>
                                                    <tr class="bg_tr" align="center">
                                                        <td>迟到</td>
                                                        <td>社保</td>
                                                        <td>罚款</td>
                                                        <td>电费</td>
                                                        <td>离职押金</td>
                                                        <td>公积金</td>
                                                    </tr>
                                                    <tr class="td_bg" align="center">
                                                        <td><?=$wage_info?$wage_info->late:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->subsidy_ded:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->punish:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->electricity_fees:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->quit_deposit:'----'?></td>
                                                        <td><?=$wage_info?$wage_info->accumulation_fund:'----'?></td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                        <div class="big_box">
                                            <div style="width:98%; margin: 0 auto;">
                                                <h3 onclick="show('Box2')">
                                                    <span id="OnBox2Title">新保</span>
                                                    <span id="OnBox2">▼</span>
                                                    <span id="OffBox2Title" style="display:none;">新保</span>
                                                    <span id="OffBox2" style="display:none;">▲</span>
                                                </h3>
                                            </div>
                                            <div id="Box2" style="margin-bottom: 20px;">
                                                <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
                                                    <tr class="bg_tr" align="center">
                                                        <td width="3%">序号</td>
                                                        <td>车牌号</td>
                                                        <td>商业签单</td>
                                                        <td>提奖</td>
                                                        <td>提奖金额</td>
                                                        <td>优惠金额</td>
                                                        <td>礼品金额</td>
                                                        <td width="3%">详情</td>
                                                    </tr>
                                                    <?php
                                                    if($user_info->group->id != 31){
                                                        $total1_clear = 0;
                                                        $total1_dis = 0;
                                                        $total_tc = 0;
                                                        foreach($items as $k=>$item){
                                                            $total1_clear += $item->total1_clear;
                                                            $total1_dis += $item->total1_dis;
                                                            $tj = number_format($item->total1_clear * ($item->tijiang - (1-$item->total1_percent)*100) / 100,2);
                                                            $total_tc += $tj;
    //                                                        $tj = ($item->total1_clear * ($item->tijiang - (1-$item->total1_percent)*100) / 100);
    //                                                        $total_tc += $tj;
                                                        ?>
                                                        <tr class="td_bg" align="center">
                                                            <td><?=$k+1?></td>
                                                            <td><?=$item->car_no?></td>
                                                            <td><?=$item->total1_clear?></td>
                                                            <td><input type="Text" name="tj[<?=$item->id?>]" value="<?=$item->tijiang?>" style="width:50px;"></td>
                                                            <td><?=$tj?></td>
                                                            <td><?=$item->total1_dis?></td>
                                                            <td>礼品金额</td>
                                                            <td><a href="javascript:;"> [<a href="/insurer/info?id=<?=$item->id?>" target="_blank">详情</a>] </a></td>
                                                        </tr>
                                                    <?php } ?>
                                                    <tr class="bg_tr" align="center">
                                                        <td width="3%"></td>
                                                        <td></td>
                                                        <td><?=number_format($total1_clear,2)?></td>
                                                        <td></td>
                                                        <td><?=$total_tc?></td>
                                                        <td><?=number_format($total1_dis,2)?></td>
                                                        <td></td>
                                                        <td width="3%"></td>
                                                    </tr>
                                                    <?php } ?>
                                                </table>
                                            </div>
                                        </div>
                                        <div class="big_box">
                                            <div style="width:98%; margin: 0 auto;">
                                                <h3 onclick="show('Box3')">
                                                    <span id="OnBox3Title">续保</span>
                                                    <span id="OnBox3">▼</span>
                                                    <span id="OffBox3Title" style="display:none;">续保</span>
                                                    <span id="OffBox3" style="display:none;">▲</span>
                                                </h3>
                                            </div>
                                            <div id="Box3" style="margin-bottom: 20px;">
                                                <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
                                                    <tr class="bg_tr" align="center">
                                                        <td width="3%">序号</td>
                                                        <td>车牌号</td>
                                                        <td>商业签单</td>
                                                        <td>提奖</td>
                                                        <td>提奖金额</td>
                                                        <td>优惠金额</td>
                                                        <td>礼品金额</td>
                                                        <td width="3%">详情</td>
                                                    </tr>
                                                    <?php
                                                    if($user_info->group->id == 31){
                                                        $total1_clear = 0;
                                                        $total1_dis = 0;
                                                        $total_tc = 0;
                                                        foreach($items as $k=>$item){
                                                            $total1_clear += $item->total1_clear;
                                                            $total1_dis += $item->total1_dis;
                                                            $tj = number_format($item->total1_clear * ($item->tijiang - (1-$item->total1_percent)*100) / 100,2);
                                                            $total_tc += $tj;
    //                                                        $tj = ($item->total1_clear * ($item->tijiang - (1-$item->total1_percent)*100) / 100);
    //                                                        $total_tc += $tj;
                                                            ?>
                                                        <tr class="td_bg" align="center">
                                                            <td><?=$k+1?></td>
                                                            <td><?=$item->car_no?></td>
                                                            <td><?=$item->total1_clear?></td>
                                                            <td><input type="Text" name="tj[<?=$item->id?>]" value="<?=$item->tijiang?>" style="width:50px;"></td>
                                                            <td><?=$tj?></td>
                                                            <td><?=$item->total1_dis?></td>
                                                            <td>礼品金额</td>
                                                            <td><a href="javascript:;"> [<a href="/insurer/info?id=<?=$item->id?>" target="_blank">详情</a>] </a></td>
                                                        </tr>
                                                    <?php } ?>
                                                    <tr class="bg_tr" align="center">
                                                        <td width="3%"></td>
                                                        <td></td>
                                                        <td><?=number_format($total1_clear,2)?></td>
                                                        <td></td>
                                                        <td><?=$total_tc?></td>
                                                        <td><?=number_format($total1_dis,2)?></td>
                                                        <td></td>
                                                        <td width="3%"></td>
                                                    </tr>
                                                    <?php } ?>
                                                </table>
                                            </div>
                                        </div>
                                        <div class="big_box">
                                            <div style="width:98%; margin: 0 auto;">
                                                <h3 onclick="show('Box4')">
                                                    <span id="OnBox4Title">送单</span>
                                                    <span id="OnBox4">▼</span>
                                                    <span id="OffBox4Title" style="display:none;">送单</span>
                                                    <span id="OffBox4" style="display:none;">▲</span>
                                                </h3>
                                            </div>
                                            <div id="Box4" style="margin-bottom: 20px;">
                                                <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
                                                    <tr class="bg_tr" align="center">
                                                        <td width="3%">序号</td>
                                                        <td>车牌号</td>
                                                        <td>被保险人</td>
                                                        <td>送单地址</td>
                                                        <td>时间</td>
                                                        <td width="3%">详情</td>
                                                    </tr>
                                                    <?php foreach($send_list as $k=>$v){ ?>
                                                    <tr class="td_bg" align="center">
                                                        <td width="3%"><?=$k+1?></td>
                                                        <td><?=$v->order->car_no?></td>
                                                        <td><?=$v->order->car_man?></td>
                                                        <td><?=$v->order->send_address2?></td>
                                                        <td><?=date('Y-m-d H:i:s',$v->send_time)?></td>
                                                        <td><a href="javascript:;"> [<a href="/insurer/info?id=<?=$v->order_id?>" target="_blank">详情</a>] </a></td>
                                                    </tr>
                                                    <?php } ?>
                                                </table>
                                            </div>
                                        </div>
                                        <div class="big_box">
                                            <div style="width:98%; margin: 0 auto;">
                                                <h3 onclick="show('Box5')">
                                                    <span id="OnBox5Title">修车一</span>
                                                    <span id="OnBox5">▼</span>
                                                    <span id="OffBox5Title" style="display:none;">修车一</span>
                                                    <span id="OffBox5" style="display:none;">▲</span>
                                                </h3>
                                            </div>
                                            <div id="Box5" style="margin-bottom: 20px;">

                                            </div>
                                        </div>
                                        <div class="big_box">
                                            <div style="width:98%; margin: 0 auto;">
                                                <h3 onclick="show('Box6')">
                                                    <span id="OnBox6Title">修车二</span>
                                                    <span id="OnBox6">▼</span>
                                                    <span id="OffBox6Title" style="display:none;">修车二</span>
                                                    <span id="OffBox6" style="display:none;">▲</span>
                                                </h3>
                                            </div>
                                            <div id="Box6" style="margin-bottom: 20px;">

                                            </div>
                                        </div>
                                        <div class="big_box">
                                            <div style="width:98%; margin: 0 auto;">
                                                <h3 onclick="show('Box7')">
                                                    <span id="OnBox7Title">接送车</span>
                                                    <span id="OnBox7">▼</span>
                                                    <span id="OffBox7Title" style="display:none;">接送车</span>
                                                    <span id="OffBox7" style="display:none;">▲</span>
                                                </h3>
                                            </div>
                                            <div id="Box7" style="margin-bottom: 20px;">
                                                <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
                                                    <tr class="bg_tr" align="center">
                                                        <td width="3%">序号</td>
                                                        <td>车牌号</td>
                                                        <td>被保险人</td>
                                                        <td>地址</td>
                                                        <td>接送时间</td>
                                                        <td width="3%">详情</td>
                                                    </tr>
                                                    <?php
                                                        foreach($receive_list as $ke=>$va){
                                                    ?>
                                                        <tr class="td_bg" align="center">
                                                            <td width="3%"><?=$ke+1?></td>
                                                            <td><?=$va->car_no?></td>
                                                            <td><?=$va->id_man?></td>
                                                            <td><?=$va->address?></td>
                                                            <td>还没弄</td>
                                                            <td><a href="javascript:;"> [<a href="/insurer/info?id=<?=$va->id?>" target="_blank">详情</a>] </a></td>
                                                        </tr>
                                                    <?php
                                                        }
                                                    ?>
                                                </table>
                                            </div>
                                        </div>
                                    </form>
                                </TD>
                            </TR>
                        </TABLE>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td height="22" colspan="2" align="center" class="td_bg">
            <input id="back-btn" type="button" class="ACT_btn" name="Submit3" value=" 返回 ">
        </td>
    </tr>
</table>

<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>
//    $(function(){
//        var department_list = '<?//= $this->context->department ?>//';
//        var department = JSON.parse(department_list);
//        digui(department)
//    });
//    //递归函数
//    function digui(department){
//        var group_id = '<?//= $group_id ?>//';
//        $.each(department,function(index,obj){
//            if(group_id == obj.id){
//                var content = "<option value='"+obj.id+"'>"+obj.name+"</option>";
//                $(".department").html(content);
//            }else{
//                digui(obj.child);
//            }
//        });
//    }
    //点击隐藏显示
    function show(a){

        $("#"+a).slideToggle(function(){
            $("#Off"+a+",#Off"+a+"Title").toggle();
            $("#On"+a+",#On"+a+"Title").toggle();
        });
    }
    //返回按钮
    $("#back-btn").click(function(){
        window.location.href = "/finance/pay-list-new?<?=$back_params?>";
    });
</script>