<?php
require_once('common.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>";
}





//**************************执行代码开始*******************************
include_once 'common.head.php';
?>
		<div class="col-sm-12 col-sm-offset-10 col-md-10 col-md-offset-2 main">
			<h2 class="page-header">网站设置</h2>
			<div class="table-responsive">
				<div class="col-xs-12 col-md-4">
					<div class="panel panel-default">
						<div class="panel-heading" data-toggle="collapse" href="#collapsejiemian">
							<h3 class="panel-title">界面设置</h3>
						</div>
						<div id="collapsejiemian" class="panel-body <?php if($_GET['xz'] != 'jiemian'){echo'collapse-xs';}?>">
							<form action="?xz=jiemian" class="form-horizontal" method="post">
								<input type="hidden" name="do" value="jiemian">
								<div class="form-group">
									<label class="col-sm-3 control-label" for="field-2">底部自定义代码</label>
									<div class="col-sm-9">
										<textarea class="form-control" name="webfoot" rows="5"><?=stripslashes(C('webfoot'))?></textarea>
									</div>
								</div>
								<div class="form-group">
									<label class="col-xs-8 "></label>
									<div class=="col-xs-4"><input type="submit" name="submit" value="确认修改" class="btn btn-primary"></div>
								</div>
							</form>
						</div>
					</div>
				</div>
				
			</div>
			
				
			</div>
			
				
			
		</div
><?php
include_once 'common.foot.php';
?>