<%@ page language="C#" autoeventwireup="true" inherits="doodii.Web.Install.InstallInfo, DoodiiShop" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<!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 runat="server">
    <title>安装参数设置 - 都来订网络外卖订餐系统</title>
            <script type="text/javascript" src="/js/jquery.js"></script>
</head>
<style type="text/css">
<!--   
*{margin:0; padding:0; }
body{background:url(/images/dld_04.gif) repeat-x 0 93px;}ul,li{list-style:none; font-size:12px;}
.box{width:900px;  margin:0 auto; overflow:hidden;}
.logo{width:317px; height:93px; float:left;}
.nav{ float:right;}
.nav ul{padding:15px 0 0 0;}
.nav ul li{float:left; height:11px; line-height:14px; padding:0 5px;}
.nav ul li a{color:#486375; text-decoration: none;}
.top{width:900px; height:93px;}
.main{width:900px; padding:50px 0 0 0;}
.c_left{width:208px; padding:5px 0 0 0;  float:left; }
.anz{width:206px; background:url(/images/dld_05.gif) repeat-x top; overflow:hidden; padding:2px 0; }
.anz h1{width:196px; height:33px; line-height:33px; padding:0 0 0 10px;  text-align:left;  background:url(/images/dld_08.gif) no-repeat; font-size:13px; color:#34415d;}
.anz ul{width:194px; border-left:1px solid #e1e9ed; border-right:1px solid #e1e9ed; float:left; padding:7px 0 7px 10px;}
.anz ul li{width:173px; height:25px; line-height:25px; color:#486375; padding:0 0 0 20px; text-align:left; background:url(/images/an.gif) no-repeat 9px 6px;}
.anz ul li strong{color:#a73e0a;}
.c_right{width:672px; padding:5px 0 0 0; float:right;}
.buz{width:672px; float:left; background:url(/images/dl_03.gif) repeat-x top; overflow:hidden; padding:2px 0;}
.buz h2{width:672px; height:33px; line-height:33px; text-align:center;  background:url(/images/dld_07_03.gif) no-repeat; font-size:13px; color:#34415d;}
.buz_1{width:665px; float:left;  padding:5px 0px 20px 5px; border-left:1px solid #e1e9ed; border-right:1px solid #e1e9ed;}
.buz_1 table{width:85%; margin:10px auto; font-size:12px; border-top:1px solid #e1e9ed; border-left:1px solid #e1e9ed; border-right:1px solid #e1e9ed;}
.buz_1 table th{font-size:12px;  width:25%; border-bottom:1px solid #e1e9ed; border-right:1px solid #e1e9ed;}
.buz_1 table td{font-size:12px; border-bottom:1px solid #e1e9ed; padding:0 0 0 5px;}
.buz_1 table td input{font-size:12px; width:150px; border:1px solid #ccc; padding:1px}
.xyb{width:672px; margin:0 auto; text-align:center; padding:10px 0 0 0;}
.bz{width:672px; line-height:22px; font-size:12px; margin:0 auto;}
.anli{width:106px; height:26px; background:url(/images/anli.gif) no-repeat; border:0; cursor:hand;}

-->
</style>
<body>
    <form id="form1" runat="server">
    <div class="box">
        <div class="top">
                <div class="logo"><img src="/images/dld_02.gif" /></div>
                <div class="nav">
                <ul>
                <li style="border-right:1px solid #486375;"><a href="http://www.doulaiding.com"  target="_blank">官方首页</a></li>
                <li><a href="http://www.doulaiding.com/help/"  target="_blank">使用帮助</a></li>
                </ul>
                </div>
            </div>
        <div class="main">
            <div class="c_left">
                <div class="anz">
                    <h1>安装步骤</h1>
                    <ul>
                    <li>阅读安装协议</li>
                    <li><strong>安装参数设置</strong></li>
                    <li>完成安装</li>
                    </ul>
                    <p style="float:left;"><img src="/images/dld_03.gif" /></p>
                </div>
            </div>
            <div class="c_right">
            <div class="buz">
                <h2>第二步：安装参数设置</h2>
                <div class="buz_1">
                <table cellpadding="0" cellspacing="0">
  <tr>
    <th height="27" align="right">数据库服务器地址：</th>
    <td height="27"><input type="text" id="tbxServerName"  value="localhost"  /></td>
  </tr>
  <tr>
    <th height="27" align="right">数据库登录用户：</th>
    <td height="27"><input type="text" id="tbxUid"  value=""  /></td>
  </tr>
  <tr>
    <th height="27" align="right">数据库登录密码：</th>
    <td height="27"><input type="password" id="tbxPwd"  value=""  /></td>
  </tr>
  <tr>
    <th height="27" align="right">数据库名称：</th>
    <td height="27"><input type="text" id="tbxDataName"  value=""  /></td>
  </tr>
  <tr>
    <th height="27" align="right">管理员邮箱：</th>
    <td height="27"><input type="text" id="tbxEmail"  value="yourname@yourdomain.com"  /></td>
  </tr>
  <tr>
    <th height="27" align="right">管理员密码：</th>
    <td height="27"><input type="password" id="tbxEPwd"  value=""  /></td>
  </tr>
  <tr>
    <th height="27" align="right">管理员密码确认：</th>
    <td height="27"><input type="password" id="tbxconEPwd"  value=""  /></td>
  </tr>
</table><div class="xyb"><input type="button" onclick="PageLastOne()" value="上一步" id="LastOne"  class="anli" /> <input type="button" onclick="AjaxSqlConTest()" class="anli" value="下一步" id="NextOne"/> </div>
            <div id="Divpre" style="text-align:center"></div>
                </div>
            </div>
            
            <p style="float:left;"><img src="/images/dld_07_06.gif" /></p>
    </div>
        </div>
    </div>
    </form>
    <script type="text/javascript" >
        function AjaxSqlConTest()
        {
            var servername=$.trim($("#tbxServerName").val());
            var Uid=$.trim($("#tbxUid").val());
            var Pwd=$.trim($("#tbxPwd").val());
            var DataName=$.trim($("#tbxDataName").val());
            var Email=$.trim($("#tbxEmail").val());
            var EPwd=$.trim($("#tbxEPwd").val());
            var conEPwd=$.trim($("#tbxconEPwd").val());
            var error="";
            if(servername=="")
            {
                error+="请输入服务器名称！\r\n";
            }
            if(Uid=="")
            {
                error+="请输入登录用户！\r\n";
            }
            if(Pwd=="")
            {
                error+="请输入登录密码！\r\n";
            }
            if(DataName=="")
            {
                error+="请输入附加数据库名称！\r\n";
            }
            if(Email=="")
            {
                error+="请输入管理员邮箱！\r\n";
            }
            else
            {
                if(Email.indexOf("@")==-1||Email.indexOf(".")==-1||Email.indexOf("@")>Email.indexOf("."))
                {
                    error+="管理员邮箱格式不正确！\r\n";
                }
            }
            if(EPwd=="")
            {
                error+="请输入管理员密码！\r\n";
            }
            else
            {
                if(EPwd.length<6||EPwd.length>=17)
                {
                    error+="管理员密码长度不小于6位不大于17位！\r\n";
                }
                else if(EPwd!=conEPwd)
                {
                    error+="管理员密码两次输入的不一样！\r\n";
                }
            }
            if(error!="")
            {
                alert(error);
                return ;
            }
            $("#LastOne").attr("disabled","disabled");

            $("#NextOne").attr("disabled","disabled");

            $("#Divpre").html("<br /><br />正在安装 请稍后<br/><img alt=\"\"  src='/images/loading.gif' /><br />安装过程可能需要几十秒钟时间");

            $.ajax({
                type:"get",
                cache:false,
                url:"Ajax/AjaxInstall.aspx",
                data:"cmd=SqlConTest&servername="+servername+"&Uid="+Uid+"&Pwd="+Pwd+"&DataName="+DataName+"&Email="+Email+"&EPwd="+EPwd, 
                success:function(e){
                        if(e=="成功")
                            PageNextOne();
                        else
                        {
                            location.href="InstallFaile.aspx?Error="+escape(e);
                        }
                    },
                error:function(e){ 
                        alert(e);
                        $("#LastOne").removeAttr("disabled");
                        $("#NextOne").removeAttr("disabled");
                        $("#Divpre").html("");
                    }
            });
        }
        function PageNextOne()
        {
            location.href="Finish.aspx";
        }
        function PageLastOne()
        {
            location.href="InstallIndex.aspx";
        }
    </script>
</body>
</html>
