<?php
error_reporting (0); 

$backup = "../inc/install.lock";

if(file_exists($backup)){
	echo "您已安装该文件，如果需要重新安装请删除install目录下的install.lock文件；";
//exit;
}else{
?>
<!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>天宇采集程序数据库安装向导</title>
<script src="../include/dedeajax2.js" language="javascript" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
<!--
    function $o(tid){
        return document.getElementById(tid);
    }
    function TestDb()
    {
		var dbhost = $o('dbhost').value;
        var dbuser = $o('dbuser').value;
        var dbpwd = $o('dbpwd').value;
		$o('havedbsta').innerHTML='<img src=\'images/ajax-loader.gif\'>';
        var myajax = new DedeAjax($o('dbpwdsta'),false,true,'-','-','...');
        myajax.SendGet2('index.php?step=10&dbhost='+dbhost+'&dbuser='+dbuser+'&dbpwd='+dbpwd);
		DedeXHTTP = null;
		HaveDB();
    }
	
	function HaveDB()
    {
		var dbhost = $o('dbhost').value;
        var dbname = $o('dbname').value;
        var dbuser = $o('dbuser').value;
        var dbpwd = $o('dbpwd').value;
        var myajax = new DedeAjax($o('havedbsta'),false,true,'-','-','...');
        myajax.SendGet2('index.php?step=10&dbhost='+dbhost+'&dbuser='+dbuser+'&dbpwd='+dbpwd+'&dbname='+dbname);
		DedeXHTTP = null;
    }
    
	function GetRemoteDemo()
	{
		
		$o('_remotesta').innerHTML='<img src=\'images/ajax-loader.gif\'>';
		var myajax = new DedeAjax($o('_remotesta'),false,true,'-','-','...');
		myajax.SendGet2('index.php?step=11');
		DedeXHTTP = null;
	}
	
    function DoInstall()
    {
        //$o('postloader').style.display = 'block';
        document.form1.submit();
    }
-->
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id='postloader' class='waitpage'></div>

<div class="top">
    <div class="top-logo">
        
    </div>
    <div class="top-link">
        <ul>
            <li><a href="http://www.ababb.com" target="_blank">官方网站</a></li>
            
        </ul>
    </div>
    <div class="top-version">
        <!-- 版本信息 -->
        <h2>天宇采集程序</h2>
    </div>
</div>

<div class="main">
    <div class="pleft">
        <dl class="setpbox t1">
            <dt>安装步骤</dt>
            <dd>
                <ul>
                    <li class="succeed">许可协议</li>
                    <li class="succeed">环境检测</li>
                    <li class="now">参数配置</li>
                    <li>正在安装</li>
                    <li>安装完成</li>
                </ul>
            </dd>
        </dl>
    </div>
    <div class="pright">
	
        <form name="form1" method="post" action="install.php?install=ok">
            
        <div class="pr-title"><h3>数据库设定</h3></div>
        <table width="726" border="0" align="center" cellpadding="0" cellspacing="0" class="twbox">
            <tr>
                <td class="onetd"><strong>数据库主机：</strong></td>
                <td><input name="host" id="host" type="text" value="localhost" class="input-txt" />
                <small>一般为localhost</small></td>
            </tr>
            <tr>
                <td class="onetd"><strong>数据库用户：</strong></td>
                <td><input name="mysqluser" id="mysqluser" type="text" value="" class="input-txt" /></td>
            </tr>
            <tr>
                <td class="onetd"><strong>数据库密码：</strong></td>
                <td>
                  <div style='float:left;margin-right:3px;'><input name="mysqlpass" id="mysqlpass" type="text" value="" class="input-txt" onChange="TestDb()" /></div>
                  <div style='float:left' id='dbpwdsta'></div>
                </td>
            </tr>
			<tr>
                <td class="onetd"><strong>数据库端口：</strong></td>
                <td><input name="port" type="text" value="3306">
                        <small>如无特殊需要,请不要修改</small></td>
            </tr>
			<tr>
                <td class="onetd"><strong>数据库名称：</strong></td>
                <td>
                    <div style='float:left;margin-right:3px;'><input name="mydb" id="mydb" type="text" value="" class="input-txt" onChange="HaveDB()" /></div>
					<div style='float:left' id='havedbsta'></div>
                </td>
            </tr>
			<tr>
                <td class="onetd"><strong>数据库表头：</strong></td>
                <td>
                    <div style='float:left;margin-right:3px;'><input name="sqlbiaotou" id="mydb" type="text" value="wx_" class="input-txt" onChange="HaveDB()" /></div>
					<div style='float:left' id='havedbsta'></div>
                </td>
            </tr>
            
        </table>

        <div class="pr-title"><h3>管理员初始密码</h3></div>
        <table width="726" border="0" align="center" cellpadding="0" cellspacing="0" class="twbox">
            <tr>
                <td class="onetd"><strong>用户名：</strong></td>
                <td>
                    <input name="adminname" type="text" value="admin" class="input-txt" />
                    <p><small>只能用'0-9'、'a-z'、'A-Z'、'.'、'@'、'_'、'-'、'!'以内范围的字符</small></p>
                </td>
            </tr>
            <tr>
                <td class="onetd"><strong>密　码：</strong></td>
                <td><input name="password" type="text" value="admin" class="input-txt" /></td>
            </tr>
            <tr>
			<td class="onetd"><strong>注  意：</strong></td>
                <td style="color:red">此用于后台admin/ 登录的用户名与密码，请牢记！</td>
                
            </tr>
            
        </table>
		<div class="btn-box" align="center">
    
<input type="submit" name="Submit"  value="开始安装">
      </div></div>
       </form>

</div>
<div class="foot">
</div>


</body>
</html><?php }?>