<?php
include dirname(__FILE__) . '/elements/progress.php';
$STORAGE = &$_SESSION[$controller->defaultInstaller];
?>
<div class="i-wrap">
	<?php
	if (isset($_GET['err']) && !empty($_GET['err']) && isset($_SESSION[$controller->defaultErrors][$_GET['err']]))
	{
		?>
		<div class="i-status i-status-error">
			<div class="i-status-icon"><abbr></abbr></div>
			<div class="i-status-txt">
				<h2>安装错误</h2>
				<p class="t10"><?php echo @$_SESSION[$controller->defaultErrors][$_GET['err']]; ?></p>
			</div>
		</div>
		<?php
	}
	?>
		
	<p>请输入您的MySQL数据库信息，如您不清楚该信息请联系您的服务器提供商。</p>
	<p>安装过程中遇到问题，请联系客服QQ 32557246</p>
	
	<form action="index.php?controller=pjInstaller&amp;action=pjActionStep3&amp;install=1" method="post" id="frmStep2" class="i-form">
		<input type="hidden" name="step2" value="1" />
		<table cellpadding="0" cellspacing="0" class="i-table t20">
			<thead>
				<tr>
					<th>MySQL数据库信息</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>
						<p>
							<label class="i-title">MySQL服务器地址<span class="i-red">*</span></label>
							<input type="text" tabindex="1" name="hostname" class="pj-form-field w200 required" value="<?php echo isset($STORAGE['hostname']) ? htmlspecialchars($STORAGE['hostname']) : 'localhost'; ?>" />
						</p>
						<p>
							<label class="i-title">用户名<span class="i-red">*</span></label>
							<input type="text" tabindex="2" name="username" class="pj-form-field w200 required" value="<?php echo isset($STORAGE['username']) ? htmlspecialchars($STORAGE['username']) : NULL; ?>" />
						</p>
						<p>
							<label class="i-title">密码</label>
							<input type="text" tabindex="3" name="password" class="pj-form-field w200" value="<?php echo isset($STORAGE['password']) ? htmlspecialchars($STORAGE['password']) : NULL; ?>" />
						</p>
						<p>
							<label class="i-title">数据库名<span class="i-red">*</span></label>
							<input type="text" tabindex="4" name="database" class="pj-form-field w200 required" value="<?php echo isset($STORAGE['database']) ? htmlspecialchars($STORAGE['database']) : NULL; ?>" />
                            <span style="display: block;text-indent: 120px;">* 请确保该数据库存在，系统不会自动创建数据库</span>
						</p>
						<p>
							<label class="i-title">数据表名前缀</label>
							<input type="text" tabindex="5" name="prefix" class="pj-form-field w200" value="<?php echo isset($STORAGE['prefix']) ? htmlspecialchars($STORAGE['prefix']) : 'kw_'; ?>" />
							<span style="display: block;text-indent: 120px;">* 除非您同时安装多个本系统，否则不必填写该项</span>
						</p>
					</td>
				</tr>
			</tbody>
		</table>
	
		<div class="t20">
			<p class="float_left pt5">如需帮助请联系客服<a href="http://www.rivuai.com/" target="_blank">QQ 32557246</a></p>
			<input type="submit" tabindex="6" value="下一步 &raquo;" class="pj-button float_right l5" />
			<input type="button" tabindex="7" value="&laquo; 上一步" class="pj-button float_right" onclick="window.location='index.php?controller=pjInstaller&amp;action=pjActionStep1'" />
			<br class="clear_both" />
		</div>
	</form>
</div>