<?php 
	if(file_exists('../config/db.inc.php')){ 
		header('Location:exist.php');
	}
	$array=array('../','../config','../config/config.inc.php','../Public','../Yi_Box','../YiCms');
	$flag=true;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>YiCms 安装向导</title>
		<link rel="stylesheet" href="images/style.css" type="text/css" media="all" />
	</head>
	<body>
		<div class="container">
			<div class="header">
				<h1>YiCms 安装向导</h1>
				<span>简体中文UTF8 版</span>
					<div class="setup step1">
						<h2>开始安装</h2>
						<p>环境以及文件目录权限检查</p>
					</div>
					<div class="stepstat">
						<ul>
							<li class="current">检查安装环境</li>
							<li class="unactivated">创建数据库</li>
							<li class="unactivated">创建管理员</li>
							<li class="unactivated last">安装</li>
						</ul>
						<div class="stepstatbg stepstat1"></div>
					</div>
			</div>
			<div class="main"><h2 class="title">环境检查</h2>
				<table class="tb" style="margin:20px 0 20px 55px;">
					<tr>
						<th>项目</th>
						<th class="padleft">所需配置</th>
						<th class="padleft">最佳</th>
						<th class="padleft">当前服务器</th>
					</tr>
					<tr>
						<td>操作系统</td>
						<td class="padleft">不限制</td>
						<td class="padleft">类Unix</td>
						<td class="w pdleft1"><?php  echo PHP_OS;?></td>
					</tr>
					<tr>
						<td>PHP 版本</td>
						<td class="padleft">4.3</td>
						<td class="padleft">5.0+</td>
						<td class="w pdleft1"><?php echo PHP_VERSION ?></td>
					</tr>
					<tr>
						<td>附件上传</td>
						<td class="padleft">不限制</td>
						<td class="padleft">2M</td>
						<td class="w pdleft1"><?php echo ini_get('upload_max_filesize')?></td>
					</tr>
					<tr>
						<td>GD 库</td>
						<td class="padleft">1.0</td>
						<td class="padleft">2.0</td>
						<td class="w pdleft1"><?php  $a =  gd_info(); echo  $a['GD Version'];?></td>
					</tr>
					<tr>
					<td>磁盘空间</td>
						<td class="padleft">10M</td>
						<td class="padleft">不限制</td>
						<td class="w pdleft1"><?php echo  floor(disk_free_space($_SERVER['DOCUMENT_ROOT'])/1024/1024)."M"?></td>
					</tr>
				</table>
				<h2 class="title">目录、文件权限检查</h2>
				<table class="tb" style="margin:20px 0 20px 55px;width:90%;">
					<tr>
						<th>目录文件</th>
						<th class="padleft">所需状态</th>
						<th class="padleft">当前状态</th>
					</tr>
					<?php foreach($array as $value){?>
						<tr>	
							<td><?php if($value=='../') echo '网站根目录';else echo $value;?></td>
							<?php   
								if(is_writeable($value)){
							?>
								<td class="w pdleft1">可写</td>
							<?php }else{?>
								<td class="nw pdleft1">不可写</td>
							<?php $flag=false;}?>
							<?php   
								if(is_readable($value)){
							?>
								<td class="w pdleft1">可读</td>
							<?php }else{?>
								<td class="nw pdleft1">不可读</td>
							<?php $flag=false;}?>
						</tr>
					<?php } ?>
				</table>
				<div class="btnbox marginbot">
					<?php if($flag==false) {?>
						<input type="button" value="请将以上红叉部分修正再试" disabled/>
					<?php }else{?>	
						<input type="button" onclick="history.back();" value="上一步"/>
						<input type="button" style="padding: 2px" value="下一步" onclick="location.href='step2.php'"/>&nbsp;
					<?php } ?>	
				</div>
</form>
		<div class="footer">&copy;2012 - 2013 <a href="http://www.yicms.cn/">YiCms</a> Inc.</div>
		<div class="footer">您有任何疑问，可以登录<a href="http://bbs.yicms.cn" target="_blank"><b>YiCms官方论坛</b></a>或加<b>交流QQ群：174069335</b></div>
	</div>

</div>

</body>

</html>
