<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="user_Default" %>

<!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" />
    <link href="../StyleSheet.css" rel="stylesheet" type="text/css" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.5, maxmum-scale=2.0" />
    <title>
        <%= xTab%></title>
        <style>
        .xBorder
        {
            border-style: none; 
            border-width: 1px;
        }
        </style>
</head>
<body id="Backimage" runat="server">
    <form id="form1" runat="server">
    <%--page▼--%>
    <div id="vPage" runat="server">
        <%--header▼--%>
        <div id="header2" runat="server">
            <h1 id="top" style="padding-left: 30px; font-size: 14pt;">
                <a href="Default.aspx" style="text-decoration: none; color: White;">
                    <%= xTitle%>
                </a>
            </h1>
        </div>
        <%--header▲--%>
        <%--pagecontents▼--%>
        <%--left▼--%>
        <div id="left" runat="server">
            <asp:Panel ID="PanelMenuPC" runat="server">
                <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:Label ID="LabelOrder" runat="server" Text="Label" Visible="False"></asp:Label>
            </asp:Panel>
            <asp:Panel ID="PanelMenuMobile" runat="server">
                <asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSourceMenu"
                    ExpandDepth="0" Font-Size="Large" ShowLines="True" LineImagesFolder="~/img">
                </asp:TreeView>
            </asp:Panel>
            <asp:Panel ID="PanelSearch" runat="server">
                <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" style="overflow: auto;">
            <asp:ListView ID="ListViewList" runat="server" DataKeyNames="id" DataSourceID="SqlDataSourceList">
                <AlternatingItemTemplate>
                    <tr style='<%# xBackColor(Eval("backcolor") & "") %>;'>
                        <td style="width: 35px; background-color: Transparent;">
                            <asp:Image ID="Image2" runat="server" ImageUrl="~/img/newimage.gif" Visible='<%# Eval("new") %>' />
                        </td>
                        <td>
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "~/user/OnePage.aspx?myid=" & Eval("myid") %>'
                                Enabled='<%# buttonVisible(Eval("button")) %>' Font-Underline="false" BackColor="Transparent"
                                ForeColor="#7C6F57">                                        
                                        <%# textLength(levelChar(Eval("level")) & HttpUtility.HtmlDecode(Eval("subject") & ""))%>
                            </asp:HyperLink>
                        </td>
                        <%--<td>
                            <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                        </td>
                        <td>
                            <asp:Label ID="dateLabel" runat="server" Text='<%# Eval("date") %>' />
                        </td>
                        <td>
                            <asp:Label ID="subjectLabel" runat="server" Text='<%# Eval("subject") %>' />
                        </td>
                        <td>
                            <asp:Label ID="bodyLabel" runat="server" Text='<%# Eval("body") %>' />
                        </td>
                        <td>
                            <asp:Label ID="levelLabel" runat="server" Text='<%# Eval("level") %>' />
                        </td>
                        <td>
                            <asp:Label ID="buttonLabel" runat="server" Text='<%# Eval("button") %>' />
                        </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="dateTextBox" runat="server" Text='<%# Bind("date") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="subjectTextBox" runat="server" Text='<%# Bind("subject") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="bodyTextBox" runat="server" Text='<%# Bind("body") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="levelTextBox" runat="server" Text='<%# Bind("level") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="buttonTextBox" runat="server" Text='<%# Bind("button") %>' />
                        </td>
                    </tr>
                </EditItemTemplate>
                <EmptyDataTemplate>
                    <table id="Table1" 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>
                            &nbsp;
                        </td>
                        <td>
                            <asp:TextBox ID="dateTextBox" runat="server" Text='<%# Bind("date") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="subjectTextBox" runat="server" Text='<%# Bind("subject") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="bodyTextBox" runat="server" Text='<%# Bind("body") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="levelTextBox" runat="server" Text='<%# Bind("level") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="buttonTextBox" runat="server" Text='<%# Bind("button") %>' />
                        </td>
                    </tr>
                </InsertItemTemplate>
                <ItemTemplate>
                    <tr style='<%# xBackColor(Eval("backcolor") & "") %>'>
                        <td style="width: 35px; background-color: Transparent;">
                            <asp:Image ID="Image1" runat="server" ImageUrl="~/img/newimage.gif" Visible='<%# Eval("new") %>' />
                        </td>
                        <td>
                            <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# "~/user/OnePage.aspx?myid=" & Eval("myid") %>'
                                Enabled='<%# buttonVisible(Eval("button")) %>' Font-Underline="false" BackColor="Transparent"
                                ForeColor="#7C6F57">                                        
                                        <%# textLength(levelChar(Eval("level")) & HttpUtility.HtmlDecode(Eval("subject") & ""))%>
                            </asp:HyperLink>
                        </td>
                        <%--<td>
                            <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                        </td>
                        <td>
                            <asp:Label ID="dateLabel" runat="server" Text='<%# Eval("date") %>' />
                        </td>
                        <td>
                            <asp:Label ID="subjectLabel" runat="server" Text='<%# Eval("subject") %>' />
                        </td>
                        <td>
                            <asp:Label ID="bodyLabel" runat="server" Text='<%# Eval("body") %>' />
                        </td>
                        <td>
                            <asp:Label ID="levelLabel" runat="server" Text='<%# Eval("level") %>' />
                        </td>
                        <td>
                            <asp:Label ID="buttonLabel" runat="server" Text='<%# Eval("button") %>' />
                        </td>--%>
                    </tr>
                </ItemTemplate>
                <LayoutTemplate>
                    <table id="Table2" runat="server">
                        <tr id="Tr1" runat="server">
                            <td id="Td1" runat="server">
                                <table class="xBorder" id="itemPlaceholderContainer" runat="server" style="background-color: Transparent;
                                    border-collapse: collapse; border-color: #999999; 
                                    font-family: Verdana, Arial, Helvetica, sans-serif;">
                                    <tr id="Tr2" runat="server" style="background-color: #5D7B9D; color: White; border-left: solid 3px #5D7B9D; border-right: solid 3px #5D7B9D;">
                                        <th id="Th1" runat="server">
                                        </th>
                                        <th id="Th2" runat="server" style="width: 730px;">
                                            <%= xListTitle%>
                                        </th>
                                        <%--<th runat="server">
                                            date</th>
                                        <th runat="server">
                                            subject</th>
                                        <th runat="server">
                                            body</th>
                                        <th runat="server">
                                            level</th>
                                        <th runat="server">
                                            button</th>--%>
                                    </tr>
                                    <tr id="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr id="Tr3" runat="server">
                            <td id="Td2" runat="server" style="text-align: center; background-color: #5D7B9D;
                                font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF">
                                <%--<asp:DataPager ID="DataPager1" runat="server" PageSize=<%# xPageSize %> >
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                            ShowLastPageButton="True" />
                                    </Fields>
                                </asp:DataPager>--%>
                            </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="dateLabel" runat="server" Text='<%# Eval("date") %>' />
                        </td>
                        <td>
                            <asp:Label ID="subjectLabel" runat="server" Text='<%# Eval("subject") %>' />
                        </td>
                        <td>
                            <asp:Label ID="bodyLabel" runat="server" Text='<%# Eval("body") %>' />
                        </td>
                        <td>
                            <asp:Label ID="levelLabel" runat="server" Text='<%# Eval("level") %>' />
                        </td>
                        <td>
                            <asp:Label ID="buttonLabel" runat="server" Text='<%# Eval("button") %>' />
                        </td>
                    </tr>
                </SelectedItemTemplate>
            </asp:ListView>
            <div style="text-align: center; background-color: #5D7B9D; font-family: Verdana, Arial, Helvetica, sans-serif;
                color: #FFFFFF">
                <asp:DataPager ID="DataPager2" runat="server" PagedControlID="ListViewList" PageSize="20">
                    <Fields>
                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
                    </Fields>
                </asp:DataPager>
            </div>
            <asp:SqlDataSource ID="SqlDataSourceList" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                SelectCommand="SELECT * FROM [Novel] ORDER BY [id] DESC"></asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSourceList2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                SelectCommand="SELECT * FROM [Novel] ORDER BY [id]"></asp:SqlDataSource>
            <br />
        </div>
        <%--main▲--%>
        <%--footer▼--%>
        <div id="footer" runat="server">
            <hr />
            <h1>
                Footer</h1>
            <br />
        </div>
        <%--footer▲--%>
        <%--pagecontents▲--%>
        <asp:SqlDataSource ID="SqlDataSourceSearch" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT * FROM [Novel] WHERE (([body] LIKE '%' + @body + '%') OR ([subject] LIKE '%' + @subject + '%')) ORDER BY [id] DESC">
            <SelectParameters>
                <asp:SessionParameter Name="body" SessionField="body" Type="String" />
                <asp:SessionParameter Name="subject" SessionField="subject" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSourceSearch2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT * FROM [Novel] WHERE (([body] LIKE '%' + @body + '%') OR ([subject] LIKE '%' + @subject + '%')) ORDER BY [id]">
            <SelectParameters>
                <asp:SessionParameter Name="body" SessionField="body" Type="String" />
                <asp:SessionParameter Name="subject" SessionField="subject" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSourceFormat" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT * FROM [Format] ORDER BY [id]"></asp:SqlDataSource>
        <asp:SiteMapDataSource ID="SiteMapDataSourceMenu" runat="server" />
    </div>
    <%--page▲--%>
    <br />
    </form>
</body>
</html>
