<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" src="/js/common.js"></script>
<?php if(count($items) > 0 ): ?>
<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 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->fix->car_no ?></td>
            <td align="left" class="td_bg" nowrap><?= $item->fix->brand ? $item->fix->brand->name : '' ?></td>
            <td align="left" class="td_bg" nowrap><?= $item->fix->series ? $item->fix->series->name : '' ?></td>
            <td align="left" class="td_bg" nowrap><?= $item->fix->link_man ?></td>
            <td align="left" class="td_bg" nowrap><?= $item->fix->accident_type ?></td>
            <td align="left" class="td_bg" nowrap><?= $item->fix->finish_date ?></td>
            <td align="left" class="td_bg" nowrap><?= $item->fix->getStatus() ?></td>
            <td align="center" class="td_bg" nowrap>
                [<a href="javascript:void(0);" onclick="edit(<?= $item->fix->id ?>,'<?= $type_name ?>')">详情</a>]
            </td>
        </tr>
    <?php endforeach; ?>
</table>
<?php endif; ?>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
    <tr>
        <td height="25" colspan="9" align="center" class="td_bg"><input onclick="backBtn()" type="button" class="act_btn" value="返回"></td>
    </tr>
</table>
<script type="text/javascript" language="javascript">
    //编辑
    function edit(fixId, typeName) {
        window.location.href = '/fix-car-item/item-list-info?fix_id=' + fixId + '&type_name=' + typeName;
    }
   //领取操作
    function getItem(itemId,typeName){
        if(id <= 0 ) return false;
        $.post('/fix-car-item/get-item',{fix_id:itemId,type_name:typeName},function(data){
            console.log(data);
        });
    }

    //返回
    function backBtn(){
        window.location.href = '<?= $redirect ?>';
    }
</script>