{include file='public/meta'}
<link rel="stylesheet" href="__LIB__/layui/css/layui.css" media="all">
<body>
<article class="page-container">
	<form class="form form-horizontal" id="frm">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>站点状态</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div class="radio-box">
				<input name="web_open" type="radio" id="web_open-1"  value="0" <?php if($row['web_open']==0) echo 'checked' ;?>>
				<label for="web_open-1">开启</label>
				</div>
				<div class="radio-box">
				<input name="web_open" type="radio" id="web_open-2"  value="-1" <?php if($row['web_open']==-1) echo 'checked' ;?>  >
				<label for="web_open-2">关闭</label>
				</div>
			</div>
		</div>


		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>站点名称</label>
			<div class="formControls col-xs-8 col-sm-9">
				 <input name="site_name"  placeholder="" autocomplete="off" class="input-text" type="text" value="<?php echo $row['site_name'];?>">
			</div>
		</div>


		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>关键字</label>
			<div class="formControls col-xs-8 col-sm-9">
				 <input name="site_keywords"  placeholder="" autocomplete="off" class="input-text" type="text" value="<?php echo $row['site_keywords'];?>">
			</div>
		</div>


		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>站点标题</label>
			<div class="formControls col-xs-8 col-sm-9">
				 <input name="site_slogan"  placeholder="" autocomplete="off" class="input-text" type="text" value="<?php echo $row['site_slogan'];?>">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>首页标语</label>
			<div class="formControls col-xs-8 col-sm-9">
				 <input name="site_home_slogan"  placeholder="" autocomplete="off" class="input-text" type="text" value="<?php echo $row['site_home_slogan'];?>">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>描述</label>
			<div class="formControls col-xs-8 col-sm-9">
				 <input name="site_description"  placeholder="" autocomplete="off" class="input-text" type="text" value="<?php echo $row['site_description'];?>">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>版权</label>
			<div class="formControls col-xs-8 col-sm-9">
				 <input name="site_copyright"  placeholder="" autocomplete="off" class="input-text" type="text" value="<?php echo $row['site_copyright'];?>">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>客服qq</label>
			<div class="formControls col-xs-8 col-sm-9">
				 <input name="site_qq"  placeholder="" autocomplete="off" class="input-text" type="text" value="<?php echo $row['site_qq'];?>">
			</div>
		</div>


		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>客服电话</label>
			<div class="formControls col-xs-8 col-sm-9">
				 <input name="site_phone"  placeholder="" autocomplete="off" class="input-text" type="text" value="<?php echo $row['site_phone'];?>">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>PC端LOGO(150x50)</label>
			<div class="formControls col-xs-8 col-sm-9">
				<button type="button" class="btn btn-primary size-S" id="btn_site_logo">上传图片</button>
				<div>
					<img class="layui-upload-img" id="demo_site_logo" width="100"  {notempty name="$row.site_logo"}src="{$row.site_logo|get_url}"{/notempty} >
				</div>
				<input type="hidden" name="site_logo" id='site_logo' value="<?php echo intval($row['site_logo']);?>"  />
			</div>
		</div>


		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>移动端LOGO(150x50)</label>
			<div class="formControls col-xs-8 col-sm-9">
				<button type="button" class="btn btn-primary size-S" id="btn_site_logo_mobile">上传图片</button>
				<div>
					<img class="layui-upload-img" id="demo_site_logo_mobile" width="100"  {notempty name="$row.site_logo_mobile"}src="{$row.site_logo_mobile|get_url}"{/notempty} >
				</div>
				<input type="hidden" name="site_logo_mobile" id='site_logo_mobile' value="<?php echo intval($row['site_logo_mobile']);?>"  />
			</div>
		</div>


		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>微信二维码(100x100)</label>
			<div class="formControls col-xs-8 col-sm-9">
				<button type="button" class="btn btn-primary size-S" id="btn_wx_qrcode">上传图片</button>
				<div>
					<img class="layui-upload-img" id="demo_wx_qrcode" width="100"  {notempty name="$row.wx_qrcode"}src="{$row.wx_qrcode|get_url}"{/notempty} >
				</div>
				<input type="hidden" name="wx_qrcode" id='wx_qrcode' value="<?php echo intval($row['wx_qrcode']);?>"  />
			</div>
		</div>


		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>站点统计</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div class="radio-box">
				<input name="site_analytics_open" type="radio" id="site_analytics_open-1"  value="0" <?php if($row['site_analytics_open']==0) echo 'checked' ;?>>
				<label for="site_analytics_open-1">关闭</label>
				</div>
				<div class="radio-box">
				<input name="site_analytics_open" type="radio" id="site_analytics_open-2"  value="1" <?php if($row['site_analytics_open']==1) echo 'checked' ;?>  >
				<label for="site_analytics_open-2">开启</label>
				</div>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>统计代码</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea class='input-textarea' name="site_analytics_code" cols='50' rows='5' ><?php echo $row['site_analytics_code'];?></textarea>
			</div>
		</div>

		
		
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

{include file='public/pfooter'}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__LIB__/layui/layui.js"></script> 
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#frm").validate({
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit({
				type: 'post',
				dataType: 'json',
				url: "<?php echo url('admin/sysconfig/site');?>" ,
				success: function(data){
					layer.msg(data.msg,{icon:1,time:1000});
				},
                error: function(XmlHttpRequest, textStatus, errorThrown){
					layer.msg('服务器端错误',{icon:1,time:1000});
				}
			});
		}
	});
	
});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
<script>
//上传图片PC LOGO
layui.use('upload', function(){
  var upload = layui.upload;
  //执行实例
  var uploadInst = upload.render({
    elem: '#btn_site_logo' //绑定元素
    ,url: "{:url('common/upload',['atype'=>'site_logo'])}" //上传接口
    ,done: function(res){
      //上传完毕回调
      if(0==res.error) {
        $('#demo_site_logo').attr('src',res.src);
        $('#site_logo').val(res.id);
      } else {
        layer.msg(data.msg,{icon:1,time:1000});
      }
    }
    ,error: function(){
    	layer.msg('接口异常');
    }
  });
});


//上传图片mobile LOGO
layui.use('upload', function(){
  var upload = layui.upload;
  //执行实例
  var uploadInst = upload.render({
    elem: '#btn_site_logo_mobile' //绑定元素
    ,url: "{:url('common/upload',['atype'=>'site_logo_mobile'])}" //上传接口
    ,done: function(res){
      //上传完毕回调
      if(0==res.error) {
        $('#demo_site_logo_mobile').attr('src',res.src);
        $('#site_logo_mobile').val(res.id);
      } else {
        layer.msg(data.msg,{icon:1,time:1000});
      }
    }
    ,error: function(){
    	layer.msg('接口异常');
    }
  });
});


//上传图片微信二维码
layui.use('upload', function(){
  var upload = layui.upload;
  //执行实例
  var uploadInst = upload.render({
    elem: '#btn_wx_qrcode' //绑定元素
    ,url: "{:url('common/upload',['atype'=>'wx_qrcode'])}" //上传接口
    ,done: function(res){
      //上传完毕回调
      if(0==res.error) {
        $('#demo_wx_qrcode').attr('src',res.src);
        $('#wx_qrcode').val(res.id);
      } else {
        layer.msg(data.msg,{icon:1,time:1000});
      }
    }
    ,error: function(){
    	layer.msg('接口异常');
    }
  });
});
</script> 