<?php

$mod='blank';
include("../core/common.php");
$title='赞助系统设置';
include './head.php';
if($islogin==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
?>
  <nav class="navbar navbar-fixed-top navbar-default">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
          <span class="sr-only">导航按钮</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="./">系统设置</a>
      </div><!-- /.navbar-header -->
      <div id="navbar" class="collapse navbar-collapse">
        <ul class="nav navbar-nav navbar-right">
          <li>
            <a href="./"><span class="glyphicon glyphicon-user"></span> 平台首页</a>
         
		  <li class="active"><a href="./set.php"><span class="glyphicon glyphicon-cog"></span> 系统设置</a></li>
		  <li><a href="../"><span class="glyphicon glyphicon-home"></span> 返回首页</a></li>
          <li><a href="./login.php?logout"><span class="glyphicon glyphicon-log-out"></span> 退出登陆</a></li>
		  
        </ul>
      </div><!-- /.navbar-collapse -->
    </div><!-- /.container -->
  </nav><!-- /.navbar -->
  <div class="container" style="padding-top:70px;">
    <div class="col-xs-12 col-sm-10 col-lg-8 center-block" style="float: none;">
<?php
if(isset($_POST['submit'])) {
	$sitename=daddslashes($_POST['sitename']);
	$keywords=daddslashes($_POST['keywords']);
	$description=daddslashes($_POST['description']);
	$panel=daddslashes($_POST['panel']);
	$gg=daddslashes($_POST['gg']);
	$copy=daddslashes($_POST['copy']);
	$liuyan=daddslashes($_POST['liuyan']);
	$music=daddslashes($_POST['music']);
	$kfqq=daddslashes($_POST['kfqq']);
	$api=daddslashes($_POST['api']);
	$payid=daddslashes($_POST['payid']);
	$ms=daddslashes($_POST['ms']);
	$pwd=daddslashes($_POST['pwd']);
	$sql="update `yaofan_config` set `sitename` ='{$sitename}',`keywords` ='{$keywords}',`description` ='{$description}',`panel` ='{$panel}',`gg` ='{$gg}',`copy` ='{$copy}',`liuyan` ='{$liuyan}',`music` ='{$music}',`kfqq` ='{$kfqq}',`api` ='{$api}',`payid` ='{$payid}',`ms` ='{$ms}' where `id`='{$siteid}'";
	if(!empty($pwd))$DB->query("update `yaofan_config` set `pwd` ='{$pwd}' where `id`='{$siteid}'");
	if($DB->query($sql))showmsg('修改成功！',1);
	else showmsg('修改失败！<br/>'.$DB->error(),4);
}else{
?>
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">系统配置</h3></div>
<div class="panel-body">
  <form action="./set.php" method="post" class="form-horizontal" role="form">
	<div class="form-group">
	  <label class="col-sm-2 control-label">网站名称</label>
	  <div class="col-sm-10"><input type="text" name="sitename" value="<?php echo $conf['sitename']; ?>" class="form-control" required/></div>
	</div><br/>
	<div class="form-group">
	  <label class="col-sm-2 control-label">关键字</label>
	  <div class="col-sm-10"><input type="text" name="keywords" value="<?php echo $conf['keywords']; ?>" class="form-control" required/></div>
	</div><br/>
	<div class="form-group">
	  <label class="col-sm-2 control-label">网站描述</label>
	  <div class="col-sm-10"><input type="text" name="description" value="<?php echo $conf['description']; ?>" class="form-control"/></div>
	</div><br/>
	<div class="form-group">
	  <label class="col-sm-2 control-label">首页panel标题</label>
	  <div class="col-sm-10"><input type="text" name="panel" value="<?php echo $conf['panel']; ?>" class="form-control"/></div>
	</div><br/>
			<div class="form-group">
	  <label class="col-sm-2 control-label">首页赞助宣言</label>
	  <div class="col-sm-10"><textarea class="form-control" name="gg" rows="6"><?php echo $conf['gg']; ?></textarea></div>
	</div><br/>
	<div class="form-group">
	  <label class="col-sm-2 control-label">首页底部版权</label>
	  <div class="col-sm-10"><input type="text" name="copy" value="<?php echo $conf['copy']; ?>" class="form-control"/></div>
	</div><br/>
	<div class="form-group">
	  <label class="col-sm-2 control-label">赞助留言设置</label>
	  <div class="col-sm-10"><input type="text" name="liuyan" value="我们同在" class="form-control" readonly="readonly"/></div>
	</div><br/>
	<div class="form-group">
	  <label class="col-sm-2 control-label">网易云ID</label>
	  <div class="col-sm-10"><input type="text" name="music" value="<?php echo $conf['music']; ?>" class="form-control"/></div>
	</div><br/>
	<div class="form-group">
	  <label class="col-sm-2 control-label">站长ＱＱ</label>
	  <div class="col-sm-10"><input type="text" name="kfqq" value="<?php echo $conf['kfqq']; ?>" class="form-control"/></div>
	</div><br/>
	<div class="form-group">
	  <label class="col-sm-2 control-label">易支付接口API</label>
	  <div class="col-sm-10"><input type="text" name="api" value="<?php echo $conf['api']; ?>" class="form-control" readonly="readonly"/></div>
	</div><br/><a href="&#104;&#116;&#116;&#112;&#58;&#47;&#47;&#119;&#119;&#119;&#46;&#122;&#109;&#121;&#112;&#97;&#121;&#46;&#99;&#110;" target="_black">易支付商户申请</a><br/>
	<div class="form-group">
	  <label class="col-sm-2 control-label">易支付商户ID</label>
	  <div class="col-sm-10"><input type="text" name="payid" value="<?php echo $conf['payid']; ?>" class="form-control"/></div>
	</div><br/>
		<div class="form-group">
	  <label class="col-sm-2 control-label">易支付商户密匙</label>
	  <div class="col-sm-10"><input type="text" name="ms" value="<?php echo $conf['ms']; ?>" class="form-control"/></div>
	</div><br/>
  <form action="./set.php" method="post" class="form-horizontal" role="form">
	<div class="form-group">
	  <label class="col-sm-2 control-label">后台密码设置</label>
	  <div class="col-sm-10"><input type="text" name="pwd" value="" class="form-control" placeholder="不修改请留空"/></div>
	  <br/>
	</div><br/>
	<div class="form-group">
	  <div class="col-sm-offset-2 col-sm-10"><input type="submit" name="submit" value="修改" class="btn btn-primary form-control"/><br/>
	 </div>
	</div>
  </form>
</div>
</div>
<script>
var items = $("select[default]");
for (i = 0; i < items.length; i++) {
	$(items[i]).val($(items[i]).attr("default"));
}
</script>
<?php
}?>

    </div>
  </div>
