<%@ Page Language="c#" Inherits="WebApp.EidtRegister" CodeBehind="EditRegister.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>下属网站注册信息修改</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/adminCssEdit.htm" -->

    <script language="javascript" type="text/javascript">
		    function checkDomainChange()
		    {
		        if(document.all.txtDomainName.value.LTrim().RTrim().length==0)
		        {
		            alert("请输入网站域名！");
		            return false;
		        }
		        var reg1 = /^[a-zA-z]+:\/\/(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$/;
		        if(!reg1.test("http://" + document.all.txtDomainName.value.LTrim().RTrim()))
		        {
		            alert("域名格式错误！请按如下格式输入：\r\nwww.demo.com");
		            document.all.txtDomainName.focus();
		            return false;
		        }
		        if(document.all.txtWebSpace.value.LTrim().RTrim().length==0)
		        {
		            alert("请输入网站分配空间大小，不限制请输入0！");
		            return false;
		        }
		        var reg = /^\d+$/;
		        if(!reg.test(document.all.txtWebSpace.value.LTrim().RTrim()))
		        {
		            alert("空间大小，请输入大于等于0的整数！");
		            return false;
		        }
		        if(document.all.txtLinkman.value.LTrim().RTrim().length==0)
		        {
		            alert("请输入联系人！");
		            return false;
		        }
		        if(document.all.txtPhone.value.LTrim().RTrim().length==0)
		        {
		            alert("请输入联系电话！");
		            return false;
		        }
		        if(document.all.txtEmail.value.LTrim().RTrim().length==0)
		        {
		            alert("请输入E-mail！");
		            return false;
		        }
		        var regEmail = /^[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)*$/;		        
		        if(!regEmail.test(document.all.txtEmail.value.LTrim().RTrim()))
		        {
		            alert("E-mail格式不正确，请重新输入！");
		            document.all.txtEmail.focus();
		            return false;
		        }
		        var msg = "";
		        var isChanged = false;
		        if(document.all.hiddenOldSchool.value.LTrim().RTrim()!=document.all.txtSchoolName.value.LTrim().RTrim())
		        {
		            isChanged = true;
		            msg = "·网站名称由原“" + document.all.hiddenOldSchool.value + "”修改为“" + document.all.txtSchoolName.value + "”";		            
		        }	        
		        if(document.all.hiddenSerial.value.LTrim().RTrim()!=document.all.txtSN.value.LTrim().RTrim())
		        {
		            isChanged = true;
		            if (msg.LTrim().RTrim().length!=0)
		                msg = msg + "\r\n·序列号由原“" + document.all.hiddenSerial.value + "”修改为“" + document.all.txtSN.value + "”";
		            else 
		                msg = "·序列号由原“" + document.all.hiddenSerial.value + "”修改为“" + document.all.txtSN.value + "”"; 
		        }
		        if(document.all.hiddenDomain.value.LTrim().RTrim()!=document.all.txtDomainName.value.LTrim().RTrim())
		        {
		            isChanged = true;		            
		            if (msg.LTrim().RTrim().length!=0)
		                msg = msg + "\r\n·域名“" + document.all.hiddenDomain.value + "”修改为“" + document.all.txtDomainName.value + "”";
		            else 
		                msg = "·域名由原“" + document.all.hiddenDomain.value + "”修改为“" + document.all.txtDomainName.value + "”";
		        }	
		        if(isChanged==true)
		            return confirm("系统检测到网站相关数据被修改，详细如下：\r\n" + msg + "\r\n您确定要提交这些修改吗？");
		    }
		    String.prototype.Trim = function() 
            { 
            return this.replace(/(^\s*)|(\s*$)/g, ""); 
            } 

            String.prototype.LTrim = function() 
            { 
            return this.replace(/(^\s*)/g, ""); 
            } 

            String.prototype.RTrim = function() 
            { 
            return this.replace(/(\s*$)/g, ""); 
            } 		    
    </script>

</head>
<body>
    <div class="edit-func-box func-box">
        <div class="hd">
            修改子站信息
        </div>
        <form id="frmAddRegister" method="post" runat="server">
        <div class="bd">
            <table class="edit-table">
                <tr>
                    <th>
                        <font color="red"></font>网站名称：
                    </th>
                    <td colspan="3">
                        <asp:TextBox ID="txtSchoolName" CssClass="input-txt input-txt3" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        <font color="red"></font>序列号：
                    </th>
                    <td colspan="3">
                        <asp:TextBox ID="txtSN" CssClass="input-txt input-txt3" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        <font color="red"></font>域名：
                    </th>
                    <td colspan="3">
                        <asp:TextBox ID="txtDomainName" runat="server"  CssClass="input-txt input-txt1"></asp:TextBox>
                        <span style="color: Red">注：请确保所填写的域名与将建站的web服务器ip地址之间已做好域名解析，否则网站将不能正常访问。</span>
                    </td>
                </tr>
                <tr>
                    <th width="15%">
                        <font color="red"></font>网站分配空间大小：
                    </th>
                    <td width="35%">
                        <asp:TextBox ID="txtWebSpace" runat="server" Width="56px" MaxLength="4">0</asp:TextBox>MB（0为不限制大小）
                    </td>
                    <th width="15%">
                        <font color="red"></font>已使用空间：
                    </th>
                    <td width="35%">
                        <asp:TextBox ID="txtUsedSpace" runat="server" Width="88px" Enabled="False"></asp:TextBox>MB
                    </td>
                </tr>
                <tr>
                    <th>
                        数据库名称：
                    </th>
                    <td colspan="3">
                        <asp:TextBox ID="txtDBName" CssClass="input-txt input-txt3" runat="server" Width="112px"
                            Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        <font color="red">*</font>联系人：
                    </th>
                    <td>
                        <asp:TextBox ID="txtLinkman" CssClass="input-txt input-txt1" runat="server"></asp:TextBox>
                    </td>
                    <th>
                        <font color="red">*</font>联系电话：
                    </th>
                    <td>
                        <asp:TextBox ID="txtPhone" CssClass="input-txt input-txt1" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr class="tdbg">
                    <th>
                        <font color="red">*</font>E-mail：
                    </th>
                    <td align="left">
                        <asp:TextBox ID="txtEmail" CssClass="input-txt input-txt1" runat="server"></asp:TextBox>
                    </td>
                    <th>
                        QQ：
                    </th>
                    <td>
                        <asp:TextBox ID="txtQQ" CssClass="input-txt input-txt1" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        MSN：
                    </th>
                    <td colspan="3">
                        <asp:TextBox ID="txtMSN" CssClass="input-txt input-txt1" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        移动电话：
                    </th>
                    <td colspan="3">
                        <asp:TextBox ID="txtMobile" CssClass="input-txt input-txt1" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        备注：
                    </th>
                    <td colspan="3">
                        <asp:TextBox ID="txtRemark" Font-Names="宋体" Font-Size="9pt" runat="server" Width="340"
                            TextMode="MultiLine" Rows="3"></asp:TextBox>
                    </td>
                </tr>
            </table>
            <div class="ft">
                <div class="action-field txt-c">
                    <asp:Button ID="btnSave" CssClass="btn" runat="server" Text="保存" OnClick="btnSave_Click">
                    </asp:Button>&nbsp;<asp:Button ID="btnCancel" CssClass="btn" runat="server" Text="取消"
                        OnClick="btnCancel_Click" CausesValidation="False"></asp:Button><font color="red">注意：带“*”为必填项。</font></TD>
                </div>
            </div>
            <input id="hiddenDomain" type="hidden" runat="server" />
            <input id="hiddenSerial" runat="server" name="hiddenSerial" type="hidden" />
            <input id="hiddenOldSchool" runat="server" name="hiddenOldSchool" type="hidden" />
        </div>
        </form>
    </div>
</body>
</html>
