<?php session_start(); ?>
<!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>PHPizabi Installation</title>
<style type="text/css">
<!--
body {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	width: 100%;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  border: none;
}
td, th {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
a:link {
	color: #10203A;
}
a:visited {
	color: #10203A;
}
a:hover {
	color: #10203A;
}
a:active {
	color: #10203A;
}
h1 {
	font-size: 36px;
	color: #FFFFFF;
}
h2 {
	font-size: 24px;
	color: #10203A;
}
#subheader {
	font-size: 13px;
	color: #FFFFFF;
	font-weight: bold;
}

.submit {
	background: #10203A;
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	color: #FFFFFF;
	margin: 2px;
	padding: 3px 15px 3px 15px;
	border-left: solid 1px #999999;
	border-top: solid 1px #999999;
	border-bottom: solid 1px #C0C0C0;
	border-right: solid 1px #C0C0C0;
}

.submitdisabled {
	background: #CCCCCC;
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	color: #FFFFFF;
	margin: 2px;
	padding: 3px 15px 3px 15px;
	border-left: solid 1px #999999;
	border-top: solid 1px #999999;
	border-bottom: solid 1px #C0C0C0;
	border-right: solid 1px #C0C0C0;
}
-->
</style>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="100" colspan="2" align="center" valign="middle" bgcolor="#10203A"><table width="100%" height="100" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="220" align="center" valign="bottom"><img style="text-align:center;" src="images/logo.jpg" alt="PHPizabi" width="148" height="66" /> </td>
        <td align="right" style="padding-right:50px;"><h1>安装PHPizabi中文交友平台</h1></td>
      </tr>
    </table></td></tr>
  <tr>
    <td width="220" valign="top" bgcolor="#999999"><table width="220" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="30" bgcolor="#10203A"><span style="padding-left:8px;"><span id="subheader">安装步骤</span></span></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td style="padding-left:8px;">
            <div id="step1">欢迎</div>
            <div id="step2">查看服务条款</div>
            <div id="step3">系统文件确认</div>
            <div id="step4">文件权限确认</div>
            <div id="step5">数据库信息</div>
            <div id="step6">数据库创建</div>
            <div id="step7">管理员帐号</div>
            <div id="step8">完成安装 </div>
          <p></p></td>
        </tr>
        <tr>
          <td style="padding-left:8px;">&nbsp;</td>
        </tr>
        </table>
    <p></td>
    <td height="100%" align="left" valign="top" bgcolor="#D6D9E0" style="padding-left:8px;"><table width="100%" border="0" cellspacing="30" cellpadding="0">
      <tr>
        <td><?php include(isset($_GET["step"])?"steps/{$_GET["step"]}.php":"steps/1.php"); ?></td>
        </tr>
    </table></td>
  </tr>
  
  
  <tr>
    <td height="35" colspan="2" valign="middle" bgcolor="#999999" style="padding-left:8px;">
	  <span style="
	  font-family: Geneva, Arial, Helvetica, sans-serif;
	  font-size: 10px;
	  color: #666666;
    ">PHPizabi中文交友平台 <br />
	</td>
  </tr>
</table>
</body>

<?php
	
	for ($i=1; $i < (isset($_GET["step"])?$_GET["step"]:1); $i++) {
		echo "
			<script type=\"text/javascript\">
				document.getElementById('step{$i}').style.fontWeight = 'bold';
				document.getElementById('step{$i}').style.color = '#C0C0C0';
			</script>"
		;
	}
	
	echo "
		<script type=\"text/javascript\">
		document.getElementById('step".(isset($_GET["step"])?$_GET["step"]:1)."').style.fontWeight = 'bold';
		document.getElementById('step".(isset($_GET["step"])?$_GET["step"]:1)."').style.color = '#10203A';
		document.getElementById('step".(isset($_GET["step"])?$_GET["step"]:1)."').style.fontSize = '12px';
		document.getElementById('step".(isset($_GET["step"])?$_GET["step"]:1)."').style.paddingLeft = '10px';
		</script>"
	;
	
	if (isset($GLOBALS["processors"])) foreach ($GLOBALS["processors"] as $proc) {
		include("includes/{$proc}");
	}
?>
</html>