<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Event.aspx.vb" Inherits="CalendarAdmin._Event" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!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">
    <title>Calendar Administration (Events...)</title>
    <link href="style/Login.css"rel="stylesheet" type="text/css">
    <style type="text/css">
   .ModalBackground {
    	background-color: Gray;
    	filter: alpha(opacity=70);
        opacity: 0.7;
        -moz-opacity: 0.7;
    }
</style> 
<script language=javascript type="text/javascript" >

function ShowMyModalPopup(eventId,eventTitle) 
{ 
 var modal = $find('mpeCategory');
 var label=document.getElementById('lblModal'); 
 document.getElementById('hdnEventId').value=eventId;
 document.getElementById('hdnEventTitle').value=eventTitle;
 label.innerHTML="<center>"+"Are you sure you want to" + "<br>" + "delete the Event: " + "<br><b>\"" + eventTitle  +"\" ?"+"</b></center>";  
 modal.show(); 
}

function SaveEditEventId(eventId) 
{ 
  document.getElementById('hdnEditEventId').value=eventId;
}

function HideModalPopup() 
{ 
  var modal = $find('mpeCategory'); 
  modal.hide(); 
}

function fnClickDelete(sender, e) 
{ 
  __doPostBack(sender,e); 
}

</script>
</head>
<body>
    <form id="Event" runat="server">
    <asp:ScriptManager ID="SM_Category" runat="server">
            </asp:ScriptManager>
     <div id="Border" class="container">
        <div id="Header" class="header" >
            <asp:Image ID="imgLogo" runat="server" ImageUrl="~/images/edventure_logo.gif" style="margin-left:7px;margin-top:7px"/></div>
        <div id="ProjectTitle" class="projectitle">
         <h2> Calendar Administration </h2>
         </div>
       
            <div id="NavButton" class="NavButton">
            <asp:LinkButton ID="lnkLogout" runat="server" Font-Bold="True" Font-Names="Arial" style="float:right;"  Font-Size="10pt">Logout</asp:LinkButton>
            <asp:Button ID="btnEvent" runat="server" Text="Events" BorderStyle="None" ForeColor="#666666" BackColor="#E7E7E9" Height="30px" Width="140px" Font-Names="Arial" Font-Bold="True" />
            <asp:Button ID="btnCategories" runat="server" Text="Categories" BorderStyle="None" ForeColor="White" BackColor="#666666" Height="30px" Width="140px" Font-Names="Arial" Font-Bold="True" />
            <asp:Button ID="btnClosedDates" runat="server" Text="Closed Dates" BorderStyle="None" ForeColor="White" BackColor="#666666" Height="30px" Width="140px" Font-Names="Arial" Font-Bold="True" />
            <asp:Button ID="btnUsers" runat="server" Text="Users" BorderStyle="None" ForeColor="White" BackColor="#666666" Height="30px" Width="140px" Font-Names="Arial" Font-Bold="True" />
            </div>
            <div id="FormTitle" class="formtitle">
            <h1>
                Events List</h1>
            </div> 
         <div id="AddNew" class="AddNew" >
           
                       <br />
                            <asp:Button ID="btnAddNewEvent" runat="server" Text="Add New Event >" BorderStyle="None" ForeColor="White" BackColor="#333333" Height="30px" Width="140px" Font-Names="Arial" Font-Bold="True" />
                            </div>
            &nbsp;
            <asp:Label ID="lblMessage" runat="server" Font-Bold="True" ForeColor="#FF0033" Font-Names="Arial" Font-Size="10pt"></asp:Label><br />
            
                            <div id="CategoryGrid" class="CategoryGrid">
                                    <asp:GridView ID="grdEvents" runat="server" AutoGenerateColumns="False" Font-Names="Arial"
                                        Font-Size="10pt" ForeColor="#666666" Width="100%" Height="55px" DataKeyNames="event_id,event_title" BackColor="#F3F3F4" BorderWidth="0px" GridLines="None" AllowSorting="True">
                                        <Columns>
                                            <asp:TemplateField HeaderText="Event Title">
                                                <HeaderStyle Font-Bold="True" Font-Names="Arial" HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblEventTitle" runat="server" Text='<%# Bind("event_title") %>'></asp:Label>
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Left" Width="15%" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Active">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkActive" runat="server" Width="16px" Checked='<%# Bind("status") %>' Enabled="False" />
                                                </ItemTemplate>
                                                <HeaderStyle Font-Bold="True" Font-Names="Arial" Width="50px" HorizontalAlign="Left" />
                                                <ItemStyle HorizontalAlign="Left" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Category">
                                                <HeaderStyle Font-Bold="True" Font-Names="Arial" HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblCategory" runat="server" Text='<%# Bind("category_text") %>'></asp:Label>
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Left" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Date                                ">
                                                <HeaderStyle Font-Bold="True" Font-Names="Arial" Width="150px" HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblDate" runat="server" Text='<%# Bind("st_end_date") %>'></asp:Label>
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Left" Width="25%" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Everyday @&lt;br /&gt; EdVenture">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkEveryday" runat="server" 
                                                        Width="16px" Checked='<%# Bind("is_everyday") %>' Enabled="False" />
                                                </ItemTemplate>
                                                <HeaderStyle Font-Bold="True" Font-Names="Arial" Width="90px" HorizontalAlign="Left" />
                                                <ItemStyle HorizontalAlign="Left" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Coming&lt;br /&gt; Soon">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkCommingSoon" runat="server" 
                                                        Width="16px" Checked='<%# BInd("iscoming_soon") %>' Enabled="False" />
                                                </ItemTemplate>
                                                <HeaderStyle Font-Bold="True" Font-Names="Arial" Width="50px" HorizontalAlign="Left" />
                                                <ItemStyle HorizontalAlign="Left" />
                                            </asp:TemplateField>
                                            <asp:TemplateField ShowHeader="False">
                                                <ControlStyle BackColor="#333333" BorderStyle="None" ForeColor="White" Width="60px" />
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="editImgBtn" runat="server" CommandName="Edit" ImageUrl="~/images/btnEdit.gif" OnClick="editImgBtn_Click" />
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Left" />
                                            </asp:TemplateField>
                                            <asp:TemplateField ShowHeader="False">
                                                <ControlStyle BackColor="#333333" BorderStyle="None" ForeColor="White" Width="60px" />
                                                <ItemTemplate>
                                                    <asp:HyperLink ID="delHyperLnk" runat="server" ImageUrl="~/images/btnDelete.gif">Delete Event</asp:HyperLink>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Left" />
                                            </asp:TemplateField>
                                        </Columns>
                                        <HeaderStyle BackColor="#B2B2B2" Font-Bold="True" Font-Names="Arial" />
                                        <AlternatingRowStyle BackColor="#E7E7E9" />
                                    </asp:GridView>
                                    </div>
      
        <br />
        &nbsp;&nbsp;<br />
        <br />
        <br />
        <br />
        <br />

    
    </div>
        <asp:Panel ID="Panel1" runat="server" BackColor="WhiteSmoke" Height="193px" Width="317px" style="text-align:center;">
            &nbsp; &nbsp; &nbsp; 
            <asp:HiddenField ID="hdnEventId" runat="server" />
            <asp:HiddenField ID="hdnEventTitle" runat="server" />
            <br />
            <asp:Label ID="lblModal" runat="server" Font-Bold="False" Font-Size="X-Large" Height="66px" Width="270px"></asp:Label>
            <br />
            <br />
            <asp:ImageButton ID="btnModalDelete" runat="server" ImageUrl="~/images/btnDelete.gif"  style="padding-bottom:10px"/>
            &nbsp;
            <asp:ImageButton ID="btnModalCancel" runat="server" ImageUrl="~/images/btnCancel.gif"  style="padding-bottom:10px"/>
            <br /><br />
       </asp:Panel>
        <asp:HiddenField ID="hdnEditEventId" runat="server" />
        <cc1:ModalPopupExtender ID="mpeCategory" runat="server" BackgroundCssClass="ModalBackground"
            CancelControlID="btnModalCancel" DropShadow="True" OnCancelScript="HideModalPopup()"
            PopupControlID="Panel1" TargetControlID="Panel1">
        </cc1:ModalPopupExtender>
    </form>
</body>
</html>
