<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:78:"D:\wwwroot\127.0.0.1010\public/../application/simple\view\system\software.html";i:1591672596;s:65:"D:\wwwroot\127.0.0.1010\application\Simple\view\public\heard.html";i:1591672596;}*/ ?>
<!doctype html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>后台登录-X-admin2.2</title>
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <link rel="stylesheet" href="/static/simple/css/font.css">
        <link rel="stylesheet" href="/static/simple/css/xadmin.css">
        <script src="/static/simple/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="/static/simple/js/xadmin.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
	 <div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">系统设置</a>
            <a>
              <cite>软件设置</cite></a>
          </span>
          <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
        </div>
            <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
			<div class="layui-col-md12">
                    <div class="layui-card">
						<form class="layui-form" action="">
                        <div class="layui-card-body ">
					
						  <fieldset class="layui-elem-field">
							  <legend>沃尔玛账号设置</legend>
							  <div class="layui-field-box">
								 <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">手机号：</label>
									<div class="layui-input-inline">
									  <input type="text" name="sphone" class="layui-input" value="<?php echo C('sphone'); ?>" >
									</div>
								 </div>
								 <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">密码：</label>
									<div class="layui-input-inline">
									  <input type="text" name="spassword" class="layui-input" value="<?php echo C('spassword'); ?>" >
									</div>
								 </div>
								 <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">通道代码：</label>
									<div class="layui-input-inline">
									  <input type="text" name="sneixing" class="layui-input" value="<?php echo C('sneixing'); ?>" >
									</div>
									<div class="layui-input-inline">
									<button type="button" class="layui-btn" lay-submit="" lay-filter="user">立即更新</button>
									</div>
								 </div>
							  </div>
						  </fieldset>
					</div>
					 <div class="layui-card-body ">
					
						  <fieldset class="layui-elem-field">
							  <legend>苏宁账号设置</legend>
							  <div class="layui-field-box">
								 <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">手机号：</label>
									<div class="layui-input-inline">
									  <input type="text" name="snphone" class="layui-input" value="<?php echo C('snphone'); ?>" >
									</div>
								 </div>
								 <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">密码：</label>
									<div class="layui-input-inline">
									  <input type="text" name="snpassword" class="layui-input" value="<?php echo C('snpassword'); ?>" >
									</div>
								 </div>
								 <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">通道代码：</label>
									<div class="layui-input-inline">
									  <input type="text" name="snneixing" class="layui-input" value="<?php echo C('snneixing'); ?>" >
									</div>
									<div class="layui-input-inline">
									<button type="button" class="layui-btn" lay-submit="" lay-filter="snuser">立即更新</button>
									</div>
								 </div>
							  </div>
						  </fieldset>
					</div>
					<div class="layui-card-body ">
						  <fieldset class="layui-elem-field">
							  <legend>密钥设置</legend>
							  <div class="layui-field-box">
								 <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">通讯密钥：</label>
									<div class="layui-input-inline">
									  <input type="text" name="skey" class="layui-input" value="<?php echo C('skey'); ?>" >
									</div>
									<div class="layui-input-inline">
									<button type="button" class="layui-btn" lay-submit="" lay-filter="miyao">立即更新</button>
									</div>
								 </div>
							  </div>
						  </fieldset>
					</div>
					<div class="layui-card-body ">
						  <fieldset class="layui-elem-field">
							  <legend>基本配置</legend>
							  <div class="layui-field-box">
							    <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">登陆地址：</label>
									<div class="layui-input-inline" style="width:320px">
									  <input type="text" name="sdenglu" class="layui-input" value="<?php echo C('sdenglu'); ?>" >
									</div>
								 </div>
								 <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">网站域名：</label>
									<div class="layui-input-inline">
									  <input type="text" name="sdomain" class="layui-input" value="<?php echo C('sdomain'); ?>" >
									</div>
								 </div>
								 <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">沃尔玛自动提交：</label>
									<div class="layui-input-inline">
									  <input type="checkbox" <?php if(C('sopen') == 'on'): ?>checked=""<?php endif; ?> name="sopen"  lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
									</div>
								  </div>
								  <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">苏宁自动提交：</label>
									<div class="layui-input-inline">
									  <input type="checkbox" <?php if(C('snopen') == 'on'): ?>checked=""<?php endif; ?> name="snopen"  lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
									</div>
								  </div>
								 <div class="layui-form-item">
									<label class="layui-form-label" style="width:120px">扫描间隔：</label>
									<div class="layui-input-inline" style="width:50px">
									  <input type="text" name="sminnum" class="layui-input" value="<?php echo C('sminnum'); ?>" >
									</div>
									<div class="layui-input-inline" style="width:1px">-</div>
									<div class="layui-input-inline" style="width:50px">
									  <input type="text" name="smaxnum" class="layui-input" value="<?php echo C('smaxnum'); ?>" >
									</div>
									<div class="layui-input-inline" style="width: 90px;">
									<button type="button" class="layui-btn" lay-submit="" lay-filter="peizhi">立即更新</button> 
									</div>
									<div class="layui-input-inline">
									<button type="button" class="layui-btn layui-btn-danger" lay-submit="" lay-filter="tongbu">同步数据</button> 
									</div>
								 </div>
							  </div>
						  </fieldset>
			
					</div>
								</form>
				</div>
			</div>
		</div>
	</div>
 </body>
<script>
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form,layer = layui.layer,layedit = layui.layedit;
   
  //监听提交
  form.on('submit(user)', function(data){
     var loading =layer.load(3, {shade: [0.1,'#fff']});
	 var nx=$("input[name=sneixing]").val();
    $.post("<?php echo U('simple/system/Software'); ?>",{type:'setting',sphone:$("input[name=sphone]").val(),spassword:$("input[name=spassword]").val(),sneixing:nx},function(res){
	        layer.close(loading);
			if (res.code==1) {
				layer.msg(res.msg,{time:1000,icon:1});
			}else{
				layer.msg(res.msg,{time:1000,icon:2});
			}
	})
    return false;
  });
    //监听提交
  form.on('submit(snuser)', function(data){
     var loading =layer.load(3, {shade: [0.1,'#fff']});
	 var nx=$("input[name=snneixing]").val();
    $.post("<?php echo U('simple/system/Software'); ?>",{type:'setsn',snphone:$("input[name=snphone]").val(),snpassword:$("input[name=snpassword]").val(),snneixing:nx},function(res){
	        layer.close(loading);
			if (res.code==1) {
				layer.msg(res.msg,{time:1000,icon:1});
			}else{
				layer.msg(res.msg,{time:1000,icon:2});
			}
	})
    return false;
  });
 form.on('submit(miyao)', function(data){
     var loading =layer.load(3, {shade: [0.1,'#fff']});
    $.post("<?php echo U('simple/system/Software'); ?>",{type:'userkey',skey:$("input[name=skey]").val()},function(res){
	        layer.close(loading);
			if (res.code==1) {
				layer.msg(res.msg,{time:1000,icon:1});
			}else{
				layer.msg(res.msg,{time:1000,icon:2});
			}
	})
    return false;
  }); 
 form.on('submit(peizhi)', function(data){
     var loading =layer.load(3, {shade: [0.1,'#fff']});
	 var sdenglu=$("input[name=sdenglu]").val(),sdomain=$("input[name=sdomain]").val(),sminnum=$("input[name=sminnum]").val(),smaxnum=$("input[name=smaxnum]").val();
    $.post("<?php echo U('simple/system/Software'); ?>",{type:'peizhi',sdenglu:sdenglu,sdomain:sdomain,sminnum:sminnum,smaxnum:smaxnum},function(res){
	        layer.close(loading);
			if (res.code==1) {
				layer.msg(res.msg,{time:1000,icon:1});
			}else{
				layer.msg(res.msg,{time:1000,icon:2});
			}
	})
    return false;
  });  
  form.on('submit(tongbu)', function(data){
     var loading =layer.load(3, {shade: [0.1,'#fff']});
    $.post("<?php echo U('simple/system/Software'); ?>",data.field,function(res){
	        layer.close(loading);
			if (res.code==1) {
				layer.msg(res.msg,{time:1000,icon:1});
			}else{
				layer.msg(res.msg,{time:1000,icon:2});
			}
	})
    return false;
  });  
   form.on('switch(switchTest)', function(data){
     var loading =layer.load(3, {shade: [0.1,'#fff']});
	  var checked = data.elem.checked;
	  var name=data.elem.name;
	  var sopen=checked?"on":"off";
	  $.post("<?php echo U('simple/system/Software'); ?>",{type:'open',sopen:sopen,name:name},function(res){
		layer.close(loading);
		if(res.code==1) {
			layer.msg(res.msg,{time:1000,icon:1});
		}else{
			layer.msg(res.msg,{time:1000,icon:2});
		}
	})
    return false;
  });
});
</script>
</html>