<?php
set_time_limit( 0 );
?><html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>WebMagiK安装页面</title>
<meta name="keywords" content="<?php echo _conf( 'WEB_SITE_SEO_META_KEYWORD' ) ?>">
<meta name="description" content="<?php echo _conf( 'WEB_SITE_SEO_META_DESCRIP' ) ?>">
<?php echo _conf('WEB_SITE_SEO_HEADER_CODE'); ?>
<link href="res/css/douya.css" rel="stylesheet" type="text/css">
</head>

<body>
<br/>
<table border="0" width="98%" id="table1" cellspacing="0" cellpadding="0" height="40" align="center">
	<tr>
		<td valign="top"><br/><span class="title_2">WebMagik快速安装页面</span>&nbsp;&nbsp;&nbsp;
		</td>
		<td rowspan="2" valign="bottom">
		<p align="right">
		<a href="http://webmagik.cn/"><img border="0" src="res/img/logo.png"  vspace="8" hspace="20"></a><br/>
				</td>
	</tr>
	</table>
	<table border="0" width="98%" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td valign="top">
		</td>
		<td align="right" valign="top">
		</td>
	</tr>
</table>
<hr align="left" color="#eff1f2" noShade SIZE="1">
<div style="padding:30px">
<?php


// 2 初始化数据库和数据表
require_once( ROOT . 'conf/db.config.php' );
require( ROOT . 'install/init_db_table.php' );

// 3 初始化城市表
require( ROOT . 'install/init_city_table.php' );


// 4 初始化管理账号
echo $sql = "INSERT INTO `dy_user` (  `dy_email` , `dy_password` , `dy_joindate` , `dy_nickname` , `dy_isactive` , `dy_level`  ) 
VALUES (  '" . _s( $_REQUEST['admin_email'] ) . "', '" .  _s( MD5($_REQUEST['admin_password']) ) . "', NOW( ) , '" . _s( $_REQUEST['admin_username'] ) . "', '1', '9');";

run_sql( $sql , db() );

echo mysql_error();

/*
*/

$_REQUEST['a'] = 'install';

echo '安装完成，请删除install目录后，<a href="index.php">访问index.php</a>';


?>
</body>
</form>
</html>