<!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>地铁客开源轻博客系统 1.8 beta安装向导</title>
<link href="image/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
if( $err == 'ok')
{
	$step = 6;
}else{
	$step = 5;
}
?>
<form action="index.php?step=<?php echo $step ?>" method="post">
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th width="420" height="100" align="left" valign="top" scope="col"><img src="image/logo.gif" width="420" height="100" alt="logo" /></th>
    <th width="480" align="left" valign="middle" scope="col"> * 初始化系统</th>
  </tr>
  <tr>
    <td colspan="2" align="left" scope="col">
    <table width="100%" cellspacing="1" border="0" bgcolor="#3366CC" align="center"  style="box-shadow:0 0 5px #06C;">
        <tbody>
          <tr>
            <td class="message"><li>这一步将安装操数据库。</li>
              <li>请在下方输入数据库相关信息。若您不清楚，请咨询主机提供商。</li>
              </td>
          </tr>
        </tbody>
      </table>


       <?php if($err != '') { ?>
        <div style="height:10px"></div>
       <table width="100%" cellspacing="1" border="0" bgcolor="#FFD2D3" align="center"  style="box-shadow:0 0 5px #06C;">
        <tbody>
          <tr>
            <td class="message"> <?php echo $err; ?> </td>
          </tr>
        </tbody>
      </table>
      <?php  } ?>



	<table class="form-table">
		<tbody>
        <tr>
			<th scope="row"><label for="dbhost">数据库主机</label></th>
			<td><input type="text" value="<?php echo postDefault('host','localhost'); ?>" size="25" id="dbhost" name="host" class="ipt"></td>
			<td>通常情况下，应填写 localhost，若测试连接失败，请联系主机提供商咨询。</td>
		</tr>
        <tr>
			<th scope="row"><label for="dbname">数据库名</label></th>
			<td><input type="text" value="<?php echo postDefault('name','dtk'); ?>" size="25" id="dbname" name="name" class="ipt">
			  <br />
			  库不存在试图创建
			  <input name="creatdb" type="checkbox" id="creatdb" value="1" checked="checked" /></td>
			<td>您希望 ditieker 使用哪个数据库运行？</td>
		</tr>
		<tr>
			<th scope="row"><label for="uname">用户名</label></th>
			<td><input type="text" value="<?php echo postDefault('user','root'); ?>" size="25" id="uname" name="user" class="ipt"></td>
			<td>您的 MySQL 用户名</td>
		</tr>
		<tr>
			<th scope="row"><label for="pwd">密码</label></th>
			<td><input type="password" size="25" id="pwd" name="pwd" value="<?php echo postDefault('pwd',''); ?>" class="ipt"></td>
			<td>... 以及 MySQL 密码。</td>
		</tr>

		<tr>
			<th scope="row"><label for="prefix">表名前缀</label></th>
			<td><input type="text" size="25" value="<?php echo postDefault('pre','th_'); ?>" id="prefix" name="pre" class="ipt"></td>
			<td>若您希望在一个数据库中存放多个 ditieker 的数据，请修改本项以做区分。</td>
		</tr>
		<tr>
		  <th scope="row">数据驱动</th>
		  <td><select name="driver" id="driver" style="width:200px">
		    <option value="noselect">请选择您支持的扩展</option>
            <?php foreach (getDatabase() as $d){
            	if($d == $_POST['driver'])
                {
                	$sele = ' selected="selected"';
                }else{
              	  $sele ='';
                }
             ?>
             <option value="<?php echo $d;?>" <?php echo $sele; ?>><?php echo $d;?></option>

            <?php } ?>
		    </select></td>
		  <td>请选择您支持的扩展，目前支持MySQL、MySQLi、MsSQL、Sqlite、Oracle，请勿选择我们不支持的扩展</td>
		  </tr>
	    </tbody>
	</table>
	<table class="form-table">
	  </table>



    <div style="height:10px"></div></td>
  </tr>
  <tr>
    <th height="102" colspan="2" align="right" valign="middle" scope="col"><input type="button" name="button2" id="button2" value="上一步"  onclick="window.location.href='index.php?step=3'"  class="input"/>

    <?php if ($step == 6){ ?>
      <input type="submit" name="button" id="button" value="检查完毕,开始安装"  class="input"/>
    <?php }else { ?>
     <input type="submit" name="button" id="button" value="测试数据库配置"  class="input"/>
    <?php } ?>

 </th>
  </tr>
</table>
</form>
</body>
</html>
