<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=<!--{$page_charset}-->" />
    <title>产品内容</title>
    <!--{include file="<!--{$cptplpath}-->headerjs.tpl"}-->
    <!--{assign var='pluginevent' value=XHook::doAction('adm_head')}-->
</head>
<body>
<div class="main-wrap">
    <div class="main-cont">
        <table cellpadding='1' cellspacing='1' class='tab'>
            <tr>
                <td class='hback'>
                    <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td><input type="text" name="uploadfiles" id="uploadfiles" class="input-txt"  value="<!--{$value}-->" /> <span id='duploadfiles' class='f_red'></span></td>
                            <td>
                                <iframe id='iframe_t' border='0' frameborder='0' scrolling='no' style="width:260px;height:25px;padding:0px;margin:0px;" src='<!--{$cpfile}-->?c=upload&formname=myform&module=product&uploadinput=uploadfiles&thumbinput=thumbfiles&multipart=sf_upload&previewid=previewsrc'></iframe>
                            </td>
                        </tr>
                    </table>
                    上传图片只支持：gif,jpeg,jpg,png格式
                </td>
            </tr>
            <input type="hidden" id="type" value="<!--{$type}-->"/>
            <input type="hidden" id="id" value="<!--{$id}-->"/>
            <tr style="float: left;">
                <td class='hback_none'></td>
                <td class='hback_none'><input type="submit" name="btn_save" class="button" value="添加保存" /></td>
            </tr>
        </table>
        </form>
    </div>
    <div style="clear:both;"></div>
</div>
<script type="application/javascript">
    $("[name=btn_save]").bind("click", function () { //提交
        var img=$('#uploadfiles').val();
        var type=$('#type').val();
        var id=$('#id').val();
        $.ajax({
            url: "admincp.php?c=ui_set&a=save_ajax_img",
            type: "post",
            data:{type:type,id:id,text:img},
            dataType: "json",
            success: function (data) {
                if(data.response=='1'){
                    layer.msg(data.result);
                    setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
                        window.close();
                        parent.location.reload();

                    },2000);
                }else {
                    layer.msg(data.result);
                }
                //  window.location.href = "index.php";
            },
            error: function (e) {
                //  window.location.href = "index.php";
            }
        });
    });

</script>

</body>
</html>
