<%@ page language="C#" autoeventwireup="true" inherits="system_iis, aoshuosoft" %>

<!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>
    <link rel="stylesheet" href="skin.css" type="text/css" />
</head>
<script language="javascript">
function checkym()
{
	var ipArray,ip,j;
	ip = document.form1.bddomain.value;
 
		if(!/^([\w-]+\.)+((com)|(net)|(org)|(gov\.cn)|(info)|(cc)|(com\.cn)|(net\.cn)|(org\.cn)|(name)|(biz)|(tv)|(cn)|(mobi)|(name)|(sh)|(ac)|(io)|(tw)|(com\.tw)|(hk)|(com\.hk)|(ws)|(travel)|(us)|(tm)|(la)|(me\.uk)|(org\.uk)|(ltd\.uk)|(plc\.uk)|(in)|(eu)|(it)|(jp))$/.test(ip))
		{
			alert("输入的域名不是正确！");
			return   false;  
		}		
		}
</script>
<body>
    <form id="form1" runat="server" >
    <div>
        <asp:Panel ID="iis" runat="server" Height="50px" Width="100%" Visible="false">
            <asp:GridView ID="GridView1" runat="server" Width="100%" OnPageIndexChanging="GridView1_PageIndexChanging" CellPadding="4" AllowPaging="True" AutoGenerateColumns="False" PageSize="20" ForeColor="#333333" GridLines="None">
                <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
                <Columns>
                     <asp:TemplateField HeaderText="网站域名"><ItemTemplate><a href="<%#Eval("dnsname") %>" target="_blank"><%#Eval("dnsname") %>浏览</a></ItemTemplate></asp:TemplateField>
                    <asp:TemplateField HeaderText="用户名"><ItemTemplate><a href="user.aspx?name=<%#Eval("webname") %>"><%#Eval("webname") %></a></ItemTemplate></asp:TemplateField>
                    <asp:TemplateField HeaderText="设置为备案"><ItemTemplate><a href="iis.aspx?name=<%#Eval("webname") %>&ba=yes">设置为备案</a></ItemTemplate></asp:TemplateField>
                    <asp:TemplateField HeaderText="设置未备案"><ItemTemplate><a href="iis.aspx?name=<%#Eval("webname") %>&ba=no">设置未备案</a></ItemTemplate></asp:TemplateField>
                    <asp:TemplateField HeaderText="删除"><ItemTemplate><a href="iis.aspx?id=<%#Eval("id") %>&ym=<%#Eval("dnsname") %>&del=yes"  onclick=" return confirm('删除并不可恢复！您真的要删除吗？')">删除</a></ItemTemplate></asp:TemplateField>
                </Columns>
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#2461BF" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
        </asp:Panel>         
        <asp:Panel ID="cxiis" runat="server" Width="100%" Visible="false">
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <table align="center" border="0" cellpadding="3" cellspacing="1" class="table" style="font-size: 12px">
                <tr>
                    <td colspan="2" style="font-weight: bold; font-size: 12px; height: 34px; text-align: center">
                        查询域名</td>
                </tr>
                <tr>
                    <td>
                        输入域名：</td>
                    <td>
                        <asp:TextBox ID="cxym" runat="server"></asp:TextBox>
                        前面不要加“http://”</td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: center">
                        <asp:Button ID="ymcx" runat="server" Text="查询" Width="120px" OnClick="ymcx_Click"  /></td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Panel ID="adddomain" runat="server" Height="50px" Width="100%" Visible="false">
            <br />
            <br />
            <br />
            <table align="center" border="0" cellpadding="3" cellspacing="1" class="table" style="font-size: 12px">
                <tr>
                    <td colspan="2" style="font-weight: bold; font-size: 12px; height: 34px; text-align: center">
                        绑定域名</td>
                </tr>
                <tr>
                    <td style=" text-align:right;">
                        输入域名：</td>
                    <td>
                        <asp:TextBox ID="bddomain" runat="server"></asp:TextBox>
                        &nbsp;前面不要加“http://”</td>
                </tr>
                <tr>
                    <td  style=" text-align:right;">
                        用户名：</td>
                    <td>
                        <asp:TextBox ID="bduser" runat="server" OnClick="checkym();" ></asp:TextBox>
                        要绑定此域名的用户名称</td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: center">
                        <asp:Button ID="bd" runat="server" Text="绑定" Width="120px" OnClick="bd_Click"  /></td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Panel ID="cjym" runat="server" Height="50px" Width="100%" Visible="false">
            <table border="0" class="adminmaintable" cellpadding="3" cellspacing="1" width="100%">
                <tr>
                    <td colspan="2" style="font-weight:bold;height: 30px" align="center" >
                        重建IIS域名</td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <asp:Button ID="sciisym" runat="server" Text="删除所有IIS域名" OnClick="sciisym_Click"  />
                        <asp:Button ID="cjiisym" runat="server" Text="重建IIS域名" OnClick="cjiisym_Click" /></td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        原二级域名：<asp:TextBox ID="yym" runat="server"></asp:TextBox>新二级域名：<asp:TextBox ID="xym" runat="server"></asp:TextBox><asp:Button ID="gxejym" runat="server" Text="更新" OnClick="gxejym_Click" /></td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Literal ID="tj" runat="server"></asp:Literal>
    </div>
    </form>
</body>
</html>
