<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
    <form id="theFrm">
        <tr>
            <td height="25" class="td_bg">
                车牌号
                <input name="car_no" type="text" id="car_no" value="" style="width:100px;"/>
            </td>
        </tr>
        <?php
        $index = 0;
        foreach($type_items as $item) {
            ?>
            <tr>
                <td height="25" class="td_bg">
                    <label>
                        <input type="checkbox" name="types[<?=$index?>]" value="<?=$item->id?>"><?=$item->name?>
                    </label>
                    <input name="codes[<?=$index?>]" type="text" value="" style="width:100px;"/>
                </td>
            </tr>
            <?php
            $index++;
        }
        ?>
        <tr>
            <td height="25" class="td_bg">
                <select name="types[<?=$index?>]">
                    <option value="0">---请选择---</option>
                    <?php
                    foreach($type_items as $item) {
                        echo '<option value="'.$item->id.'">'.$item->name.'</option>';
                    }
                    ?>
                </select>
                <input name="codes[<?=$index++?>]" type="text" value="" style="width:100px;"/>
            </td>
        </tr>
        <tr>
            <td height="25" class="td_bg">
                <select name="types[<?=$index?>]">
                    <option value="0">---请选择---</option>
                    <?php
                    foreach($type_items as $item) {
                        echo '<option value="'.$item->id.'">'.$item->name.'</option>';
                    }
                    ?>
                </select>
                <input name="codes[<?=$index++?>]" type="text" value="" style="width:100px;"/>
            </td>
        </tr>
        <tr>
            <td height="25" class="td_bg">
                <select name="types[<?=$index?>]">
                    <option value="0">---请选择---</option>
                    <?php
                    foreach($type_items as $item) {
                        echo '<option value="'.$item->id.'">'.$item->name.'</option>';
                    }
                    ?>
                </select>
                <input name="codes[<?=$index++?>]" type="text" value="" style="width:100px;"/>
            </td>
        </tr>
        <tr>
            <td height="25" class="td_bg">
                <select name="types[<?=$index?>]">
                    <option value="0">---请选择---</option>
                    <?php
                    foreach($type_items as $item) {
                        echo '<option value="'.$item->id.'">'.$item->name.'</option>';
                    }
                    ?>
                </select>
                <input name="codes[<?=$index++?>]" type="text" value="" style="width:100px;"/>
            </td>
        </tr>
    </form>
    <tr>
        <td height="22" colspan="4" align="center" class="td_bg">
            <input id="output-btn" type=button class="ACT_btn" name=Submit1 value=" 出库 "/>
            &nbsp;&nbsp;
            <input id="back-btn" type="button" class="ACT_btn" name="Submit4" 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/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
    $(function () {
        //出库按钮
        $("#output-btn").click(function(){
            if(confirm('是否确认提交?')) {
                var params = $("#theFrm").serialize();
                params += '&status=1';
                $.post('/gift2/output-save',params,function(obj){
                    alert(obj.msg);
                    if(obj.success) {
                        $('#back-btn').click();
                    }
                },'json');
            }
        });

        //返回按钮
        $('#back-btn').click(function(){
            window.location.href='/gift2/gift1-index';
        });
    })
</script>
