<?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 info(id) {
        var year=$('#year').val();
        var month = $('#month').val();
        var name = $('#name').val();
        window.location.href = '/finance/pay-list3-info?id=' + id + '&year=' + year + '&month=' + month + '&name=' + name;
    }

    $(function(){
        $("#search-btn").click(function(){
            $('#page').val(0);
            var params = $('#searchForm').serialize();
            window.location.href = "/finance/pay-list3?" + params;
        });
        $('#cal-btn').click(function(){
            if(confirm('是否确认提交?')) {
                var params = $("#searchForm").serialize();
                $('#cal-btn').attr('disabled','true');
                $('#cal-btn').val('正在计算中……');
                $.post('/finance/gz-cal2',params,function(obj){
                    alert(obj.msg);
                    window.location.reload();
                },'json');
            }
        });
    });
</script>
<form id="searchForm">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
    <tr>
        <td class="td_bg">
            月份：<input name="year" id="year" type="text" value="<?=$year?>" style="width:100px;">年<select name="month" id="month">
                <option value="01" <?=$month=='01'?'selected':''?>>01</option>
                <option value="02" <?=$month=='02'?'selected':''?>>02</option>
                <option value="03" <?=$month=='03'?'selected':''?>>03</option>
                <option value="04" <?=$month=='04'?'selected':''?>>04</option>
                <option value="05" <?=$month=='05'?'selected':''?>>05</option>
                <option value="06" <?=$month=='06'?'selected':''?>>06</option>
                <option value="07" <?=$month=='07'?'selected':''?>>07</option>
                <option value="08" <?=$month=='08'?'selected':''?>>08</option>
                <option value="09" <?=$month=='09'?'selected':''?>>09</option>
                <option value="10" <?=$month=='10'?'selected':''?>>10</option>
                <option value="11" <?=$month=='11'?'selected':''?>>11</option>
                <option value="12" <?=$month=='12'?'selected':''?>>12</option>
            </select>
            工号：<input id="name" name="name" type="text" value="<?=$name?>" style="width:100px;">
            <input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
            <input type="button" class="act_btn" id="cal-btn" name="cal-btn" value="重新计算">
        </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 align="center" class="bg_tr" nowrap>保单配送数</td>
        <td align="center" class="bg_tr" nowrap>每单提奖</td>
        <td align="center" class="bg_tr" nowrap>基本工资</td>
        <td align="center" class="bg_tr" nowrap>话补</td>
        <td 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>
    </tr>
    <?php
    foreach($items as $index => $item) {
        ?>
        <tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
            <td align="center" class="td_bg"nowrap ><?=$item['showname']?></td>
            <td align="center" class="td_bg" nowrap><?=$item['send_count']?></td>
            <td align="center" class="td_bg" nowrap><input type="text" name="prices[<?=$item['id']?>]" value="<?=$item['price']?>" style="width: 70px;"></td>
            <td align="center" class="td_bg" nowrap><input type="text" name="base_moneys[<?=$item['id']?>]" value="<?=$item['base_money']?>" style="width: 70px;"></td>
            <td align="center" class="td_bg" nowrap><input type="text" name="phone_moneys[<?=$item['id']?>]" value="<?=$item['phone_money']?>" style="width: 70px;"></td>
            <td align="center" class="td_bg" nowrap><input type="text" name="other_moneys[<?=$item['id']?>]" value="<?=$item['other_money']?>" style="width: 70px;"></td>
            <td align="center" class="td_bg" nowrap><?=$item['pay_money']?></td>
            <td align="center" class="td_bg" nowrap>
                [<a href="javascript:void(0);" onclick="info(<?=$item['id']?>)">详情</a>]
            </td>
        </tr>
        <?php
    }
    ?>
</table>
</form>
