<%@ page language="C#" autoeventwireup="true" inherits="Forms_NotificationsToParents, App_Web_isgq1fab" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/New_Header.ascx" TagName="Header" TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/New_Footer.ascx" TagName="Footer" TagPrefix="uc2" %>
<%@ Register Assembly="DevExpress.Web.v14.2" Namespace="DevExpress.Web" TagPrefix="dxw" %>

<%--********* For Bootstrap Implementation *************--%>
<!DOCTYPE html>
<html lang="en">
<%--********* End of Bootstrap Implementation *************--%>
<head runat="server">
    <%--********* For Bootstrap Implementation *************--%>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <%--********* End of Bootstrap Implementation *************--%>
    <title>tSense-IoT Send Notifications to Parents</title>
    <link href="../css/CustomeAlert/demos.css" rel="stylesheet" type="text/css" />
    <link href="../css/CustomeAlert/themes/jquery.ui.all.css" rel="stylesheet" type="text/css" />
    <link id="reset" runat="server" href="../css/reset.css" rel="stylesheet" type="text/css" />
    <link id="stylesheet2" runat="server" href="../css/stylesheet2.css" rel="stylesheet" type="text/css" />
    <link id="dropdown" runat="server" href="../css/dropdown.css" rel="stylesheet" type="text/css" />
    <link rel="SHORTCUT ICON" href="../images/favicon.ico" />
    <link id="datepicker" runat="server" type="text/css" href="../css/ui.datepicker.css" rel="stylesheet" />
    <link id="uicore" runat="server" type="text/css" href="../css/ui.core.css" rel="stylesheet" />
    <link id="uitheme" runat="server" type="text/css" href="../css/ui.theme.css" rel="stylesheet" />
    <link id="ieonly" runat="server" href="" rel="stylesheet" type="text/css" />
    <%--Custom Theme for DevEx 14.2--%>
    <link id="GridView" runat="server" type="text/css" href="~/App_Themes/Office2003Blue/GridView/grid.css" rel="stylesheet" />
    <link id="Editors" runat="server" type="text/css" href="~/App_Themes/Office2003Blue/Editors/styles.css" rel="stylesheet" />

    <script type="text/javascript" src="../js/CustomAlert/jquery.min.js"></script>
    <script type="text/javascript" src="../js/CustomAlert/jquery-ui-1.10.3.custom.min.js"></script>
    <script type="text/javascript" src="../js/CustomAlert/jquery-ui-1.10.3.custom.js"></script>
    <script type="text/javascript" src="../js/CustomAlert/CustomAlert.js"></script>
    <script type="text/javascript" src="../js/myformvalidations.js"></script>
    <script type="text/javascript" src="../js/ScriptToClearCtrls.js"></script>
    <script type="text/javascript" src="../js/jquery-1.5.1.min.js"></script>
    <script type="text/javascript" src="../js/ui.datepicker.js"></script>
    <script type="text/javascript" src="../js/JQQueryDatePicker.js"></script>
    <script type="text/javascript" src="../js/DateValidations.js"></script>

    <%--********* For Bootstrap Implementation *************--%>
    <link id="BootStrapCss" href="../css/bootstrap.css" runat="server" rel="stylesheet" type="text/css" />
    <link id="mainstyle" runat="server" href="../css/mainstyle.css" rel="stylesheet" type="text/css" />
    <%--********* End of Bootstrap Implementation *************--%>
    <script src="../js/wow.min.js"></script>
</head>
<body>
    <%--********* For Bootstrap Implementation *************--%>
    <div class="pageContainer">
        <%--********* End of Bootstrap Implementation *************--%>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="smNews" runat="server">
            </asp:ScriptManager>
            <!-- Header Starts Here -->
            <uc1:Header ID="ucHeader" runat="server" />
            <!-- Nav Ends Here -->
            <!-- Content Starts Here -->
            <div id="outer">
                <div id="inner">
                    <div id="float-wrap">
                        <!-- Main Content Starts Here -->
                        <div id="content">
                            <div class="content-wrap">
                                <div id="top-content" class="container-fluid head-part">
                                    <div id="heading" class="col-sm-4 col-md-4">
                                        <img class="icon" src="../images/configuration-icon.jpg" alt="" />
                                        <h1>
                                            <asp:Literal ID="lblNotificationCaption" Text="Notification to Parents" runat="server"></asp:Literal>
                                        </h1>
                                        <asp:LinkButton ID="lnkHomeCaption" runat="server"></asp:LinkButton>
                                        <span>&gt;</span>
                                        <span><a href="NotificationsToParents.aspx">
                                            <asp:Label ID="lblParentNotifications" Text="Notification to Parents" runat="server" /></a></span>
                                    </div>
                                    <div id="" class="col-sm-7 col-md-7 pull-right">
                                        <div class="pull-right btn-wrap">

                                            <asp:LinkButton ID="lnkAddNotification" runat="server" CssClass="MultilingualBtn" OnClick="lbtAddNotification_Click">
                                                <span id="Span1" runat="server" class="MultilingualBtnspan">
                                                    <div class="AddGeozone">
                                                        <div id="AddNewsDiv" runat="server" class="MultilingualBtnTextAlign">
                                                            Add Notification
                                                        </div>
                                                    </div>
                                                </span>
                                            </asp:LinkButton>

                                            <asp:LinkButton ID="btnBack" runat="server" CssClass="MultilingualBtn" PostBackUrl="~/Forms/ConfigurationSetup.aspx">
                                                <span id="Span2" runat="server" class="MultilingualBtnspan">
                                                    <div class="Back">
                                                        <div id="BacktoConfigurationDiv" runat="server" class="MultilingualBtnTextAlign">
                                                            Back to Configuration
                                                        </div>
                                                    </div>
                                                </span>
                                            </asp:LinkButton>
                                        </div>
                                    </div>
                                    <div class="clear clearfix">
                                    </div>
                                </div>
                                <div class="clearfix">
                                </div>
                                <asp:Panel ID="pnlAddNotification" runat="server" CssClass="ControlShow">
                                    <div class="form-box">
                                        <h1>
                                            <span class="icon" style="padding-top: 0px">
                                                <img src="../images/icn-vehicle-message-severity-settings.gif" alt="" />
                                            </span>
                                            <asp:Label ID="lblNotificationEntry" runat="server" Text="Add Notification"></asp:Label>
                                        </h1>
                                        <div class="col-sm-12 form-box">

                                            <div class="col-sm-8 form-controls">
                                                <div class="col-sm-12 form-group">
                                                    <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                        <asp:Label ID="lblNotificationType" runat="server" CssClass="label" Text="Notification Type"></asp:Label>
                                                        <span style="color: Red">*</span>
                                                    </div>
                                                    <div class="col-sm-4">
                                                        <dxw:ASPxComboBox ID="ddlNotificationType" runat="server" ValueType="System.String" Width="107px" Height="20px" AutoPostBack="false"
                                                            EnableTheming="true" Theme="Office2003Blue" ShowImageInEditBox="false" EnableIncrementalFiltering="true"
                                                            CssFilePath="~/App_Themes/office2003Blue/Editors/styles.css" CssPostfix="office2003_Blue">
                                                            <Items>
                                                                <dxw:ListEditItem Selected="true" Text="Individual" Value="0" />
                                                                <dxw:ListEditItem Text="General" Value="1" />
                                                            </Items>
                                                            <ClientSideEvents SelectedIndexChanged="function(s,e){
                                                                                                    if(ddlNotificationType.GetSelectedIndex() == 0){
                                                                                                            document.getElementById('grid-dsply').style.display = 'block';}
                                                                                                    else{
                                                                                                            document.getElementById('grid-dsply').style.display = 'none';}                                                                                                            
                                                                                                }" />
                                                        </dxw:ASPxComboBox>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-8 form-controls">
                                                <div class="col-sm-12 form-group">
                                                    <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                        <asp:Label ID="lblNotification" runat="server" CssClass="label" Text="Notification Name"></asp:Label>
                                                        <span style="color: Red">*</span>
                                                    </div>
                                                    <div class="col-sm-4">
                                                        <asp:TextBox ID="txtNotification" runat="server" MaxLength="50" class="form-control" TabIndex="1"></asp:TextBox><%--onchange="ValidateNewsName();"onkeypress="return chkAlphaNumericWithSpace(event,this,49)"--%>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-8 form-controls">
                                                <div class="col-sm-12 form-group">
                                                    <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                        <asp:Label ID="lblNotificationDesc" runat="server" CssClass="label" Text="Description"></asp:Label>
                                                        <asp:Label ID="lblMaxChar" runat="server" Text="(Max 1000 Char.)"></asp:Label>
                                                    </div>
                                                    <div class="col-sm-7 col-xs-10 col-lg-6">
                                                        <asp:TextBox ID="txtNotificationDesc" runat="server" class="form-control" Style="max-width: 500px; width: 100%" Height="160px" TextMode="MultiLine"
                                                            MaxLength="1000" TabIndex="2" onblur="return disallowScriptTags(this);" onkeypress="return chkDescription(event,this,999);"></asp:TextBox>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-sm-8 form-controls">
                                                <div class="col-sm-12 form-group">
                                                    <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                        <asp:Label ID="lblExpiryDate" runat="server" CssClass="label" Text="Expiry Date"></asp:Label>
                                                        <span style="color: Red">*</span>
                                                    </div>
                                                    <div class="col-sm-4">
                                                        <asp:HiddenField runat="server" ID="hdnDateFormat" Value="dd-MMM-yyyy" />
                                                        <asp:TextBox ID="txtExpiryDate" runat="server" oncopy="return false" oncut="return false" Width="100px"
                                                            onkeypress="return false" onpaste="return false" ToolTip="dd-MMM-yyyy" class="form-control" TabIndex="3"></asp:TextBox><%-- onkeydown="doCheckBackSpaceOrDelete()"--%>
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                        <div id="grid-dsply">
                                            <div class="clear clearfix">
                                            </div>
                                            <asp:HiddenField runat="server" ID="hdnSelectedStudents" />
                                            <div style="width: 100%; overflow: auto;">
                                                <div class="table-responsive">
                                                    <dxw:ASPxGridView ID="gvStudent" ClientInstanceName="gvStudent" runat="server"
                                                        Width="1250px" KeyFieldName="StudentMasterID" Settings-ShowFilterRow="true"
                                                        CssFilePath="~/App_Themes/Office2003Blue/GridView/grid.css" CssPostfix="Office2003_Blue"
                                                        EnableTheming="true" Theme="Office2003Blue" OnHtmlRowCreated="gvStudent_HtmlRowCreated">
                                                        <%--<ClientSideEvents EndCallback="function(s, e) { GridRowCount();}" /> OnCustomJSProperties="grid_CustomJSProperties--%>
                                                        <Settings VerticalScrollBarMode="Visible" VerticalScrollBarStyle="Virtual" ShowVerticalScrollBar="true" VerticalScrollableHeight="250" HorizontalScrollBarMode="Hidden" />
                                                        <SettingsBehavior ProcessSelectionChangedOnServer="false" />
                                                        <Styles CssFilePath="~/App_Themes/Office2003Blue/GridView/grid.css" AlternatingRow-Enabled="True"
                                                            CssPostfix="Office2003_Blue">
                                                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                            </Header>
                                                            <LoadingPanel ImageSpacing="10px">
                                                            </LoadingPanel>
                                                            <PagerBottomPanel CssClass="PageFooter">
                                                            </PagerBottomPanel>
                                                            <PagerTopPanel CssClass="PageFooter">
                                                            </PagerTopPanel>
                                                        </Styles>
                                                        <SettingsPager PrevPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pPrev.gif"
                                                            PrevPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pPrevDisabled.gif"
                                                            NextPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pNextDisabled.gif"
                                                            NextPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pNext.gif" AlwaysShowPager="true">
                                                        </SettingsPager>
                                                        <Columns>
                                                            <dxw:GridViewCommandColumn Name="Checkbox" Width="30" VisibleIndex="0" ShowSelectCheckbox="true" FixedStyle="None">
                                                                <HeaderTemplate>
                                                                    <input id="chkSelectAll" type="checkbox" runat="server" onclick="gvStudent.SelectAllRowsOnPage(this.checked);"
                                                                        style="vertical-align: middle;" title="Select/Unselect all rows on the page" />
                                                                </HeaderTemplate>
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                            </dxw:GridViewCommandColumn>
                                                            <dxw:GridViewDataColumn FieldName="StudentMasterID" Caption="Student ID" Width="100"
                                                                ReadOnly="true" Visible="false">
                                                                <HeaderCaptionTemplate>
                                                                    <span>
                                                                        <img src="../images/icn-driver-name.gif" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lbl" runat="server" Text="Student Name"></asp:Label></span>
                                                                </HeaderCaptionTemplate>
                                                                <DataItemTemplate>
                                                                    <%--<asp:Label ID="lblDriName" runat="server" Text='<%# Eval("DisplayName") %>' ForeColor='<%#Convert.ToString((Eval("LicenseExpiresOnSort"))) == "" ? System.Drawing.Color.Black : DateTime.ParseExact(Convert.ToString((Eval("LicenseExpiresOnSort"))), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture) < DateTime.Now.Date ? System.Drawing.Color.Red : System.Drawing.Color.Black%>'></asp:Label>--%>
                                                                    <asp:Label ID="lblStudentMasterID" runat="server" Text='<%# Eval("StudentMasterID") %>'></asp:Label>
                                                                </DataItemTemplate>
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn Caption="Student Name" FieldName="StudentName" Width="180"
                                                                VisibleIndex="0" FixedStyle="None">
                                                                <HeaderCaptionTemplate>
                                                                    <span>
                                                                        <img src="../images/icn-user-name.gif" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lblCaptionStudentName" runat="server" Text="Student Name"></asp:Label></span>
                                                                </HeaderCaptionTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblStudentName" runat="server" Text='<%# Eval("StudentName") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                                </DataItemTemplate>
                                                                <Settings AllowSort="True" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn Caption="StudentID" FieldName="StudentID" Width="150" VisibleIndex="1" FixedStyle="None">
                                                                <HeaderCaptionTemplate>
                                                                    <span>
                                                                        <img src="../images/icn-user-name.gif" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lblStudentID" runat="server" Text="Student ID"></asp:Label></span>
                                                                </HeaderCaptionTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lbl" runat="server" Text='<%# Eval("StudentID") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                                </DataItemTemplate>
                                                                <Settings AllowSort="True" />
                                                            </dxw:GridViewDataColumn>
                                                            <%--<dxw:GridViewDataColumn Caption="RFID" FieldName="RFID" Width="200" VisibleIndex="10" FixedStyle="None">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/key-details.png" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lblStudentID" runat="server" Text="RFID"></asp:Label></span>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lbl" runat="server" Text='<%# Eval("RFID") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowSort="True" />
                                                    </dxw:GridViewDataColumn>--%>
                                                            <dxw:GridViewDataColumn Caption="Vehicle Name" FieldName="VehicleDescription" Width="150" VisibleIndex="5">
                                                                <HeaderCaptionTemplate>
                                                                    <span>
                                                                        <img src="../images/icn-vehicle-name.gif" alt="" align="middle" />&nbsp;
                                                                        <asp:Label ID="lblVehicleName" runat="server" Font-Bold="false" Text="Vehicle Name"></asp:Label>
                                                                    </span>
                                                                </HeaderCaptionTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblStationName" runat="server" Text='<%# Eval("VehicleDescription") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                                </DataItemTemplate>
                                                                <Settings AllowSort="True" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn Caption="School Name" FieldName="SchoolName" Width="200"
                                                                VisibleIndex="2">
                                                                <HeaderCaptionTemplate>
                                                                    <span>
                                                                        <img src="../images/school.png" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lblSchoolCode" runat="server" Font-Bold="false" Text="School Name"></asp:Label>
                                                                    </span>
                                                                </HeaderCaptionTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblSchool" runat="server" Text='<%# Eval("SchoolName") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                                </DataItemTemplate>
                                                                <Settings AllowSort="True" />
                                                            </dxw:GridViewDataColumn>
                                                            <%--<dxw:GridViewDataColumn Caption="Nearest Landmark" FieldName="LandmarkName" Width="150"
                                                        ReadOnly="true" VisibleIndex="11">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/landmark-icon.gif" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lblLandmark" runat="server" Text="Nearest LandMark"></asp:Label></span>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblLandmark" runat="server" Text='<%# Eval("Landmarkname") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowSort="True" />
                                                    </dxw:GridViewDataColumn>--%>
                                                            <dxw:GridViewDataColumn Caption="Mobile No" FieldName="ContactNo" Width="150" VisibleIndex="6">
                                                                <HeaderCaptionTemplate>
                                                                    <span>
                                                                        <img src="../images/icn-contact-number.gif" alt="" align="middle" />&nbsp;
                                                                        <asp:Label ID="lblMobileNo" runat="server" Font-Bold="false" Text="Contact No"></asp:Label>
                                                                    </span>
                                                                </HeaderCaptionTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblContact" runat="server" Text='<%# Eval("ContactNo") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                                </DataItemTemplate>
                                                                <Settings AllowSort="True" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn Caption="Alternate Contact No" FieldName="AlternateContactNo" Width="150" VisibleIndex="7">
                                                                <HeaderCaptionTemplate>
                                                                    <span>
                                                                        <img src="../images/icn-contact-number.gif" alt="" align="middle" />&nbsp;
                                                                        <asp:Label ID="lblAlternateMobileNo" runat="server" Font-Bold="false" Text="Alternate Contact No"></asp:Label>
                                                                    </span>
                                                                </HeaderCaptionTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblAlternateContact" runat="server" Text='<%# Eval("AlternateContactNo") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                                </DataItemTemplate>
                                                                <Settings AllowSort="True" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn Caption="Gender" FieldName="GenderN" Width="100" ReadOnly="true"
                                                                VisibleIndex="4">
                                                                <HeaderCaptionTemplate>
                                                                    <span>
                                                                        <img src="../images/icn-user-name.gif" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lblGender" runat="server" Text="Gender"></asp:Label></span>
                                                                </HeaderCaptionTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblGender" runat="server" Text='<%# Eval("GenderN") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                                </DataItemTemplate>
                                                                <Settings AllowSort="True" />
                                                            </dxw:GridViewDataColumn>
                                                            <%--<dxw:GridViewDataColumn Caption="Email" FieldName="EmailAddress" Width="150" ReadOnly="true"
                                                        VisibleIndex="8">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/icn-email.gif" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lblEmail" runat="server" Text="Email"></asp:Label></span>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblEmail" runat="server" Text='<%# Eval("EmailAddress") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowSort="True" />
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataColumn Caption="Address" FieldName="AddressLine1" Width="150"
                                                        ReadOnly="true" VisibleIndex="9">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/address-icon.gif" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lblAddress" runat="server" Text="Address"></asp:Label></span>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblAddress" runat="server" Text='<%# Eval("AddressLine1") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowSort="True" />
                                                    </dxw:GridViewDataColumn>--%>
                                                            <dxw:GridViewDataColumn Caption="Grade" FieldName="Grade" Width="100" ReadOnly="true"
                                                                VisibleIndex="3">
                                                                <HeaderCaptionTemplate>
                                                                    <span>
                                                                        <img src="../images/incentive-name.png" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lblGrade" runat="server" Text="Grade / Class"></asp:Label></span>
                                                                </HeaderCaptionTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblGrade" runat="server" Text='<%# Eval("Grade") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                                </DataItemTemplate>
                                                                <Settings AllowSort="True" />
                                                            </dxw:GridViewDataColumn>
                                                            <%--<dxw:GridViewDataTextColumn Caption="SMS Settings" FieldName="SMSSettings" Width="100"
                                                        ReadOnly="true" VisibleIndex="20">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/mobile.png" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lblSMSSettings" runat="server" Text="SMS Settings"></asp:Label></span>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblSMSSettings" runat="server" Text='<%# Eval("SMSSettings") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowAutoFilter="False" AllowSort="True" ShowFilterRowMenu="False" />
                                                    </dxw:GridViewDataTextColumn>--%>
                                                            <dxw:GridViewDataColumn Caption="Geozone" FieldName="GeozoneName" Width="200" VisibleIndex="10">
                                                                <HeaderCaptionTemplate>
                                                                    <span>
                                                                        <img src="../images/icn-geo-zone-name.gif" alt="" align="top" />&nbsp;
                                                                        <asp:Label ID="lblGeozone" runat="server" Text="Geozone"></asp:Label></span>
                                                                </HeaderCaptionTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblStationID" runat="server" Text='<%# Eval("GeozoneName") %>'></asp:Label>
                                                                </DataItemTemplate>
                                                                <Settings AllowSort="True" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataTextColumn FieldName="ActiveN" Caption="Status" HeaderStyle-HorizontalAlign="Center"
                                                                CellStyle-HorizontalAlign="Center" Width="130" VisibleIndex="11" ReadOnly="true">
                                                                <HeaderCaptionTemplate>
                                                                    <span>
                                                                        <asp:Image ID="imgActiveStatus" runat="server" ImageUrl="..\Images\icn-active-status.gif"
                                                                            align="top" /></span>
                                                                    <asp:Label ID="lblActive" runat="server" Text="Active Status"></asp:Label>
                                                                </HeaderCaptionTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblActive" runat="server" Text='<%#Eval("ActiveN") %>' ForeColor='<%# Eval("ActiveN").ToString() == "InActive" ? System.Drawing.Color.Gray : System.Drawing.Color.Black %>'></asp:Label>
                                                                </DataItemTemplate>
                                                                <Settings AllowSort="True" ShowFilterRowMenu="False" />
                                                            </dxw:GridViewDataTextColumn>
                                                        </Columns>
                                                        <Settings ShowFilterRow="true" ShowFilterRowMenu="true" ShowFooter="true" />
                                                        <SettingsText EmptyDataRow="No Student details found" />
                                                        <SettingsPager PageSize="10" Mode="EndlessPaging" AlwaysShowPager="true">
                                                        </SettingsPager>
                                                        <TotalSummary>
                                                            <dxw:ASPxSummaryItem FieldName="StudentName" SummaryType="Count" DisplayFormat="Students Registered with ParentApp : {0}" />
                                                        </TotalSummary>
                                                    </dxw:ASPxGridView>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-sm-12 form-box">
                                            <div class="col-sm-12 form-group container-fluid head-part NullBorder">
                                                <div class="col-sm-2 caption" style="padding-top: 10px">
                                                    <asp:Label ID="Label2" runat="server" ForeColor="Red">*</asp:Label>&nbsp;
                                                    <asp:Label ID="Label3" runat="server" Text="Required Fields"></asp:Label>
                                                </div>
                                                <div class="col-sm-4" style="padding-top: 10px">
                                                    <asp:LinkButton ID="ibtSave" runat="server" CssClass="MultilingualBtn" OnClientClick="return ValidateNotification();" OnClick="ibtSave_Click"
                                                        ValidationGroup="vgFleet" TabIndex="4">
                                                        <span id="Span3" runat="server" class="MultilingualBtnspan">
                                                            <div class="Save">
                                                                <div id="AddNotificationButDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                    Save
                                                                </div>
                                                            </div>
                                                        </span>
                                                    </asp:LinkButton>&nbsp;
                                                    <asp:LinkButton ID="ibtUpdate" runat="server" CssClass="MultilingualBtn" OnClientClick="return ValidateNotification();"
                                                        OnClick="ibtUpdate_Click" ValidationGroup="vgFleet" TabIndex="5">
                                                        <span id="Span4" runat="server" class="MultilingualBtnspan">
                                                            <div class="Save">
                                                                <div id="UpdateNotificationButDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                    Update
                                                                </div>
                                                            </div>
                                                        </span>
                                                    </asp:LinkButton>&nbsp;
                                                <asp:LinkButton ID="ibtCancel" runat="server" CssClass="MultilingualBtn" TabIndex="6" OnClick="ibtCancelNotification_Click">
                                                    <span id="Span5" runat="server" class="MultilingualBtnspan">
                                                        <div class="Cancel">
                                                            <div id="CancelNotificationButDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                Cancel
                                                            </div>
                                                        </div>
                                                    </span>
                                                </asp:LinkButton>

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </asp:Panel>
                                <asp:Panel ID="pnlGridNotification" runat="server" CssClass="ControlShowSendCommands">
                                    <div class="form-box">
                                        <h1>
                                            <span class="icon">
                                                <img src="../images/icn-vehicle-message-severity-settings.gif" alt="" />
                                            </span>
                                            <asp:Label ID="lblNotificationGridCaption" runat="server" Text="Send Notifications"></asp:Label></h1>
                                    </div>
                                    <asp:UpdatePanel ID="updNotifications" runat="server">
                                        <Triggers>
                                            <asp:PostBackTrigger ControlID="gvNotifications" />
                                        </Triggers>
                                        <ContentTemplate>
                                            <div id="grid-dsply">
                                                <div style="width: 100%; overflow: auto;">
                                                    <div class="table-responsive">
                                                        <dxw:ASPxGridView ID="gvNotifications" ClientInstanceName="gvNotifications" KeyFieldName="NotificationId" runat="server"
                                                            CssFilePath="~/App_Themes/Office2003Blue/GridView/grid.css" CssPostfix="Office2003_Blue"
                                                            EnableTheming="true" Theme="Office2003Blue" Width="100%" AutoGenerateColumns="False"
                                                            OnHtmlRowCreated="gvNotifications_HtmlRowCreated">
                                                            <Styles AlternatingRow-Enabled="True" CssFilePath="~/App_Themes/Office2003Blue/GridView/grid.css"
                                                                CssPostfix="Office2003_Blue">
                                                                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                                </Header>
                                                                <LoadingPanel ImageSpacing="10px">
                                                                </LoadingPanel>
                                                                <PagerBottomPanel CssClass="PageFooter">
                                                                </PagerBottomPanel>
                                                                <PagerTopPanel CssClass="PageFooter">
                                                                </PagerTopPanel>
                                                            </Styles>
                                                            <SettingsPager PrevPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pPrev.gif"
                                                                PrevPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pPrevDisabled.gif"
                                                                NextPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pNextDisabled.gif"
                                                                NextPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pNext.gif" AlwaysShowPager="true">
                                                            </SettingsPager>
                                                            <Columns>
                                                                <dxw:GridViewDataTextColumn Caption="Notification Status" VisibleIndex="0"
                                                                    HeaderStyle-HorizontalAlign="Center" CellStyle-HorizontalAlign="Center" Width="5%"
                                                                    Name="SendNotification">
                                                                    <HeaderTemplate>
                                                                    </HeaderTemplate>
                                                                    <DataItemTemplate>
                                                                        <asp:ImageButton ID="ibtSendNotification" runat="server" CommandArgument='<%# Eval("NotificationId")+","+Eval("NotificationName")+","+Eval("NotificationTypeName") %>'
                                                                            AlternateText="Send to Parents mobile" CommandName="Send" ImageUrl="~/images/mobile.png"
                                                                            ToolTip="Send to Parents mobile" ImageAlign="Middle" OnClick="ibtSendNotification_click"
                                                                            CssClass="handButton" Visible='<%# Eval("IsNotificationSent").ToString() == "False" ? true : false %>' />
                                                                        <asp:ImageButton ID="ibtSendNotificationDisable" runat="server" CommandArgument='<%# Eval("NotificationId")+","+Eval("NotificationName")+","+Eval("NotificationTypeName") %>'
                                                                            AlternateText="Resend to Parents mobile" CommandName="Send" ImageUrl="~/images/icn-sms-users-Disable.gif"
                                                                            ToolTip="Resend to Parents mobile" ImageAlign="Middle" OnClick="ibtSendNotification_click"
                                                                            CssClass="handButton" Visible='<%# Eval("IsNotificationSent").ToString() == "False"  ? false : true %>' />
                                                                    </DataItemTemplate>
                                                                </dxw:GridViewDataTextColumn>
                                                                <dxw:GridViewDataColumn Caption="Notification Type" Width="16%" FieldName="NotificationTypeName"
                                                                    VisibleIndex="1" CellStyle-Wrap="True" CellStyle-HorizontalAlign="Center">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon" style="padding-top: 5px">
                                                                            <img src="../images/80.png" alt="" /></span>
                                                                        <asp:Label ID="lblNotificationType" runat="server" Text="Notification Type"></asp:Label>
                                                                    </HeaderCaptionTemplate>
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewDataColumn Caption="Notification Name" Width="32%" FieldName="NotificationName" VisibleIndex="2">
                                                                    <HeaderCaptionTemplate>
                                                                        <div align="center">
                                                                            <span class="icon">
                                                                                <img src="../images/75.png" align="top" alt="" style="padding-bottom: 5px" /></span>
                                                                            <asp:Label ID="lblNotificationName" Text="Notification Name" runat="server"></asp:Label>
                                                                        </div>
                                                                    </HeaderCaptionTemplate>
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewDataColumn Caption="Description" Width="36%" FieldName="Description"
                                                                    VisibleIndex="2" CellStyle-Wrap="True">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon" style="padding-top: 5px">
                                                                            <img src="../images/79.png" alt="" /></span>
                                                                        <asp:Label ID="lblDescription" runat="server" Text="Description"></asp:Label>
                                                                    </HeaderCaptionTemplate>
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewDataColumn Caption="Sent on" Width="16%" FieldName="PublishedDate"
                                                                    VisibleIndex="2" CellStyle-Wrap="True" CellStyle-HorizontalAlign="Center">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon" style="padding-top: 5px">
                                                                            <img src="../images/date.png" alt="" /></span>
                                                                        <asp:Label ID="lblSentDate" runat="server" Text="Sent Date"></asp:Label>
                                                                    </HeaderCaptionTemplate>
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewDataColumn Caption="Expire on" Width="16%" FieldName="ExpiryDate"
                                                                    VisibleIndex="2" CellStyle-Wrap="True" CellStyle-HorizontalAlign="Center">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon" style="padding-top: 5px">
                                                                            <img src="../images/date.png" alt="" /></span>
                                                                        <asp:Label ID="lblExpiryDate" runat="server" Text="Expiry Date"></asp:Label>
                                                                    </HeaderCaptionTemplate>
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewDataTextColumn Caption="Edit" Width="3%" HeaderStyle-HorizontalAlign="Center"
                                                                    CellStyle-HorizontalAlign="Center" Name="Edit" VisibleIndex="4">
                                                                    <HeaderTemplate>
                                                                    </HeaderTemplate>
                                                                    <DataItemTemplate>
                                                                        <asp:ImageButton ID="ibtEdit" runat="server" CommandArgument='<%# Eval("NotificationId").ToString() %>'
                                                                            OnClick="ibtEdit_Click" AlternateText="Edit" CommandName="Delete" ImageUrl="~/images/icn-edit.gif"
                                                                            ToolTip="Click here to Edit" ImageAlign="Middle" CssClass="handButton" />
                                                                    </DataItemTemplate>
                                                                </dxw:GridViewDataTextColumn>
                                                                <dxw:GridViewDataTextColumn Caption="Delete" VisibleIndex="5" HeaderStyle-HorizontalAlign="Center"
                                                                    CellStyle-HorizontalAlign="Center" Width="3%">
                                                                    <HeaderTemplate>
                                                                    </HeaderTemplate>
                                                                    <DataItemTemplate>
                                                                        <asp:ImageButton ID="ibtDelete" runat="server" CommandArgument='<%# Eval("NotificationId") %>'
                                                                            OnClick="ibtDelete_click" AlternateText="Delete" CommandName="Delete" ImageUrl="~/images/delete-icon.gif"
                                                                            ToolTip="Click here to Delete" ImageAlign="Middle" CssClass="handButton" />
                                                                    </DataItemTemplate>
                                                                </dxw:GridViewDataTextColumn>
                                                            </Columns>
                                                            <%--<ClientSideEvents EndCallback="function(s, e) {document.getElementById('btnTest').click();}" />--%>
                                                            <Settings ShowStatusBar="Auto" ShowFilterRow="false" ShowGroupPanel="false" />
                                                            <SettingsText EmptyDataRow="No data available" />
                                                            <SettingsBehavior ColumnResizeMode="NextColumn" AllowSort="true" AllowDragDrop="true"
                                                                AllowGroup="true" AllowFocusedRow="false" />
                                                            <SettingsPager PageSize="10" Mode="ShowPager" AlwaysShowPager="true">
                                                            </SettingsPager>
                                                        </dxw:ASPxGridView>
                                                    </div>
                                                </div>
                                            </div>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </asp:Panel>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <script type="text/javascript">
                function pageLoad() {
                    if (document.getElementById('txtExpiryDate') != null) {
                        $jdp('#txtExpiryDate').datepicker({
                            numberOfMonths: 1,
                            showButtonPanel: true,
                            dateFormat: 'dd-M-yy',
                            changeYear: true,
                            changeMonth: true,
                            hideIfNoPrevNext: true,
                            beforeShow: function (dateText, inst) {
                                $jdp("input[id$=txtExpiryDate]").datepicker('option', 'minDate', new Date());
                            }
                        });
                    }
                }

                var Alert_Delete = "Do you want to delete this Entry.";
                var AlertSelectVehicle = 'Please select one or more Students.';
                var Alert_NotificationExists = 'News Name already exists.';
                var Alert_NotificationName = 'Please enter Notification Name';
                var Alert_Expiry = 'Please enter Expiry Date';

                function setAlertMessageDelete(Delete, selectvehicle) {
                    Alert_Delete = Delete;
                    AlertSelectVehicle = selectvehicle;
                }

                // Delete confirm
                function DeleteConfirm() {
                    return confirm(Alert_Delete);
                }

                function ValidateNotification() {

                    var NotificationName = document.getElementById('txtNotification');
                    var ExpiryDate = document.getElementById('txtExpiryDate');
                    var StudentGrid = document.getElementById('gvStudent');
                    var isError = false;
                    var controlToBeFocused;
                    var alertMessage = '';

                    //if (!isNewsNameValid) {
                    //    isError = true;
                    //    alertMessage = Alert_NewsName;
                    //    newsName.style.backgroundColor = 'lightyellow';
                    //    controlToBeFocused = newsName;
                    //}

                    if (RemoveSpaces(NotificationName).length == 0) {
                        isError = true;
                        controlToBeFocused = NotificationName;
                        alertMessage += (alertMessage.length > 0 ? '</br>' : '') + Alert_NotificationName;
                        NotificationName.style.backgroundColor = 'lightyellow';
                    }
                    else {
                        NotificationName.style.backgroundColor = 'white';
                    }

                    if (ExpiryDate.value.length == 0) {
                        isError = true;
                        controlToBeFocused = ExpiryDate;
                        alertMessage += (alertMessage.length > 0 ? '</br>' : '') + Alert_Expiry;
                        ExpiryDate.style.backgroundColor = 'lightyellow';
                    }
                    else {
                        NotificationName.style.backgroundColor = 'white';
                    }

                    if (ddlNotificationType.GetSelectedIndex() == 0) {
                        if (gvStudent.GetSelectedRowCount() == 0) {
                            isError = true;
                            alertMessage += (alertMessage.length > 0 ? '</br>' : '') + AlertSelectVehicle;
                            controlToBeFocused = StudentGrid;
                        }
                    }

                    if (isError) {
                        controlToBeFocused.focus();
                        TrinetraCustomAlerts(alertMessage);
                        return false;
                    }
                    else {
                        return true;
                    }
                }
            </script>
            <asp:HiddenField ID="hdnLogout" runat="server" />
        </form>
    </div>
    <!-- Content Ends Here -->
    <uc2:Footer ID="ucFooter" runat="server" />
</body>
</html>
