<?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/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
    //编辑
    function edit(id) {
        window.location.href = '/non-auto-insurance/bd-info?id=' + id;
    }
    //删除
    function del(id) {
        if(confirm('是否确认删除?')) {
            $.post('/fix-car/my-list-delete',{id:id},function(obj){
                alert(obj.msg);
                if(obj.success) {
                    window.location.reload();
                }
            },'json');
        }
    }
    $(function(){
//        $("#search-btn").click(function(){
//            var params = $('#searchForm').serialize();
//            window.location.href = "/fix-car/my-list?" + params;
//        });
//        $('#add-btn').click(function(){
//            window.location.href = '/non-auto-insurance/my-search';
//        });
        //返回按钮
        $('#back-btn').click(function(){
            window.location.href='/non-auto-insurance/my-search';
        });
    });
</script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
    <form id="searchForm">
        <tr>
            <td class="td_bg">
                搜索结果
                <input type="button" class="act_btn" id="back-btn" name="back-btn" value="返回">
            </td>
        </tr>
    </form>
</table>

<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
    <tr>
        <td width="50" align="center" align="center" class="bg_tr" nowrap>排序</td>
        <td align="center" align="center" class="bg_tr">被保险人</td>
        <td align="center" align="center" class="bg_tr">被保险人证件号</td>
        <td align="center" align="center" class="bg_tr">投保人</td>
        <td align="center" align="center" class="bg_tr">投保人证件号</td>
        <td width="30" align="center" class="bg_tr">操作</td>
    </tr>
    <?php
    foreach($items as $index => $item) {
        ?>
        <tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
            <td align="center" class="td_bg" nowrap><?=$index+1?></td>
            <td align="left" class="td_bg" nowrap><?=$item->insurant_name?></td>
            <td align="left" class="td_bg" nowrap><?=$item->insurant_number?></td>
            <td align="left" class="td_bg" nowrap><?=$item->policy_holder_name?></td>
            <td align="left" class="td_bg" nowrap><?=$item->policy_holder_number?></td>
            <td align="center" class="td_bg" nowrap>

                [<a href="javascript:void(0);" onclick="edit(<?= $item->id ?>)">添加非车险保单记录</a>]

            </td>
        </tr>
        <?php
    }
    ?>

</table>
