<!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>BookingeCMS <?php echo $MyConfig['Config']['version']; ?> 安装</title>
<meta name="keywords" content="BookingeCMS安装" />
<meta name="description" content="BookingeCMS安装" />
<meta name="generator" content="BookingeCMS <?php echo $MyConfig['Config']['version']; ?>" />
<link type="text/css" href="css/main.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(function() {
	$(".txt").blur(function() {
		var v = $(this).val();
		if(v.length == 0) {
			$("#isnull_" + $(this).attr("id")).show();
		} else {
			$("#isnull_" + $(this).attr("id")).hide();
		}
	});
	$("#cb_newDatabase").click(function() {
		if($(this).attr("checked")) {
			$("#newDatabase").show();
			$("#confirmPassword").show();
		} else {
			$("#newDatabase").hide();
			$("#confirmPassword").hide();
		}
	});
	$("#next").click(function() {
		var tip = "";
		if($("#isnull_sql_name").css("display") != "none" || $("#sql_name").val() == "") tip += (tip.length > 0 ? "、" : "") + "名称";
		if($("#isnull_sql_username").css("display") != "none" || $("#sql_username").val() == "") tip += (tip.length > 0 ? "、" : "") + "用户名";
		if($("#isnull_sql_password").css("display") != "none" || $("#sql_password").val() == "") tip += (tip.length > 0 ? "、" : "") + "密码";
		if($("#isnull_sql_ip").css("display") != "none" || $("#sql_ip").val() == "") tip += (tip.length > 0 ? "、" : "") + "服务器";
		if($("#cb_newDatabase").attr("checked")) {
			if($("#isnull_sql_manager").css("display") != "none" || $("#sql_manager").val() == "") tip += (tip.length > 0 ? "、" : "") + "管理帐号";
			if($("#isnull_sql_managerpassword").css("display") != "none" || $("#sql_managerpassword").val() == "") tip += (tip.length > 0 ? "、" : "") + "管理密码";
			if($("#isnull_sql_password_second").css("display") != "none" || $("#sql_password_second").val() == "") tip += (tip.length > 0 ? "、" : "") + "密码确认";
		}
		if(tip == "") {
			$("#form_sql").submit();
		} else {
			alert("数据库" + tip + "不能为空！");
		}
	});
	<?php echo $return; ?>
	
});
</script>
</head>

<body>
<div class="wrap">
<div class="side s_clear">
<div class="side_bar">
<h1><?php echo $MyConfig['Config']['version']; ?></h1>
<ul>
<li class="currentitem">欢迎</li>
<li class="currentitem">环境检测</li>
<li class="currentitem">数据库信息</li>
<li>网站信息</li>
<li>完成</li>
</ul>
<div class="copy"><!-- 珠海中新信息科技有限公司 --></div>
</div>
</div>
<div class="main s_clear">
<form id="form_sql" action="index.php?step=3" method="post">
<input type="hidden" name="dbcover" id="dbcover" value="false" />
<div class="content">
<h1>数据库信息</h1>
<div class="info">请认真填写下面的数据库信息：</div>
<div class="inner">
<div class="hint_info">自动创建数据库选项适用于独立主机或本地安装;选择自动创建数据库时,如果数据库用户名不存在,系统将自动创建;虚拟主机的用户安装时,请不要勾选"自动创建数据库"
</div>
<table cellspacing="0" cellpadding="0" summary="setup" class="setup">
<tr>
<td class="title">数据库名称:</td>
<td>
<input name="sql_name" id="sql_name" class="txt" type="text" value="<?php echo isset($_POST['sql_name']) ? $_POST['sql_name'] : $MyDB['dbname']; ?>" />
<span id='isnull_sql_name' style="color:#f00; display:none;">此处不能为空！</span>
<input name="cb_newDatabase" id="cb_newDatabase" type="checkbox"<?php echo isset($_POST['cb_newDatabase']) ? ' checked' : ''; ?> /><label for="cb_newDatabase" style="cursor:pointer;">自动创建数据库</label>
</td>
</tr>	
<tbody id="newDatabase" class="other_item"<?php echo isset($_POST['cb_newDatabase']) ? '' : ' style="display:none"'; ?>>
<tr>
<td class="title">数据库管理帐号:</td>
<td>
<input name="sql_manager" id="sql_manager" class="txt" type="text" value="<?php echo isset($_POST['sql_manager']) ? $_POST['sql_manager'] : $_POST['sql_manager']; ?>" />
<span id='isnull_sql_manager' style="color:#f00; display:none;">此处不能为空！</span>
<span style="color:#339">例如：root(创建数据库时使用)</span>
</td>
</tr>
<tr>
<td class="title">数据库管理密码:</td>
<td>
<input name="sql_managerpassword" id="sql_managerpassword" class="txt" type="password" value="<?php echo isset($_POST['sql_managerpassword']) ? $_POST['sql_managerpassword'] : $_POST['sql_managerpassword']; ?>" />
<span id='isnull_sql_managerpassword' style="color:#f00; display:none;">此处不能为空！</span>
</td>
</tr>
<tr>
<td colspan="2"><div style="border-top:1px dashed #ccc; height:1px; overflow:hidden;"></div></td>
</tr>
</tbody>
<tbody>
<tr>
<td class="title">数据库用户名:</td>
<td>
<input name="sql_username" id="sql_username" class="txt" type="text" value="<?php echo isset($_POST['sql_username']) ? $_POST['sql_username'] : $MyDB['username']; ?>" />
<span id='isnull_sql_username' style="color:#f00; display:none;">此处不能为空！</span>
<span style="color:#339">连接数据库时使用</span>
</td>
</tr>
<tr>
<td class="title">数据库密码:</td>
<td>
<input name="sql_password" id="sql_password" class="txt" type="password" value="<?php echo isset($_POST['sql_password']) ? $_POST['sql_password'] : $MyDB['password']; ?>" />
<span id='isnull_sql_password' style="color:#f00; display:none;">此处不能为空！</span>
</td>
</tr>
<tbody id="confirmPassword"<?php echo isset($_POST['cb_newDatabase']) ? '' : ' style="display:none"'; ?>>
<tr >
<td class="title">数据库密码确认:</td>
<td>
<input name="sql_confirmPassword" id="sql_confirmPassword" class="txt" type="password" value="<?php echo isset($_POST['sql_confirmPassword']) ? $_POST['sql_confirmPassword'] : $MyDB['password']; ?>" />
<span id='isnull_sql_password_second' style="color:#f00; display:none;">此处不能为空！</span>
<span style="color:#339">密码不支持复制粘贴</span>
</td>
</tr>
</tbody>
<tr>
<td colspan="2"><div style="border-top:1px dashed #ccc; height:1px; overflow:hidden;"></div></td>
</tr>
<tr>
<td class="title">数据库服务器:</td>
<td >
<input name="sql_ip" id="sql_ip" class="txt" type="text" value="<?php echo isset($_POST['sql_ip']) ? $_POST['sql_ip'] : $MyDB['hostname']; ?>" />
<span id="isnull_sql_ip" style="color:#f00; display:none;">此处不能为空！</span>
<span style="color:#339">数据库主机地址 冒号后面是端口</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="btn_box">
<button type="button" id="next">下一步</button>
</div>
</form>
</div>
</div>
</body>
</html>