<%@ Page Title="网站列表" Language="C#" MasterPageFile="~/Manager/Manger.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="MWebList.aspx.cs" Inherits="Stat.web.Manerger.MWebList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
$(document).ready(function(){
  $(".forumRowHighlight").css("background-color","F6FBFF");
  $("input[name='chkall']").bind('click',function CheckPower(){ $("input[name='website_power']").attr("checked",$(this).attr("checked")); });
  $("input[value='"+$("#hdfShowStype").val()+"']").attr("checked", true);

});
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpTop" runat="server">
<div style="margin-top: 5px;">
    当前位置：网站管理 &gt; 网站列表
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cpMSG" runat="server">
 <span class="M_b14">小贴士：</span> 你可以管理 统计站点 的信息。     
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cpMain" runat="server">
<br />
       <table align="left" width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td valign="top" align="center">
                    <asp:Panel ID="pnWebList" runat="server" BackColor="White" Width="100%">
                        <asp:GridView ID="gvWebList" runat="server" AutoGenerateColumns="False" EmptyDataText="没有找到站点，请添加"
                            GridLines="None" OnRowCommand="AddUser" OnRowDataBound="gvWebList_RowDataBound1"
                            OnRowDeleting="gvWebList_RowDeleting" OnRowEditing="gvWebList_RowEditing" Width="100%" BorderColor="#CEDFEF" BorderWidth="1px" CssClass="tableBorder">
                            <Columns>
                                <asp:BoundField DataField="WebId" HeaderText="站点ID" SortExpression="WebId">
                                    <HeaderStyle Height="25px" Font-Size="14px" />
                                    <ItemStyle Width="50px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="WebName" HeaderText="站点名称" SortExpression="WebName" >
                                    <ItemStyle HorizontalAlign="Left" Width="150px" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="WebUrl" HeaderText="访问地址" SortExpression="WebUrl" >
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:HyperLinkField DataNavigateUrlFields="webid" 
                                    DataNavigateUrlFormatString="../v/Main.aspx?wid={0}" Target="_blank" Text="查看数据" />
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("WebId")%>'
                                            CommandName="AddUser">设置管理员</asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:HyperLinkField DataNavigateUrlFields="WebId" DataNavigateUrlFormatString="../v/statCode.aspx?wid={0}"
                                    Text="获取统计代码" Target="_blank">
                                    <ItemStyle Width="90px" CssClass="forumRow" />
                                </asp:HyperLinkField>
                                <asp:ButtonField CommandName="Edit" Text="编辑">
                                    <ItemStyle Width="30px" />
                                </asp:ButtonField>
                                <asp:CommandField ShowDeleteButton="True">
                                    <ItemStyle Width="30px" />
                                </asp:CommandField>
                            </Columns>                            
                            <HeaderStyle BackColor="#E9F1FA" Height="20px" />
                        </asp:GridView>
                        <br />
                        站点名称或Url：<asp:TextBox ID="txtW" runat="server"></asp:TextBox>
                        &nbsp;
                        <asp:Button ID="BtnSearch" runat="server" onclick="BtnSearch_Click" Text="查找" /> 
                        <br /> <br />
                        &nbsp; &nbsp; <asp:Literal ID="PageIndex" runat="server"></asp:Literal></asp:Panel>                       
       

                    <asp:Panel ID="pnAddUser" runat="server" BackColor="White" Visible="False"
                        Width="100%">
                        <table bgcolor="#cedfef" border="0" cellpadding="0" cellspacing="1" class="padding" style="width: 100%">
                            <tr>
                                <td colspan="2" bgcolor="#e9f1fa" height="25">
                                    <span style="font-size: 12pt"><strong>
                                    添加管理员</strong></span></td>
                            </tr>
                            <tr>
                                <td style="width: 183px; text-align: right" bgcolor="#ffffff">
                                    用户：</td>
                                <td style="text-align: left" bgcolor="#ffffff">
                                    <asp:TextBox ID="txtUserName" runat="server" Width="150px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtUserName"
                                        Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                                    <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="txtUserName"
                                        Display="Dynamic" ErrorMessage="该用户已经被占用" OnServerValidate="CustomValidator1_ServerValidate"></asp:CustomValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtUserName"
                                        Display="Dynamic" ErrorMessage="以字母开头，长度在４-１８之间，只能包含字符、数字和下划线" ValidationExpression="^[a-zA-Z]\w{3,17}$"></asp:RegularExpressionValidator></td>
                            </tr>
                            <tr style="color: #000000">
                                <td style="width: 183px; height: 26px; text-align: right" bgcolor="#ffffff">
                                    密码：</td>
                                <td style="height: 26px; text-align: left" bgcolor="#ffffff">
                                    <asp:TextBox ID="txtUserPWD1" runat="server" TextMode="Password" Width="150px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtUserPWD1"
                                        Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator></td>
                            </tr>
                            <tr>
                                <td style="width: 183px; text-align: right" bgcolor="#ffffff">
                                    确认密码：</td>
                                <td style="text-align: left" bgcolor="#ffffff">
                                    <asp:TextBox ID="txtUserPWD2" runat="server" TextMode="Password" Width="150px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtUserPWD2"
                                        Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                                    <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtUserPWD1"
                                        ControlToValidate="txtUserPWD2" Display="Dynamic" ErrorMessage="两次密码不一致"></asp:CompareValidator></td>
                            </tr>
                            <tr>
                                <td colspan="2" bgcolor="#ffffff">
                                    <asp:Button ID="btnSaveUser" runat="server" OnClick="btnSaveUser_Click" Text="保存" />
                                    <asp:HiddenField ID="hdfWebid" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                    <asp:Panel ID="pnEditWeb" runat="server" BackColor="White" Visible="False"
                        Width="100%">
                        <table bgcolor="#cedfef" border="0" cellpadding="0" cellspacing="1" class="padding" width="100%">
                            <tr>
                                <td  colspan="2" style="height: 26px" bgcolor="#e9f1fa" height="25">
                                    <strong><span style="font-size: 12pt">
                                    修改统计站点</span></strong></td>
                            </tr>
                            <tr>
                                <td style="width: 165px; height: 25px; text-align: right" bgcolor="#FFFFFF">
                                    网站名称：</td>
                                <td style="width: 512px; height: 25px; text-align: left" bgcolor="#FFFFFF">
                                <asp:TextBox ID="txtWebName" runat="server" Width="150px"></asp:TextBox> </td>
                            </tr>
                            <tr style="color: #000000">
                                <td style="width: 165px; height: 26px; text-align: right" bgcolor="#FFFFFF">
                                    网站地址：</td>
                                <td style="width: 512px; height: 26px; text-align: left" bgcolor="#FFFFFF">
                                    <asp:TextBox ID="txtWebUrl" runat="server" Width="250px"></asp:TextBox> </td>
                            </tr>
                            <tr style="color: #000000">
                                <td bgcolor="#ffffff" style="height: 26px; text-align: left" colspan="2">
                                    <strong>报表公开：</strong>
                                </td>
                            </tr>
                            <tr style="color: #000000">
                                <td bgcolor="#ffffff" colspan="2" style="height: 26px; text-align: left:;">
                                    <br />
                                    <asp:Literal ID="ltrPowerList" runat="server"></asp:Literal>
                                </td>
                            </tr>
                            <tr>
                                <td bgcolor="#FFFFFF" colspan="2" style="height: 26px; ">
                                    <input ID="chkall" name="chkall" type="checkbox" value="" />公开所有报表&nbsp;&nbsp;&nbsp;<asp:Button 
                                        ID="btnEditSave" runat="server" OnClick="btnEditSave_Click" Text="修改站点" />
                                    <asp:HiddenField ID="hdfEditWebid" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
        </table> 
</asp:Content>
