

<div class="layuimini-main">

    <div class="layui-form">
      
         

        


   
       <?
         $title="头部背景图";
         $field="headbg";
         $name="img[headbg]";
         $fvalue=$webset['img']['headbg'];
        include(ADMINROOT.'/template/tpl/inputimg.tpl.php'); //
       ?>

      
        <?
         $title="首页横图1";
         $field="indexbg1";
         $name="img[indexbg1]";
         $fvalue=$webset['img']['indexbg1'];
        include(ADMINROOT.'/template/tpl/inputimg.tpl.php'); //
       ?>

       <?
         $title="首页横图2";
         $field="indexbg2";
         $name="img[indexbg2]";
         $fvalue=$webset['img']['indexbg2'];
        include(ADMINROOT.'/template/tpl/inputimg.tpl.php'); //
       ?>
     
     

        <div class="layui-form-item">
            <div class="layui-input-block">
             
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn" name="sub">确认保存</button>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form','laydate', 'table','miniAdmin'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            laydate = layui.laydate,
			miniAdmin = layui.miniAdmin,
            $ = layui.jquery;
    
        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();
      
         laydate.render({
             elem: '#sdate'
        });
		 form.on('submit(saveBtn)', function (data) {
		     layer.load(2);
             data.field.sub=1
			 $.post("index.php?mod=webset&act=set",data.field, function(res) {
					   layer.closeAll('loading');
					   if (res.code==0)
						    miniAdmin.success("修改成功");
						else
					     miniAdmin.error("修改失败");
		  },"json");
			
	})
       

    });
</script>