<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
    <form id="theFrm">
        <tr>
            <td width="100" height="25" class="td_bg">编号</td>
            <td height="25" class="td_bg">
                从<input name="min_code" type="text" id="min_code" value="" style="width:50px;"/>
                到<input name="max_code" type="text" id="max_code" value="" style="width:50px;"/>
            </td>
        </tr>
        <tr>
            <td width="100" height="25" class="td_bg">所属分类</td>
            <td height="25" class="td_bg">
                <select name="type_id">
                    <option value="0">---请选择---</option>
                    <?php
                    foreach($type_items as $item) {
                        echo '<option value="'.$item->id.'">'.$item->name.'</option>';
                    }
                    ?>
                </select>
            </td>
        </tr>
    </form>
    <tr>
        <td height="22" colspan="4" align="center" class="td_bg">
            <input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/>
            &nbsp;&nbsp;
            <input id="back-btn" type="button" class="ACT_btn" name="Submit2" 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 () {
        //提交按钮
        $("#submit-btn").click(function(){
            if(confirm('是否确认提交?')) {
                var params = $("#theFrm").serialize();
                $.post('/gift2/add-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>
