<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="step1.aspx.cs" Inherits="web.install.step1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<LINK href="css/styles.css" type="text/css" rel="stylesheet">
<title>生成HTML全诚易餐通 - 专业外卖(预订)叫餐系统SQL版安装向导 </title>


<script type="text/javascript">

function checknull()
{
  if (document.getElementById("serverip").value == "")
    {
        alert("服务器IP地址必须填写!");
        document.getElementById("serverip").focus();
        return false;
    }
   if (document.getElementById("dataname").value == "")
    {
        alert("数据库名称必须填写!");
        document.getElementById("dataname").focus();
        return false;
    }
	  if (document.getElementById("datauser").value == "")
    {
        alert("数据库录连接用户名必须填写!");
        document.getElementById("datauser").focus();
        return false;
    }
	  if (document.getElementById("datapwd").value == "")
    {
        alert("数据库录连接密码必须填写!");
        document.getElementById("datapwd").focus();
        return false;
    }
		  if (document.getElementById("xtuser").value == "")
    {
        alert("系统管理员帐号必须填写!");
        document.getElementById("xtuser").focus();
        return false;
    }
		  if (document.getElementById("xtpwd").value == ""|| document.getElementById("xtpwd").value.length < 6)
    {
        alert("系统管理员密码必须填写必须不能小于6位!");
        document.getElementById("xtpwd").focus();
        return false;
    }

    if (document.getElementById("rxtpwd").value == "")
    {
        alert("确认密码不能为空");
        document.getElementById("rxtpwd").focus();
        return false;
    }
    if (document.getElementById("xtpwd").value != document.getElementById("rxtpwd").value)
    {
        alert("系统管理员密码两次输入不同,请重新输入");
        document.getElementById("xtpwd").focus();
        document.getElementById("xtpwd").value = "";
        document.getElementById("rxtpwd").value = "";
        return false;
    }

    
}
</script>
<script language="javascript"> 
         
              function jb() 
              { 
                 var A=null; 
               try 
               { 
                   A=new ActiveXObject("Msxml2.XMLHTTP"); 
                } 
                 catch(e) 
                 { 
                  try 
                   { 
                      A=new ActiveXObject("Microsoft.XMLHTTP"); 
                   } 
                       catch(oc) 
                      { 
                     A=null 
                   } 
              } 
           if ( !A && typeof XMLHttpRequest != "undefined" ) 
            { 
               A=new XMLHttpRequest() 
             } 
           return A 
              } 
              
           
              function Go() 
              { 
              
             
              
                 var weburl = "cl.aspx?act=cl&serverip="+document.getElementById("serverip").value+"&dataname="+document.getElementById("dataname").value+"&datauser="+document.getElementById("datauser").value+"&datapwd="+document.getElementById("datapwd").value; 
               
                 var xmlhttp = jb(); 
                
                 xmlhttp.open("get",weburl,true); 
           
                 xmlhttp.onreadystatechange=function() 
                 { 
                   if(xmlhttp.readyState==4)
                    { 
                       var result = xmlhttp.responseText; 
                     
                       if(result!="")
                       { 
                         alert(result);
                       } 
                    } 
                 } 
             
                 xmlhttp.send(null); 
              } 
		</script>

<body>
<form id="Form1" method="post" runat="server" onsubmit="return checknull();">
    
   
        <table cellspacing="1" cellpadding="0" width="700" align="center" bgcolor="#666666"
            border="0">
            <tr>
                <td bgcolor="#ffffff">
                    <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
                        <tr>
                            <td bgcolor="#333" colspan="2">
                                <table cellspacing="0" cellpadding="8" width="100%" border="0">
                                    <tr>
                                        
                  <td> <font color="#ffffff">设置与SQL数据库连接相关参数、系统管理帐号和密码</font> <asp:Label ID="Label1" runat="server" Text=""></asp:Label></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            
            <td valign="top" width="180"> <img src="images/logo.jpg" width="180" height="300" /> 
            </td>
                            <td valign="top" width="520">
                                <br>
                     
                                <table cellspacing="0" cellpadding="8" width="100%" border="0">
                                    <tr>
                                        <td>
                                            <p>
                                            </p>
                                 <asp:Panel ID="Panel1" runat="server"  Width="100%">                
                    <table cellspacing="0" cellpadding="8" width="100%" border="0">
                      <tr> 
                        <td width="30%">服务器IP地址:</td>
                        <td style="width: 352px"> <asp:TextBox ID="serverip" runat="server" 
                                                            Width="150px">127.0.0.1</asp:TextBox> *</td>
                      </tr>
                      <tr> 
                        <td>数据库名称:</td>
                        <td style="width: 352px"> <asp:TextBox ID="dataname" runat="server" 
                                                            MaxLength="20" Size="20" Width="150px"></asp:TextBox>
                          *&nbsp; </td>
                      </tr>
                      <tr> 
                        <td>数据库连接用户名:<br />
                         </td>
                        <td style="width: 352px"> <asp:TextBox ID="datauser" runat="server" 
                                                            MaxLength="32" Size="20" Width="150px"></asp:TextBox>
                          *<br />
                        </td>
                      </tr>
					      <tr> 
                        <td>数据库连接密码:<br />
                         </td>
                        <td style="width: 352px"> <asp:TextBox ID="datapwd" runat="server"  TextMode="Password"
                                                            MaxLength="32" Size="20" Width="150px"></asp:TextBox>
                          *<br />
                        </td>
                      </tr>
                      <tr> 
                        <td>系统管理员帐号:</td>
                        <td style="width: 352px"><asp:TextBox ID="xtuser" runat="server" 
                                                            MaxLength="32" Size="20" Width="150px"></asp:TextBox> * </td>
                      </tr>
                      <tr> 
                        <td>系统管理员密码:</td>
                        <td style="width: 352px"><asp:TextBox ID="xtpwd" runat="server"  TextMode="Password"
                                                            MaxLength="32" Size="20" Width="150px"></asp:TextBox> *</td>
                      </tr>
					    <tr> 
                        <td>确认密码:</td>
                        <td style="width: 352px"><asp:TextBox ID="rxtpwd" runat="server"  TextMode="Password"
                                                            MaxLength="32" Size="20" Width="150px"></asp:TextBox> *</td>
                      </tr>
					
					    <tr> 
                        <td>是否添加测试数据:</td>
                        <td style="width: 352px">
                            <asp:RadioButtonList ID="iscs" runat="server">
                            <asp:ListItem Value="1" Selected="true" >是</asp:ListItem>
                            <asp:ListItem Value="2"  >不</asp:ListItem>
                            </asp:RadioButtonList>
						</td>
                      </tr>
                      <tr> 
                        <td style="background-color: #f5f5f5"> 数据库类型:</td>
                        <td style="background-color: #f5f5f5; width: 352px;"> 
                          <asp:DropDownList ID="ddlDbType" runat="server" > 
                           
                            <asp:ListItem Value="SqlServer">SqlServer</asp:ListItem>
                       
                          </asp:DropDownList> </td>
                      </tr>
                     
                    
                    </table>
                         </asp:Panel>
                    <div align="center">
                      <asp:Panel ID="Panel2" runat="server" Width="100%"> 
                          <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
                      </asp:Panel>
                    </div></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;
                                </td>
                            <td>
                                <table cellspacing="0" cellpadding="8" width="60%" border="0">
                                    <tr>
                                        <td align="right">
                                            <input id="Button2" type="button" value="测试连接是否成功"  onclick="Go()"/>     <asp:Button  ID="ClearDBInfo" runat="server" Text="开始安装" OnClick="ClearDBInfo_Click"  ></asp:Button>&nbsp;&nbsp;
                                            </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                
                </td>
            </tr>
        </table>
       <div align="center"><br />
  <br />
  Powered by <a href="http://www.1wsoft.cn" target="_blank">全诚易餐通 - 专业外卖(预订)叫餐系统</a> (.NET Framework 2.0) </div>
    </form>
</body>
</html>
