<%@ Page Language="c#" CodeBehind="DeleteProfile.aspx.cs" AutoEventWireup="True" Inherits="eDocument.Server.Administrator.Consumer.DeleteProfile" MasterPageFile="~/Site.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <style type="text/css">
        .Hide
        {
            display: none;
        }
    </style>

    <div class="skjema-admin__page-pre-title">
        Logg - GDPR
    </div>
    
    <h1 class="skjema-admin__page-title mt-0">GDPR</h1>

    <p class="skjema-admin__mb-50">
        Alle brukerdatata i innsendte og lagrede skjema vil slettes etter angitt tid.
    </p>
    
    <div class="d-flex align-items-center justify-content-between skjema-admin__mb-40">
        <asp:Button
            ID="btnUpdateFirst"
            CssClass="skjema-admin__button skjema-admin__button--primary"
            runat="server"
            Text="Lagre endringer"
            OnClick="btnUpdate_Click"></asp:Button>

        <div>
            <span class="budicon budicon-refresh-ui mr-2 skjema-admin__bold skjema-admin__color__primary"></span>
            <asp:LinkButton runat="server" ID="btnReset" OnClick="btnReset_OnClick">
                Gjenopprett standardinnstillinger
            </asp:LinkButton>
        </div>
    </div>

    <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>

    <h2 class="skjema-admin__underline-title">
        Innsendte skjema
    </h2>

    <strong class="skjema-admin__mb-20 d-block">
        Lagringstid
    </strong>

    <div class="skjema-admin__fixed-grid__row skjema-admin__mb-10">
        <div class="skjema-admin__fixed-grid__col-75 skjema-admin__mr-20">
            <label>
                Måneder
            </label>

            <asp:DropDownList ID="ddlSubmittedMonths" CssClass="skjema-admin__form__select" runat="server">
            </asp:DropDownList>
        </div>

        <div class="skjema-admin__fixed-grid__col-75 skjema-admin__mr-20">
            <label>
                Dager
            </label>

            <asp:DropDownList ID="ddlSubmittedDays" CssClass="skjema-admin__form__select" runat="server">
            </asp:DropDownList>
        </div>

        <div class="skjema-admin__fixed-grid__col-75 skjema-admin__mr-20">
            <label>
                Timer
            </label>

            <asp:DropDownList ID="ddlSubmittedHours" CssClass="skjema-admin__form__select" runat="server">
            </asp:DropDownList>
        </div>
    </div>

    <p class="skjema-admin__italic skjema-admin__mb-40">
        NB: Innsender kan ikke laste ned PDF fra "Mine saker" etter sletting.
    </p>
    
    <h2 class="skjema-admin__underline-title">
        Lagringstid per skjema
    </h2>
    
    <p class="skjema-admin__mb-10">
        Avvikende lagringstid for ett eller flere skjema kan legges til her.
    </p>
    
    <div class="skjema-admin__mb-20 d-flex justify-content-end">
        <asp:Button
            ID="btnSelectSubmittedTemplates"
            CssClass="skjema-admin__button skjema-admin__button--secondary"
            runat="server"
            Text="Velg skjema"
            OnClick="btnSelectSubmittedTemplates_Click"></asp:Button>
    </div>

    <asp:GridView
        ID="gvSubmitted"
        runat="server"
        AutoGenerateColumns="False"
        Width="100%"
        Border="0"
        CssClass="skjema-admin__table skjema-admin__table--3-td-padding-left-30 skjema-admin__table--last-td-padding-right-30 skjema-admin__table--all-td-min skjema-admin__table--4-td-auto"
        OnRowDataBound="gvSubmitted_OnRowDataBound">
        <HeaderStyle CssClass="skjema-admin__table__header"></HeaderStyle>
        <Columns>
            <asp:BoundField DataField="TemplateId" HeaderText="Skjema ID" ItemStyle-CssClass="Hide" HeaderStyle-CssClass="Hide"></asp:BoundField>
            <asp:BoundField DataField="SubscriptionId" HeaderText="SubscriptionId" ItemStyle-CssClass="Hide" HeaderStyle-CssClass="Hide"></asp:BoundField>
            <asp:BoundField DataField="FormId" HeaderText="ID" />
            <asp:BoundField DataField="Name" HeaderText="Tittel" />
            <asp:BoundField DataField="DeleteSubmittedInstancesTime" HeaderText="submitted" ItemStyle-CssClass="Hide" HeaderStyle-CssClass="Hide" />
            <asp:TemplateField HeaderText="Måneder">
                <ItemTemplate>
                    <asp:DropDownList ID="gvSubmitted_ddlDeleteMonths" CssClass="skjema-admin__form__select" style="width:75px;" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Dager">
                <ItemTemplate>
                    <asp:DropDownList ID="gvSubmitted_ddlDeleteDays" CssClass="skjema-admin__form__select" style="width:75px;" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Timer">
                <ItemTemplate>
                    <asp:DropDownList ID="gvSubmitted_ddlDeleteHours" CssClass="skjema-admin__form__select" style="width:75px;" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    
    <asp:Panel ID="pnlSelectDeleteSubmittedTemplates" Visible="False" runat="server" CssClass="skjema-admin__modal" data-jscomponent="modal">
        <div class="skjema-admin__modal__window">

            <button class="skjema-admin__modal__close" type="button" data-jscomponent="modalClose">
            </button>

            <asp:Label CssClass="skjema-admin__modal__title skjema-admin__mb-30" Text="Velg skjema" runat="server" />
            
            <p class="skjema-admin__mb-20">
                Velg skjema for å angi egen lagringstid.
            </p>

            <div>
                <asp:Label ID="lblInfo" runat="server" />
            </div>
            
            <div class="skjema-admin__modal__input-container skjema-admin__mb-40">
                <asp:GridView
                        ID="gvSelectDeleteSubmittedTemplates"
                        runat="server"
                        AutoGenerateColumns="False"
                        Width="100%"
                        Border="0"
                        CssClass="skjema-admin__table"
                        OnRowDataBound="gvSelectDeleteSubmittedTemplates_OnRowDataBound">
                    <HeaderStyle CssClass="skjema-admin__table__header"></HeaderStyle>
                    <Columns>
                        <asp:BoundField DataField="TemplateId" HeaderText="Skjema ID" ItemStyle-CssClass="Hide" HeaderStyle-CssClass="Hide"></asp:BoundField>
                        <asp:BoundField DataField="SubscriptionId" HeaderText="SubscriptionId" ItemStyle-CssClass="Hide" HeaderStyle-CssClass="Hide"></asp:BoundField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkDeleteSubmittedTemplates" CssClass="d-flex align-items-center" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="FormId" HeaderText="ID" />
                        <asp:BoundField DataField="Name" HeaderText="Name" />
                    </Columns>
                </asp:GridView>
            </div>

            <div class="d-flex justify-content-center">
                <asp:Button CssClass="skjema-admin__button skjema-admin__button--primary" 
                    style="width:216px;"
                    runat="server" 
                    id="btnSelectDeleteSubmittedTemplatesSave" 
                    OnClick="btnSelectDeleteSubmittedTemplatesSave_OnClick" 
                    Text="Lagre"/>
            </div>
        </div>
    </asp:Panel>
    

    <h2 class="skjema-admin__underline-title">
        Innsenders lagrede skjema (utkast)
    </h2>

    <strong class="skjema-admin__mb-20 d-block">
        Standard lagringstid
    </strong>

    <div class="skjema-admin__fixed-grid__row skjema-admin__mb-20">
        <div class="skjema-admin__fixed-grid__col-75 skjema-admin__mr-20">
            <label>
                Måneder
            </label>

            <asp:DropDownList ID="ddlSavedMonths" CssClass="skjema-admin__form__select" runat="server">
            </asp:DropDownList>
        </div>

        <div class="skjema-admin__fixed-grid__col-75 skjema-admin__mr-20">
            <label>
                Dager
            </label>

            <asp:DropDownList ID="ddlSavedDays" CssClass="skjema-admin__form__select" runat="server">
            </asp:DropDownList>
        </div>

        <div class="skjema-admin__fixed-grid__col-75">
            <label>
                Timer
            </label>

            <asp:DropDownList ID="ddlSavedHours" CssClass="skjema-admin__form__select" runat="server">
            </asp:DropDownList>
        </div>
    </div>
    
    <strong class="skjema-admin__mb-20 d-block">Lagringstid per skjema</strong>
        
    <p class="skjema-admin__mb-30">
        Avvikende lagringstid for ett eller flere skjema kan legges til her.
    </p>

    <div class="mb-5 d-flex justify-content-end">
        <asp:Button
            ID="btnSelectSavedTemplates"
            CssClass="skjema-admin__button skjema-admin__button--secondary"
            runat="server"
            Text="Velg skjema"
            OnClick="btnSelectSavedTemplates_Click"></asp:Button>
    </div>

    <asp:GridView
        ID="gvSaved"
        runat="server"
        AutoGenerateColumns="False"
        Width="100%"
        Border="0"
        CssClass="skjema-admin__table skjema-admin__table--3-td-padding-left-30 skjema-admin__table--last-td-padding-right-30 skjema-admin__table--all-td-min skjema-admin__table--4-td-auto skjema-admin__mb-60"
        OnRowDataBound="gvSaved_OnRowDataBound">
        <HeaderStyle CssClass="skjema-admin__table__header"></HeaderStyle>
        <Columns>
            <asp:BoundField DataField="TemplateId" HeaderText="Skjema ID" ItemStyle-CssClass="Hide" HeaderStyle-CssClass="Hide"></asp:BoundField>
            <asp:BoundField DataField="SubscriptionId" HeaderText="SubscriptionId" ItemStyle-CssClass="Hide" HeaderStyle-CssClass="Hide"></asp:BoundField>
            <asp:BoundField DataField="FormId" HeaderText="ID" />
            <asp:BoundField DataField="Name" HeaderText="Tittel" />
            <asp:BoundField DataField="DeleteSavedInstancesTime" HeaderText="Saved" ItemStyle-CssClass="Hide" HeaderStyle-CssClass="Hide" />
            <asp:TemplateField HeaderText="Måneder">
                <ItemTemplate>
                    <asp:DropDownList ID="gvSaved_ddlDeleteMonths" CssClass="skjema-admin__form__select" style="width:75px;" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Dager">
                <ItemTemplate>
                    <asp:DropDownList ID="gvSaved_ddlDeleteDays" CssClass="skjema-admin__form__select" style="width:75px;" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Timer">
                <ItemTemplate>
                    <asp:DropDownList ID="gvSaved_ddlDeleteHours" CssClass="skjema-admin__form__select" style="width:75px;" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    
	<asp:Panel ID="pnlSelectDeleteSavedTemplates" Visible="False" runat="server" CssClass="skjema-admin__modal" data-jscomponent="modal">
        <div class="skjema-admin__modal__window">

            <button class="skjema-admin__modal__close" type="button" data-jscomponent="modalClose">
            </button>

            <asp:Label CssClass="skjema-admin__modal__title skjema-admin__mb-30" Text="Velg skjema" runat="server" />
            
            <p class="skjema-admin__mb-20">
                Velg skjema for å angi egen lagringstid.
            </p>

            <div>
                <asp:Label ID="Label1" runat="server" />
            </div>
            
            <div class="skjema-admin__modal__input-container skjema-admin__mb-20">
                <asp:GridView
                        ID="gvSelectDeleteSavedTemplates"
                        runat="server"
                        AutoGenerateColumns="False"
                        Width="100%"
                        Border="0"
                        CssClass="skjema-admin__table"
                        OnRowDataBound="gvSelectDeleteSavedTemplates_OnRowDataBound">
                    <HeaderStyle CssClass="skjema-admin__table__header"></HeaderStyle>
                    <Columns>
                        <asp:BoundField DataField="TemplateId" HeaderText="Skjema ID" ItemStyle-CssClass="Hide" HeaderStyle-CssClass="Hide"></asp:BoundField>
                        <asp:BoundField DataField="SubscriptionId" HeaderText="SubscriptionId" ItemStyle-CssClass="Hide" HeaderStyle-CssClass="Hide"></asp:BoundField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkDeleteSavedTemplates" CssClass="d-flex align-items-center" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="FormId" HeaderText="ID" />
                        <asp:BoundField DataField="Name" HeaderText="Name" />
                    </Columns>
                </asp:GridView>
            </div>

            <div class="d-flex justify-content-center">
                <asp:Button CssClass="skjema-admin__button skjema-admin__button--primary" 
                    style="width:216px;"
                    runat="server" 
                    id="btnSelectDeleteSavedTemplatesSave" 
                    OnClick="btnSelectDeleteSavedTemplatesSave_OnClick" 
                    Text="Lagre"/>
            </div>
        </div>
    </asp:Panel>

    <hr class="skjema-admin__hr skjema-admin__mb-20" />

    <%--    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Slett innsendte for anonyme brukere etter min.
        </label>

        <asp:TextBox
            ID="txtAnonymous_DeleteSubmitted"
            CssClass="skjema-admin__page__text"
            runat="server">
        </asp:TextBox>
    </div>--%>

    <div class="mb-5">
        <asp:Button
            ID="btnUpdate"
            CssClass="skjema-admin__button skjema-admin__button--primary"
            runat="server"
            Text="Lagre endringer"
            OnClick="btnUpdate_Click"></asp:Button>
    </div>

    <asp:Panel ID="pnlConfirmSave" Visible="False" runat="server" CssClass="skjema-admin__modal" data-jscomponent="modal">
        <div class="skjema-admin__modal__window">

            <button class="skjema-admin__modal__close" type="button" data-jscomponent="modalClose"></button>

            <asp:Label CssClass="skjema-admin__page__label" Text="Endringer er lagret" runat="server" />

            <div>
                <asp:Button CssClass="skjema-admin__button skjema-admin__button--primary" runat="server" ID="btnOk" OnClick="btnOk_OnClick" Text="OK" />
            </div>
        </div>
    </asp:Panel>
</asp:Content>
