<?php
// +----------------------------------------------------------------------
// | mobanbox [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://mobanbox.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@mobanbox.net
// +----------------------------------------------------------------------

header("Content-type:text/html;charset=utf-8");
function check_email($address) {
	return (preg_match ( '/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+' . '@' . '([-0-9A-Z]+\.)+' . '([0-9A-Z]){2,4}$/i', trim ( $address ) ));
}
function check_phone($num){
	return (preg_match ( "/^((\(\d{3}\))|(\d{3}\-))?1[3,5,8]{1}\d{9}?$/", $num));
}
$isInstalled = false;
if(file_exists($_SERVER['DOCUMENT_ROOT'].'/config/config.php')) {
	$isInstalled = true;
}
//如果“/config”目录下已存在“config.php”文件，视为系统已安装。

$languages = array();
if(function_exists('scandir')) {
	$buff = scandir($_SERVER['DOCUMENT_ROOT'].'/setup/lang/');
	if(is_array($buff)) {
		foreach($buff as $f) {
			if(is_file($_SERVER['DOCUMENT_ROOT'].'/setup/lang/'.$f)) {
				$f = basename($f, '.php');
				$languages[$f] = $f;
			} 
		}
	}	
}
//获取语言文件

if(isset($_POST['install']) && !$isInstalled) {
	$error = '';

	if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/core/data/cache/')), -4) != '0777') {
		$error .= '请给这个目录设置写权限(0777)： /core/data/cache/ (包括所有子目录)<br />';
	} else {
		if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/core/data/cache/session/')), -4) != '0777') {
			$error .= '请给这个目录设置写权限(0777)： /core/data/cache/session/<br />';
		}
		if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/core/data/cache/templates_cache/')), -4) != '0777') {
			$error .= '请给这个目录设置写权限(0777)： /core/data/cache/templates_cache/<br />';
		}
	}

	if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/core/data/logs/')), -4) != '0777') {
		$error .= '请给这个目录设置写权限(0777)： /core/data/logs/<br />';
	}

	if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/static/uploads/')), -4) != '0777') {
		$error .= '请给这个目录设置写权限(0777)： /static/uploads/ (包括所有子目录)<br />';
	}

	if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/config/')), -4) != '0777') {
		$error .= '请给这个目录设置写权限(0777)： /config/<br />';
	}

	if(!$error && (!file_exists($_SERVER['DOCUMENT_ROOT'].'/config/') || !is_dir($_SERVER['DOCUMENT_ROOT'].'/config/'))) {
		if(!@mkdir($_SERVER['DOCUMENT_ROOT'].'/config/', 0777, true)) {
			$error .= '目录 "' . $_SERVER['DOCUMENT_ROOT'] . '/config/" 无法创建<br />';
		}
	}
    

    //服务器配置检查
	if(!in_array('zlib', get_loaded_extensions())) {
		$error .= 'ZipArchive 类使用 Â» zlib函数<br />';
	}

	if(!function_exists('fopen')) {
		$error .= '"fopen" 函数需要激活<br />';
	}

	if(!function_exists('curl_init')) {
		$error .= '"curl" 函数需要激活<br />';
	}

	if(!function_exists('scandir')) {
		$error .= '"scandir"函数需要激活<br />';
	}

	if(!function_exists('mysql_connect')) {
		$error .= '"mysql_connect" 函数需要激活<br />';
	}


	if(!version_compare("5.2", phpversion(), "<=")) {
		$error .= 'PHP 5 >= 5.3.28是必须的<br />';
	}




    //end

	if(!isset($_POST['mysql_host']) || trim($_POST['mysql_host']) == '') {
		$error .= '请填写MySQL host<br />';
	}
	if(!isset($_POST['mysql_user']) || trim($_POST['mysql_user']) == '') {
		$error .= '请填写MySQL用户名<br />';
	}
//	if(!isset($_POST['mysql_pass']) || trim($_POST['mysql_pass']) == '') {
//		$error .= '请填写MySQL密码<br />';
//	}
	if(!isset($_POST['mysql_db']) || trim($_POST['mysql_db']) == '') {
		$error .= '请填写MySQL数据库<br />';
	}
    if(!isset($_POST['admin_phone']) || !check_phone($_POST['admin_phone'])) {
        $error .= '请填写正确手机号<br />';
    }
	if(!isset($_POST['admin_mail']) || !check_email($_POST['admin_mail'])) {
		$error .= '请填写管理员e-mail<br />';
	}

	if(!isset($_POST['report_mail']) || !check_email($_POST['report_mail'])) {
		$error .= '请填写技术支持e-mail<br />';
	}
	if(!isset($_POST['meta_title']) || trim($_POST['meta_title']) == '') {
		$error .= '请填写meta title<br />';
	}
	if(!isset($_POST['meta_keywords']) || trim($_POST['meta_keywords']) == '') {
		$error .= '请填写meta keywords<br />';
	}
	if(!isset($_POST['meta_description']) || trim($_POST['meta_description']) == '') {
		$error .= '请填写meta description<br />';
	}
	if(!isset($_POST['lang']) || trim($_POST['lang']) == '') {
		$error .= '请选择语言<br />';
	}

	if($error == '') {
		@$dbl = mysql_connect($_POST['mysql_host'], $_POST['mysql_user'], $_POST['mysql_pass']);
		if($dbl === FALSE) {
			$error .= '无法连接MySQL，请填写正确的数据库信息<br />';
		}else{
			$s = mysql_select_db($_POST['mysql_db']);
			if($s === FALSE) {
				$error .= '数据库错误，请填写正确的数据库信息<br />';
			}
		}

		if($error == '') {
			$dm = $_SERVER['HTTP_HOST'];
			if(substr($dm, 0, 4) == 'www.') {
				$dm = substr($dm, 4);
			}

			mysql_set_charset('utf8');

			copy($_SERVER['DOCUMENT_ROOT'].'/setup/lang/'.$_POST['lang'].'.php', $_SERVER['DOCUMENT_ROOT'].'/config/lang.php');

			$handle = fopen($_SERVER['DOCUMENT_ROOT'].'/config/current.txt', 'w');
			fwrite($handle, $_POST['lang']);
			fclose($handle);

			$fp = fopen($_SERVER['DOCUMENT_ROOT'].'/config/config.php', 'w');
			fwrite($fp, "<?php \n\n");
			fwrite($fp, '$configArr = array('."\n");
			fwrite($fp, '	\'system_core\' => \''. preg_replace('/[\/]{2,}/','/', $_SERVER['DOCUMENT_ROOT'].'/core/') . '\', '."\n");
			fwrite($fp, '	\'root_path\' => \''.preg_replace('/[\/]{2,}/','/',$_SERVER['DOCUMENT_ROOT'].'/') . '\', '."\n");
			fwrite($fp, '	\'domain\' => \''.$dm.'\', '."\n");
			fwrite($fp, '	\'mysql_host\' => \''.$_POST['mysql_host'].'\', '."\n");
			fwrite($fp, '	\'mysql_user\' => \''.$_POST['mysql_user'].'\', '."\n");
			fwrite($fp, '	\'mysql_pass\' => \''.$_POST['mysql_pass'].'\', '."\n");
			fwrite($fp, '	\'mysql_db\' => \''.$_POST['mysql_db'].'\', '."\n");
			fwrite($fp, '); '."\n\n");
			fwrite($fp, '?>');											
			fclose($fp);

			$adminPassword = $_POST["admin_pwd"];

			require_once 'db.php';

			mysql_close($dbl);
            $index = 'http://mobanbox.net/';


            require_once '../classes/Http.class.php';
            $http = new Http();
		    $url = $index.'/statistics';
		    $data = array(
                'ip'     => $_SERVER['SERVER_ADDR'] .':'.$_SERVER['SERVER_PORT'],
                'domain' => $_SERVER['HTTP_HOST'],
                'mobile' => $_POST['admin_phone'],
                'email'  => $_POST['admin_mail'],
                'server' => strpos($_SERVER['SERVER_SOFTWARE'], 'PHP')===false ? $_SERVER['SERVER_SOFTWARE'].'PHP/'.phpversion() : $_SERVER['SERVER_SOFTWARE'],
                'os'     => PHP_OS,
		    );

		    $res = $http->curlPost($url,$data);
			$complete = 'yes';
		}
	}
}else{
	$_POST['mysql_host'] = '';
	$_POST['mysql_user'] = '';
	$_POST['mysql_pass'] = '';
	$_POST['mysql_db'] = '';
	$_POST['admin_mail'] = '';
    $_POST['admin_username'] = '';
    $_POST['admin_pwd'] = '';
    $_POST['admin_pwd1'] = '';
    $_POST['admin_phone'] = '';
    $_POST['report_mail'] = '';
	$_POST['meta_title'] = '';
	$_POST['meta_keywords'] = '';
	$_POST['meta_description'] = '';
	$_POST['lang'] = '';
}
?>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<title>安装</title>
	<meta charset="utf-8" />
	<meta name="keywords" content="mobanbox" />
	<meta name="description" content="mobanbox" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimal-ui, user-scalable=yes" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="renderer" content="webkit">
	<!-- for ios 7 style, multi-resolution icon of 152x152 -->
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-barstyle" content="black-translucent">
	<link rel="apple-touch-icon" href="/mbthemes/assets/images/logo.png">
	<meta name="apple-mobile-web-app-title" content="Flatkit">
	<!-- for Chrome on Android, multi-resolution icon of 196x196 -->
	<meta name="mobile-web-app-capable" content="yes">
	<link rel="shortcut icon" sizes="196x196" href="/mbthemes/assets/images/logo.png">
	<!-- style -->
	<link href="http://cdn.staticfile.org/animate.css/3.4.0/animate.min.css" rel="stylesheet">
	<link rel="stylesheet" href="http://cdn.staticfile.org/twitter-bootstrap/4.0.0-alpha/css/bootstrap.min.css" type="text/css" />
	<link rel="stylesheet" href="/mbthemes/assets/styles/icon.css" type="text/css" />
	<!--<link rel="stylesheet" href="http://cdn.bootcss.com/simple-line-icons/2.2.3/css/simple-line-icons.min.css">-->
	<link rel="stylesheet" href="/mbthemes/assets/styles/app.css" type="text/css" />
	<link rel="stylesheet" href="" type="text/css" id="skinStyle" />
	<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
	<script src="/mbthemes/scripts/libs/jquery/tether/dist/js/tether.min.js"></script>
	<script src="http://cdn.staticfile.org/twitter-bootstrap/4.0.0-alpha/js/bootstrap.min.js"></script>
	<script src="http://cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
	<script src="/mbthemes/scripts/app.min.js"></script>
	<!--[if lt IE 9]>
	<script src="/mbthemes/scripts/ie/html5shiv.js"></script>
	<script src="/mbthemes/scripts/ie/respond.min.js"></script>
	<script src="/mbthemes/scripts/ie/excanvas.js"></script>
	<![endif]-->
</head>
<body>
<div>
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="30" height="30" style="position:fixed; z-index:0; left:50%; top: 20%" class="animated fadeInDownBig">
		<path d="M 48 0 L 24 48 L 0 0 Z" fill="rgba(0,0,0,0.05)" />
	</svg>
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="10" height="10" style="position:fixed; z-index:0; left:49%; top: 15%" class="animated fadeInDown">
		<path d="M 48 0 L 24 48 L 0 0 Z" fill="#a88add" />
	</svg>
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="5" height="5" style="position:fixed; z-index:0; left:30%; top: 0%" class="animated fadeInDown">
		<path d="M 48 0 L 24 48 L 0 0 Z" fill="#a88add" />
	</svg>
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="20" height="20" style="position:fixed; z-index:0; right:5%; top: 30%" class="animated fadeInDown">
		<path d="M 48 0 L 24 48 L 0 0 Z" fill="#0cc2aa" />
	</svg>
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="15" height="15" style="position:fixed; z-index:0; left:34.5%; top: 60%" class="animated fadeIn">
		<path d="M 0 48 L 24 0 L 48 48 Z" fill="#fcc100" />
	</svg>
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="200" height="200" style="position:fixed; z-index:0; right:20%; top: 70%" class="animated fadeInUp">
		<path d="M 0 48 L 24 0 L 48 48 Z" fill="rgba(252,193,0,0.1)" />
	</svg>
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="120" height="120" style="position:fixed; z-index:0; left:0%; top: 30%" class="animated fadeInLeftBig">
		<path d="M 0 48 L 48 24 L 0 0 Z" fill="rgba(0,0,0,0.03)" />
	</svg>
</div>
<div class="page-content" id="home">

	<?php
	if($isInstalled) {
		?>
		<div class="h-v indigo-800 row-col">
			<div class="row-cell v-m text-center animated fadeIn">
				<div class="container p-y-lg pos-rlt">
					<h1 class="display-1 _700 m-t-lg m-b-md">恭喜!你的系统已<span class="text-primary">成功</span>安装，请勿重复安装</h1>
					<h5 class="text-muted m-b-lg">为确保站点安全，请务必删除<span class="label accent">"/setup"</span>目录。</h5>
					<!--			用户名(你设定的用户名): <strong>--><?php //echo $_POST['admin_username']; ?><!--</strong>-->
					<!--			<br /><br />-->
					<!--			密码(登录修改前务必牢记): <strong>--><?php //echo $adminPassword; ?><!--</strong>-->
					<a href="/index.php/admin/" class="btn btn-lg btn-outline b-primary text-primary b-2x m-r">后台</a>
					<a href="/index.php/admin/" class="btn btn-lg btn-outline b-primary text-primary b-2x">网站首页</a>
				</div>
			</div>
		</div>
		<?php
	}elseif(isset($complete)) {
	?>

		<div class="h-v indigo-800 row-col">
			<div class="row-cell v-m text-center animated fadeIn">
				<div class="container p-y-lg pos-rlt">
					<h1 class="display-1 _700 m-t-lg m-b-md">恭喜!你的系统已<span class="text-primary">成功</span>安装!!!</h1>
					<h5 class="text-muted m-b-lg">为确保站点安全，请务必删除<span class="label accent">"/setup"</span>目录。</h5>
					<!--			用户名(你设定的用户名): <strong>--><?php //echo $_POST['admin_username']; ?><!--</strong>-->
					<!--			<br /><br />-->
					<!--			密码(登录修改前务必牢记): <strong>--><?php //echo $adminPassword; ?><!--</strong>-->
					<a href="/index.php/admin/" class="btn btn-lg btn-outline b-primary text-primary b-2x m-r">后台</a>
					<a href="/index.php/admin/" class="btn btn-lg btn-outline b-primary text-primary b-2x">网站首页</a>
				</div>
			</div>
		</div>
		<?php
	}else{
	?>
	<?php
	if(isset($error) && $error != '') {
		?>
		<div class="box2">
			<div class="box_error"><?php echo $error; ?></div>
		</div>
		<?php
	}
	$fas_error = false;
	?>

	<?php if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/core/data/cache/')), -4) != '0777') { ?>
		<div class="box2">
			<div class="box_error">
				<strong>错误! </strong>请给这个目录设置写权限(0777)：<?php  echo $_SERVER['DOCUMENT_ROOT'];?> <strong>/core/data/cache/</strong> (包括所有子目录)
			</div>
		</div>
		<?php $fas_error = true; } else { ?>

		<?php if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/core/data/cache/session/')), -4) != '0777') { ?>
			<div class="box2">
				<div class="box_error">
					<strong>错误! </strong>请给这个目录设置写权限(0777)： <strong>/core/data/cache/session/</strong>
				</div>
			</div>
			<?php $fas_error = true; } ?>

		<?php if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/core/data/cache/templates_cache/')), -4) != '0777') { ?>
			<div class="box2">
				<div class="box_error">
					<strong>错误! </strong>请给这个目录设置写权限(0777)： <strong>/core/data/cache/templates_cache/</strong>
				</div>
			</div>
			<?php $fas_error = true; } ?>
	<?php } ?>

	<?php if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/core/data/logs/')), -4) != '0777') { ?>
		<div class="box2">
			<div class="box_error">
				<strong>错误! </strong>请给这个目录设置写权限(0777)： <strong>/core/data/logs/</strong>
			</div>
		</div>
		<?php $fas_error = true; } ?>

	<?php if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/static/uploads/')), -4) != '0777') { ?>
		<div class="box2">
			<div class="box_error">
				<strong>错误! </strong>请给这个目录设置写权限(0777)： <strong>/static/uploads/</strong>(包括所有子目录)
			</div>
		</div>
		<?php $fas_error = true; } ?>

	<?php if(substr(sprintf('%o', fileperms($_SERVER['DOCUMENT_ROOT'].'/config/')), -4) != '0777') { ?>
		<div class="box2">
			<div class="box_error">
				<strong>错误! </strong>请给这个目录设置写权限(0777)： <strong>/config/</strong>
			</div>
		</div>
		<?php $fas_error = true; } ?>


	<?php if(!$fas_error) { ?>

	<div class="h-v indigo-800 row-col">
		<div class="row-cell v-m text-center animated fadeIn">
			<div class="container p-y-lg pos-rlt">
				<h1 class="display-1 _700 m-t-lg m-b-md">这是一个<span class="text-primary">专业的</span>销售系统</h1>
				<h5 class="text-muted m-b-lg">如果您喜欢这个系统，请将它 <span class="label accent">推荐给</span> 您的朋友</h5>
				<a href="#setups" ui-scroll-to="setups" class="btn btn-lg btn-outline b-primary text-primary b-2x">开始安装</a>
			</div>
		</div>
	</div>
	<div class="p-y-lg" id="setups">
		<div class="container p-y-lg text-primary-hover">
			<div class="row">
				<div class="col-md-8 col-md-offset-2">
					<form class="horizontal-form disable-on-submit" method="post" action="">
						<fieldset>

							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="mysql_host">数据库主机</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="mysql_host" name="mysql_host" required="true" value="localhost" type="text">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="mysql_user">数据库用户名</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="mysql_user" required="true" name="mysql_user" value="root" type="text">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="mysql_pass">数据库密码</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="mysql_pass"  name="mysql_pass" value="<?php echo htmlspecialchars($_POST['mysql_pass']); ?>" type="text">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="mysql_db">数据库名称</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="mysql_db" required="true" name="mysql_db" value="<?php echo htmlspecialchars($_POST['mysql_db']); ?>" type="text">
								</div>
							</div>

							<div class="b-b p-t m-b-md"></div>



							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="admin_username">管理员用户名</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="admin_username" required="true" name="admin_username" value="admin" type="text">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="admin_pwd">管理员密码</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="admin_pwd" required="true" name="admin_pwd" value="<?php echo htmlspecialchars($_POST['admin_pwd']); ?>" type="text">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="admin_pwd1">管理员密码确认</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="admin_pwd1" onblur="checkpwd()" required="true" name="admin_pwd1" value="<?php echo htmlspecialchars($_POST['admin_pwd1']); ?>" type="text">
									<div id="admin_pwd1_tip" class="errortxt"></div>
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="admin_phone">管理员联系电话</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="admin_phone" required="true" name="admin_phone" value="<?php echo htmlspecialchars($_POST['admin_phone']); ?>" type="text">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="admin_mail">管理员e-mail</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="admin_mail" required="true" name="admin_mail" value="<?php echo htmlspecialchars($_POST['admin_mail']); ?>" type="text">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="report_mail">举报或技术支持E-mail</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="report_mail" required="true" name="report_mail" value="<?php echo htmlspecialchars($_POST['report_mail']); ?>" type="text">
								</div>
							</div>



							<div class="b-b p-t m-b-md"></div>




							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="meta_title">网站标题</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="meta_title" required="true" name="meta_title" value="<?php echo htmlspecialchars($_POST['meta_title']); ?>" type="text">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="meta_keywords">网站关键字</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="meta_keywords" required="true" name="meta_keywords" value="<?php echo htmlspecialchars($_POST['meta_keywords']); ?>" type="text">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="meta_description">网站描述</label>
								<div class="col-sm-10 inputs">
									<input class="form-control" id="meta_description" required="true" name="meta_description" value="<?php echo htmlspecialchars($_POST['meta_description']); ?>" type="text">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-2 form-control-label" for="country">选择语言</label>
								<div class="col-sm-10 inputs">
									<select class="form-control" name="lang">
										<?php
										if(isset($languages)) {
											foreach($languages as $l) {
												echo '<option value="'.$l.'"';
												if($_POST['lang'] == $l) echo ' selected="selected" ';
												echo '>'.$l.'</option>';
											}
										}
										?>
									</select>
								</div>
							</div>
							<div class="b-b p-t m-b-md"></div>
							<div class="form-submit">
								<button id="personal_info_submit_button" name="install" class="btntheme2 btn skin" type="submit">安装</button>
							</div>
						</fieldset>
					</form>
				</div>
			</div>
		</div>
	</div>
		<script type="text/javascript">
			function checkpwd(){
				var p = document.getElementById("admin_pwd").value,
					p1 = document.getElementById("admin_pwd1").value,
					t = document.getElementById("admin_pwd1_tip");
				if(p != p1){
					t.innerHTML = "两次输入密码不一致";
				}else{
					t.innerHTML = "";
				}
			}
		</script>

	<?php } ?>

		<?php
	}
	?>


</div>
<footer class="black pos-rlt">
	<div class="footer dk">
		<div class="text-center container p-y-lg">
			<div class="clearfix text-lg m-t">
				<strong>MobanBox</strong> 网站管理系统
			</div>
		</div>
		<div class="b b-b"></div>
		<div class="p-a-md">
			<div class="row footer-bottom">
				<div class="col-sm-8">
					<small class="text-muted">&copy; Copyright 2015. All rights reserved.</small>
				</div>
				<div class="col-sm-4">
					<div class="text-sm-right text-xs-left">
						<strong>Mobanbox</strong>
					</div>
				</div>
			</div>
		</div>
	</div>
</footer>
<!-- theme switcher -->
<div class="switcher box box-color lt" id="changeskins">
	<a href ui-toggle-class="active" target="#changeskins" class="white sw-btn">
		<i class="icon-pifu"></i>
	</a>
	<div class="box-header">
		<h2>更换皮肤
			<button type="button" id="clearLocalStorage" class="btn btn-link p-a-0 m-a-0 icon-reload pull-right" title="还原默认设置"></button>
		</h2>
	</div>
	<div class="box-divider"></div>
	<div class="box-body">
		<!--<p id="settingLayout" class="hidden-md-down">
          <label class="md-switch m-r-sm">
            <input type="checkbox" class="has-value" id="sidebar-option">
            <i class="skin" style="margin-right: 36px;margin-top: -4px;"></i>
            <span class="hidden-folded p-t-xs">打开边栏</span>
          </label>
          <label class="md-switch">
            <input type="checkbox" class="has-value" id="body-option">
            <i class="skin" style="margin-right: 36px;margin-top: -4px;"></i>
            <span class="hidden-folded p-t-xs">盒子模式</span>
          </label>
        </p>-->
		<p id="settingLayout" class="hidden-md-down">
			<label class="md-check m-y-xs m-r-sm">
				<input type="checkbox" id="sidebar-option">
				<i class="skin"></i>
				<span class="hidden-folded">打开边栏</span>
			</label>
			<label class="md-check m-y-xs">
				<input type="checkbox" id="body-option">
				<i class="skin"></i>
				<span class="hidden-folded">盒子模式</span>
			</label>
		</p>

		<p>选择颜色:</p>
		<p id="skintoolsPrimary">
			<label class="ui-check ui-check-color ui-check-md">
				<input type="radio" name="color" value="primary" id="primary1">
				<i class="primary"></i>
			</label>
			<label class="ui-check ui-check-color ui-check-md">
				<input type="radio" name="color" value="accent">
				<i class="accent"></i>
			</label>
			<label class="ui-check ui-check-color ui-check-md">
				<input type="radio" name="color" value="warn">
				<i class="warn"></i>
			</label>
			<label class="ui-check ui-check-color ui-check-md">
				<input type="radio" name="color" value="success">
				<i class="success"></i>
			</label>
			<label class="ui-check ui-check-color ui-check-md">
				<input type="radio" name="color" value="info">
				<i class="info"></i>
			</label>
			<label class="ui-check ui-check-color ui-check-md">
				<input type="radio" name="color" value="blue">
				<i class="blue"></i>
			</label>
			<label class="ui-check ui-check-color ui-check-md">
				<input type="radio" name="color" value="warning">
				<i class="warning"></i>
			</label>
			<label class="ui-check ui-check-color ui-check-md">
				<input type="radio" name="color" value="danger">
				<i class="danger"></i>
			</label>
		</p>
		<p>风格选择:</p>
		<div id="skinDark" class="text-u-c text-center _600 clearfix">
			<a data-toggle="" href="#" class="p-x p-y-sm col-xs-6 light"><i class="icon-check2 m-r-xs h"></i>白色</a>
			<a data-toggle="grey" href="#" class="p-x p-y-sm col-xs-6 grey"><span class="text-white"><i class="icon-check2 m-r-xs h"></i>黑色</span></a>
			<a data-toggle="dark" href="#" class="p-x p-y-sm col-xs-6 dark"><span class="text-white"><i class="icon-check2 m-r-xs h"></i>黑蓝</span></a>
			<a data-toggle="black" href="#" class="p-x p-y-sm col-xs-6 black"><span class="text-white"><i class="icon-check2 m-r-xs h"></i>黑紫</span></a>
		</div>
		<p class="m-t-md hidden-md-down">背景图片:</p>
		<div id="co_bg_images_list" class="text-u-c row row-sm text-center hidden-md-down">
			<a href="#" id="bgSkin1" data-toggle="bg_image_1" class="col-xs-6 m-b">
				<img src="/mbthemes/assets/images/skin/small/cgskin1.jpg" class="img-responsive" alt="">
			</a>
			<a href="#" id="bgSkin2" data-toggle="bg_image_2" class="col-xs-6 m-b">
				<img src="/mbthemes/assets/images/skin/small/cgskin5.jpg" class="img-responsive" alt="">
			</a>
			<a href="#" id="bgSkin3" data-toggle="bg_image_3" class="col-xs-6 m-b">
				<img src="/mbthemes/assets/images/skin/small/cgskin6.jpg" class="img-responsive" alt="">
			</a>
			<a href="#" id="bgSkin4" data-toggle="bg_image_4" class="col-xs-6 m-b">
				<img src="/mbthemes/assets/images/skin/small/cgskin4.jpg" class="img-responsive" alt="">
			</a>
			<a href="#" id="bgSkin5" data-toggle="bg_image_5" class="col-xs-6">
				<img src="/mbthemes/assets/images/skin/small/cgskin2.jpg" class="img-responsive" alt="">
			</a>
			<a href="#" id="bgSkin6" data-toggle="bg_image_6" class="col-xs-6">
				<img src="/mbthemes/assets/images/skin/small/cgskin3.jpg" class="img-responsive" alt="">
			</a>
		</div>
		<div class="clearfix"></div>
	</div>
</div>
<!-- theme switcher end / -->
</body>
</html>
