<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Format.aspx.vb" Inherits="admin_Format"
    ValidateRequest="false" %>

<!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 id="Head1" runat="server">
    <link href="../StyleSheetPC.css" rel="stylesheet" type="text/css" />
    <title>
        <%= xTab%></title>
</head>
<body id="Backimage" runat="server">
    <form id="form1" runat="server">
    <%--page▼--%>
    <div id="vPage" runat="server">
        <%--header▼--%>
        <div id="header2" runat="server" style="background-image: url('../img/Header02.gif');">
            <h1 id="top" style="margin-top: 65px; padding-left: 30px; font-size: 14pt; color: White;">
                <%= xTitle%>
            </h1>
        </div>
        <%--header▲--%>
        <%--pagecontents▼--%>
        <%--left▼--%>
        <div id="left" runat="server">
            <asp:Panel ID="PanelMenuPC" runat="server" Width="220px">
                <asp:Menu ID="Menu1" runat="server" BackColor="#F5F4F1" DataSourceID="SiteMapDataSourceMenu"
                    DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="Large" ForeColor="#7C6F57"
                    StaticDisplayLevels="2" StaticSubMenuIndent="30px" Width="220px">
                    <DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" Width="220px" />
                    <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" Width="220px" />
                    <DynamicMenuStyle BackColor="#F7F6F3" Width="220px" />
                    <DynamicSelectedStyle BackColor="#5D7B9D" />
                    <StaticHoverStyle BackColor="#7C6F57" ForeColor="White" Width="220px" />
                    <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" Width="220px" />
                    <StaticSelectedStyle BackColor="#DA3C41" ForeColor="White" Width="220px" />
                </asp:Menu>
                <br />
                <asp:Menu ID="Menu2" runat="server" BackColor="#F7F6F3" DataSourceID="SiteMapDataSourceMenu2"
                    DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="Large" ForeColor="#7C6F57"
                    StaticDisplayLevels="2" StaticSubMenuIndent="30px" Width="220px">
                    <DynamicHoverStyle BackColor="#666666" ForeColor="White" Width="220px" />
                    <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" Width="220px" />
                    <DynamicMenuStyle BackColor="#E3EAEB" Width="220px" />
                    <DynamicSelectedStyle BackColor="#1C5E55" Width="220px" />
                    <StaticHoverStyle BackColor="#666666" ForeColor="White" Width="220px" />
                    <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" Width="220px" />
                    <StaticSelectedStyle BackColor="#DA3C41" ForeColor="White" Width="220px" />
                </asp:Menu>
                <br />
                <asp:Menu ID="Menu3" runat="server" BackColor="#F7F6F3" DataSourceID="SiteMapDataSourceMenu3"
                    DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="Large" ForeColor="#7C6F57"
                    StaticDisplayLevels="2" StaticSubMenuIndent="30px" Width="220px">
                    <DynamicHoverStyle BackColor="#666666" ForeColor="White" Width="220px" />
                    <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" Width="220px" />
                    <DynamicMenuStyle BackColor="#E3EAEB" Width="220px" />
                    <DynamicSelectedStyle BackColor="#1C5E55" Width="220px" />
                    <StaticHoverStyle BackColor="#666666" ForeColor="White" Width="220px" />
                    <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" Width="220px" />
                    <StaticSelectedStyle BackColor="#DA3C41" ForeColor="White" Width="220px" />
                </asp:Menu>
                <br />
                <asp:Label ID="Label3" runat="server" Text="IP:"></asp:Label>
                &nbsp;
                <asp:Label ID="LabelIP" runat="server" Text=""></asp:Label>
                <br />
                <asp:Panel ID="PanelReset" runat="server">
                    <asp:Label ID="Label9" runat="server" Text="DBのリセット"></asp:Label>
                    &nbsp;
                    <asp:Button ID="ButtonReset" runat="server" Text="開始" BackColor="Red" Font-Bold="True"
                        ForeColor="White" />
                </asp:Panel>
                <asp:Label ID="LabelOrder" runat="server" Text="Label" Visible="False"></asp:Label>
            </asp:Panel>
            <asp:Panel ID="PanelSearch" runat="server" Visible="false">
                <asp:Label ID="LabelSearch" runat="server" Text="検索"></asp:Label>
                <asp:TextBox ID="TextBoxSearch" runat="server" Width="100px"></asp:TextBox>
                <asp:Button ID="ButtonSearch" runat="server" Text="実行" />
            </asp:Panel>
        </div>
        <%--left▲--%>
        <%--main▼--%>
        <div id="main" runat="server">
            <asp:Label ID="Label1" runat="server" Text="認証について： 0 無認証、1 会員、3 幹事、7 管理者"></asp:Label><br />
            <asp:Panel ID="PanelMain" runat="server">
                <asp:ListView ID="ListViewFormatData" runat="server" DataKeyNames="id" DataSourceID="SqlDataSourceFormatData">
                    <AlternatingItemTemplate>
                        <tr style="background-color: #FFFFFF; color: #284775;">
                            <td>
                                <asp:Button ID="Button2" runat="server" Text="選択" CommandName="Sel" CommandArgument='<%# Eval("id") %>' />
                                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                            </td>
                            <td>
                                <asp:Label ID="itemLabel" runat="server" Text='<%# Eval("item") %>' />
                            </td>
                            <td>
                                <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>' />
                            </td>
                            <td>
                                <asp:Label ID="choiceLabel" runat="server" Text='<%# Eval("choice") %>' />
                            </td>
                        </tr>
                    </AlternatingItemTemplate>
                    <EditItemTemplate>
                        <tr style="background-color: #999999;">
                            <td>
                                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="更新" />
                                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="キャンセル" />
                            </td>
                            <td>
                                <asp:Label ID="idLabel1" runat="server" Text='<%# Eval("id") %>' />
                            </td>
                            <td>
                                <asp:TextBox ID="itemTextBox" runat="server" Text='<%# Bind("item") %>' />
                            </td>
                            <td>
                                <asp:TextBox ID="descriptionTextBox" runat="server" Text='<%# Bind("description") %>' />
                            </td>
                            <td>
                                <asp:TextBox ID="choiceTextBox" runat="server" Text='<%# Bind("choice") %>' />
                            </td>
                        </tr>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        <table runat="server" style="background-color: #FFFFFF; border-collapse: collapse;
                            border-color: #999999; border-style: none; border-width: 1px;">
                            <tr>
                                <td>
                                    データは返されませんでした。
                                </td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <tr style="">
                            <td>
                                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="挿入" />
                                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="クリア" />
                            </td>
                            <td>
                                <asp:TextBox ID="idTextBox" runat="server" Text='<%# Bind("id") %>' />
                            </td>
                            <td>
                                <asp:TextBox ID="itemTextBox" runat="server" Text='<%# Bind("item") %>' />
                            </td>
                            <td>
                                <asp:TextBox ID="descriptionTextBox" runat="server" Text='<%# Bind("description") %>' />
                            </td>
                            <td>
                                <asp:TextBox ID="choiceTextBox" runat="server" Text='<%# Bind("choice") %>' />
                            </td>
                        </tr>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <tr style="background-color: #E0FFFF; color: #333333;">
                            <td>
                                <asp:Button ID="Button1" runat="server" Text="選択" CommandName="Sel" CommandArgument='<%# Eval("id") %>' />
                                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                            </td>
                            <td>
                                <asp:Label ID="itemLabel" runat="server" Text='<%# Eval("item") %>' />
                            </td>
                            <td>
                                <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>' />
                            </td>
                            <td>
                                <asp:Label ID="choiceLabel" runat="server" Text='<%# Eval("choice") %>' />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <table runat="server">
                            <tr runat="server">
                                <td runat="server">
                                    <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF;
                                        border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;
                                        font-family: Verdana, Arial, Helvetica, sans-serif;">
                                        <tr runat="server" style="background-color: #E0FFFF; color: #333333;">
                                            <th runat="server">
                                                id
                                            </th>
                                            <th runat="server">
                                                item
                                            </th>
                                            <th runat="server">
                                                description
                                            </th>
                                            <th runat="server">
                                                choice
                                            </th>
                                        </tr>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr runat="server">
                                <td runat="server" style="text-align: center; background-color: #5D7B9D; font-family: Verdana, Arial, Helvetica, sans-serif;
                                    color: #FFFFFF">
                                </td>
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        <tr style="background-color: #E2DED6; font-weight: bold; color: #333333;">
                            <td>
                                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                            </td>
                            <td>
                                <asp:Label ID="itemLabel" runat="server" Text='<%# Eval("item") %>' />
                            </td>
                            <td>
                                <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>' />
                            </td>
                            <td>
                                <asp:Label ID="choiceLabel" runat="server" Text='<%# Eval("choice") %>' />
                            </td>
                        </tr>
                    </SelectedItemTemplate>
                </asp:ListView>
                <div style="background-color: #CCCC66;">
                    <br />
                    <asp:Label ID="Label7" runat="server" Text="　編集"></asp:Label><br />
                    <table style="width: 700px;">
                        <tr>
                            <td style="width: 90px;">
                                &nbsp;
                                <asp:Label ID="Label4" runat="server" Text="アイテム"></asp:Label>
                            </td>
                            <td style="width: 300px;">
                                <asp:Label ID="Label5" runat="server" Text="候補から記述（改行無しのHTML）"></asp:Label>
                                &nbsp;
                            </td>
                            <td style="width: 200px;">
                                <asp:Label ID="Label6" runat="server" Text="候補"></asp:Label>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="LabelItem" runat="server" Text=""></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="TextBoxDescription" runat="server" Width="280px"></asp:TextBox>
                                &nbsp;
                            </td>
                            <td>
                                <asp:TextBox ID="TextBoxChoice" runat="server" ReadOnly="True"></asp:TextBox>
                                &nbsp;
                            </td>
                            <td>
                                <asp:Button ID="Button5" runat="server" Text="UpDate" />
                                <asp:Label ID="LabelID" runat="server" Text="" Visible="False"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </div>
                <asp:SqlDataSource ID="SqlDataSourceFormatData" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    DeleteCommand="DELETE FROM [Format] WHERE [id] = @id" InsertCommand="INSERT INTO [Format] ([id], [item], [description], [choice]) VALUES (@id, @item, @description, @choice)"
                    SelectCommand="SELECT * FROM [Format] ORDER BY [id]" UpdateCommand="UPDATE [Format] SET [item] = @item, [description] = @description, [choice] = @choice WHERE [id] = @id">
                    <DeleteParameters>
                        <asp:SessionParameter Name="id" SessionField="id" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:SessionParameter Name="id" SessionField="id" Type="Int32" />
                        <asp:SessionParameter Name="item" SessionField="item" Type="String" />
                        <asp:SessionParameter Name="description" SessionField="description" Type="String" />
                        <asp:SessionParameter Name="choice" SessionField="choice" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:SessionParameter Name="item" SessionField="item" Type="String" />
                        <asp:SessionParameter Name="description" SessionField="description" Type="String" />
                        <asp:SessionParameter Name="choice" SessionField="choice" Type="String" />
                        <asp:SessionParameter Name="id" SessionField="id" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </asp:Panel>
        </div>
        <%--main▲--%>
        <%--footer▼--%>
        <div id="footer" runat="server">
            <hr />
            <h1>
                Footer &nbsp;Novel_46
            </h1>
            <br />
        </div>
        <%--footer▲--%>
        <%--pagecontents▲--%>
        <asp:SqlDataSource ID="SqlDataSourceFormat" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT * FROM [Format] ORDER BY [id]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSourceFormatID" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT * FROM [Format] WHERE ([id] = @id)">
            <SelectParameters>
                <asp:SessionParameter Name="id" SessionField="id" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <%--<asp:SqlDataSource ID="SqlDataSourceApproveName" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT * FROM [Approve] WHERE ([name] = @name)">
            <SelectParameters>
                <asp:SessionParameter Name="name" SessionField="name" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>--%>
        <asp:SqlDataSource ID="SqlDataSourceLocalApproveCheck" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT * FROM [Approve] WHERE (([cookie] = @cookie) AND ([status] = @status)) ORDER BY [id] DESC">
            <SelectParameters>
                <asp:SessionParameter Name="cookie" SessionField="cookie" Type="String" />
                <asp:SessionParameter Name="status" SessionField="status" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SiteMapDataSource ID="SiteMapDataSourceMenu" runat="server" SiteMapProvider="forViewer" />
        <asp:SiteMapDataSource ID="SiteMapDataSourceMenu2" runat="server" SiteMapProvider="forWriter" />
        <asp:SiteMapDataSource ID="SiteMapDataSourceMenu3" runat="server" SiteMapProvider="forViewer2" />
    </div>
    <%--page▲--%>
    <br />
    </form>
</body>
</html>
