<?php
require_once('common.php');
require_once('head.php');
//************************执行代码开始*************************

if($do=$_POST['do']){
	foreach($_POST as $k=> $value){
		$db->query("insert into ".C('DB_PREFIX')."webconfigs set vkey='".safestr($k)."',value='".safestr($value)."' on duplicate key update value='".safestr($value)."'");
	}
	if($rows=$db->get_results("select * from ".C('DB_PREFIX')."webconfigs")){
		foreach($rows as $row){
			$webconfig[$row['vkey']]=$row['value'];
		}
		C($webconfig);
	}

	echo"<script language='javascript'>alert('保存成功！');</script>";
}





//**************************执行代码开始*******************************
?>
<!DOCTYPE html>
<title>网站设置-<?=C('webname')?> </title>
<body>
<!--main content start-->
  <section id="container" class="">
      <section id="main-content">
          <section class="wrapper">
		  <div class="row">
                  <div class="col-lg-12"> <p>网站设置 </div>
                  <div class="col-lg-12">
                      <section class="panel">
                        <div class="panel-body">
				<form action="?xz=set" class="form-horizontal" method="post">
	                
					 <input type="hidden" name="do" value="set">
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-id-1">网站前缀</label>
                    <div class="col-sm-10">
                      <input type="text" class="form-control" name="name" value="<?=C('name')?>">
                    </div>
                  </div>
				  <div class="line line-dashed line-lg pull-in"></div>
				  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-id-1">网站标题</label>
                    <div class="col-sm-10">
                      <input type="text" class="form-control" name="webname" value="<?=C('webname')?>">
                    </div>
                  </div>
                   <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-id-1">班级密匙</label>
                    <div class="col-sm-10">
                      <input type="text" class="form-control" name="bjmm" value="<?=C('bjmm')?>">
                    </div>
                  </div>
				  <div class="line line-dashed line-lg pull-in"></div>
				  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-id-1">站长QQ</label>
                    <div class="col-sm-10">
                      <input type="text" class="form-control" name="webqq" value="<?=C('webqq')?>">
                    </div>
                  </div>
				  <div class="line line-dashed line-lg pull-in"></div>
				  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-id-1">站长邮箱</label>
                    <div class="col-sm-10">
                      <input type="text" class="form-control" name="webmail" value="<?=C('webmail')?>">
                    </div>
                  </div>
				  <div class="line line-dashed line-lg pull-in"></div>
				  
                  <div class="form-group">
          <label class="col-sm-2 control-label">是否开起绚丽播放器</label>
          <div class="col-sm-10">
            <label class="radio-inline">
												<input type="radio" name="sfbfq" value="1" checked="">开起
											</label>
											<label class="radio-inline">
												<input type="radio" name="sfbfq" value="0" <?php if(C('sfbfq')==0) echo 'checked=""';?>>
												<font>关闭</font>
											</label>
          </div>
        </div>
				  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-id-1">绚丽播放器KEY</label>
                    <div class="col-sm-10">
                       <input type="text" class="form-control" name="zxyy" value="<?=C('zxyy')?>">
                       <a href="http://myhk.xlch520.cn/" class="btn btn-danger"  target="_black">获取KEY</a>
                       <a href="http://bbs.xlch520.cn/forum.php?mod=viewthread&tid=18"  target="_black" class="btn btn-danger">使用教程</a>注：当手机浏览时会自动不播放！
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-id-1">拉圈圈接口</label>
                    <div class="col-sm-10">
                      <input type="text" class="form-control" name="qqjk" value="<?=C('qqjk')?>">
                    </div>
                  </div>
          <div class="line line-dashed line-lg pull-in"></div>
				  <div class="line line-dashed line-lg pull-in"></div>
				  <div class="form-group">
          <label class="col-sm-2 control-label">首页模板</label>
          <div class="col-sm-10">
            <label class="radio-inline">
												<input type="radio" name="symb" value="1" checked="">默认
											</label>
											<label class="radio-inline">
												<input type="radio" name="symb" value="2" <?php if(C('symb')==2) echo 'checked=""';?>>
												<font>模板1</font>
											</label>
          </div>
        </div>
        <div class="line line-dashed line-lg pull-in"></div>
          <div class="form-group">
          <label class="col-sm-2 control-label">是否开启开放注册</label>
          <div class="col-sm-10">
            <label class="radio-inline">
                        <input type="radio" name="zc" value="1" checked="">开启
                      </label>
                      <label class="radio-inline">
                        <input type="radio" name="zc" value="0" <?php if(C('zc')==0) echo 'checked=""';?>>
                        <font>关闭</font>
                      </label>
          </div>
        </div>
		
                  <div class="form-group">
                    <div align="center">
                      <button type="submit" class="btn btn-primary">确定修改</button>
                    </div>
                  </div>
                </form>
              </div>
<?php
require_once('foot.php');
?>
  </body>
</html>
