<%@ Page Title="" Language="C#" MasterPageFile="~/rsvpmaster.Master" AutoEventWireup="true" CodeBehind="Donation.aspx.cs" Inherits="NECPATEL.Donation" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <script language="javascript" type="text/javascript" >
         function isNumber(evt) {
             evt = (evt) ? evt : window.event;
             var charCode = (evt.which) ? evt.which : evt.keyCode;
             if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                 return false;
             }
             return true;
         }

         function isAmount(evt) {
             evt = (evt) ? evt : window.event;
             var charCode = (evt.which) ? evt.which : evt.keyCode;
             if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                 if (charCode == 46) {
                     var string = document.getElementById("<%=txtOtherAmount.ClientID%>").value;

                        if (string.length != string.replace(".", "").length) {

                            return false;
                        }
                        return true;
                    }
                    return false;
                }
                return true;
         }


         function validateEmail() {

             var email = document.getElementById("<%=txtNewEmail.ClientID%>").value;

             if (email != "") {
                 var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
                 if (!filter.test(email)) {
                     alert('Please enter valid email address');
                     email.focus;
                     return false;
                 }
             }
             return true;
         }


         function ValidatePaymentinformation() {
             var email = document.getElementById("<%=txtNewEmail.ClientID%>").value;

             if (email != "") {
                 var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
                 if (!filter.test(email)) {
                     alert('Please enter valid email address');
                     email.focus;
                     return false;
                 }
             }
             var cb50 = document.getElementById("<%=rb50.ClientID%>").checked;
             var cb100 = document.getElementById("<%=rb100.ClientID%>").checked;
             var cbOther = document.getElementById("<%=rbother.ClientID%>").checked;

             var txtOtherAmount = document.getElementById("<%=txtOtherAmount.ClientID%>").value;

             if (cbOther == true) {
                 if (document.getElementById("<%=txtOtherAmount.ClientID%>").value == "") {
                     
                    alert("Please enter amount for donation.");
                    document.getElementById("<%=txtOtherAmount.ClientID%>").focus();
                     
                    return false;
                }

                if (document.getElementById("<%=txtOtherAmount.ClientID%>").value < 1) {
                    alert("Please enter 1 or more dollar.");
                    document.getElementById("<%=txtOtherAmount.ClientID%>").focus();
                    return false;

                }

            }
            if (document.getElementById("<%=txtCardNumber.ClientID%>").value == "") {
                 alert("Please enter card number");
                 document.getElementById("<%=txtCardNumber.ClientID%>").focus();
                return false;
            }

             if (document.getElementById("<%=txtCVVNumber.ClientID%>").value == "") {
                 alert("Please enter CVV number");
                 document.getElementById("<%=txtCVVNumber.ClientID%>").focus();
                 return false;
             }

             if (document.getElementById("<%=txtNameOnCard.ClientID%>").value == "") {
                 alert("Please enter name on card.");
                 document.getElementById("<%=txtNameOnCard.ClientID%>").focus();
                return false;
            }

            if (document.getElementById("<%=ddlCardType.ClientID%>").value == "0") {
                 alert("Select card type.");
                 document.getElementById("<%=ddlCardType.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=ddlExpirtMonth.ClientID%>").value == "0") {
                 alert("Select card expiry month.");
                 document.getElementById("<%=ddlExpirtMonth.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=ddlExpirtYear.ClientID%>").value == "0") {
                 alert("Select card expiry year.");
                 document.getElementById("<%=ddlExpirtYear.ClientID%>").focus();
                return false;
            }
             if (document.getElementById("<%=txtStreet.ClientID%>").value == "") {
                 alert("Please enter address");
                 document.getElementById("<%=txtStreet.ClientID%>").focus();
                 return false;
             }
            if (document.getElementById("<%=txtCity.ClientID%>").value == "") {
                 alert("Please enter city name");
                 document.getElementById("<%=txtCity.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=ddlState.ClientID%>").value == "0") {
                 alert("Please select state.");
                 document.getElementById("<%=ddlState.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=txtPostalCode.ClientID%>").value == "") {
                 alert("Please enter postal code.");
                 document.getElementById("<%=txtPostalCode.ClientID%>").focus();
                return false;
            }
            return true;
         }  
</script>
    <div >
    <table>
        <tr>
            <td></td>
        </tr>
        <tr>
            <td></td>
        </tr>
        
        <tr>
            <td colspan="4">
                <h1><asp:Label ID="lblWelcomeMember" runat="server"></asp:Label></h1>
            </td>
           
        </tr>
        <tr><td colspan="3">

                         <h3> <asp:Label ID="lblPayingFor" runat="server" Text=""></asp:Label>
                             </h3>  
                        </td>
                    </tr>
        <tr>
            <%--<td colspan="4" style="padding-top:25px">
                <asp:Label ID="lblMessage" runat="server" >Thank you very much for showing interest in donation to our Samaj.</asp:Label>
            </td>--%>
           
        </tr>
        <tr>
            <td colspan="4">
                <asp:Label ID="lblDonationAmount" Visible="false" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <asp:Button ID="btnPayforOther" runat="server" Visible="true" Font-Size="Large" Enabled="true" Height="50px" BorderStyle="Ridge" Text="Search to pay for other" OnClick="btnPayforOther_Click" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:RadioButton ID="rb50" text="$ 50.00" runat="server" Checked="true" GroupName="PaymentOption" AutoPostBack="True" OnCheckedChanged="rbother_CheckedChanged" />
            </td>
            <td>
                <asp:RadioButton ID="rb100" Text="$ 100.00" runat="server" GroupName="PaymentOption" AutoPostBack="True" OnCheckedChanged="rbother_CheckedChanged" />
            </td>
            <td>
                <asp:RadioButton ID="rbother" Text="Other amount" runat="server" GroupName="PaymentOption" AutoPostBack="True" OnCheckedChanged="rbother_CheckedChanged" /> &nbsp; 
                <asp:TextBox ID="txtOtherAmount" runat="server" Enabled="False" onkeypress="return isAmount(event)"></asp:TextBox>
            </td>
            <td>
               
            </td>
        </tr>
        <tr>
            <td colspan="2">Email Address if changed</td>
            <td colspan="2">
                <asp:TextBox ID="txtNewEmail" runat="server"  ></asp:TextBox></td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:CheckBox ID="CheckBox1" runat="server" Text="Sorry, I am unable to donate." AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" /> 
                </td>
            <td colspan="2">
               
            </td>
        </tr>
        <tr><td colspan="2">
                Comments:
                </td>
            <td colspan="2">
                <asp:TextBox ID="txtcomments" runat="server" Width="265px"></asp:TextBox>
            </td>

        </tr>
        <tr>
            <td colspan="4">  <asp:Button ID="btnZeroDonation" runat="server" Enabled="False" OnClick="btnZeroDonation_Click" OnClientClick="return validateEmail();" Text="Submit your responce" /></td>
        </tr>
        <tr>
            <td colspan="4">
                <table>
        
        <tr>
           <td colspan="4">
               <b> Credit card information</b>
            </td>
              
        </tr>
        <tr>
            <td>Card Number <span style="color:red">*</span></td>
            <td>
                <asp:TextBox ID="txtCardNumber" runat="server" type="tel" pattern="[0-9]*"  onkeypress="return isNumber(event)" MaxLength="16"></asp:TextBox></td>
        </tr>
        <tr>
            <td>Card Verification Number <span style="color:red">*</span></td>
            <td>
                <asp:TextBox ID="txtCVVNumber" runat="server" type="tel" onkeypress="return isNumber(event)"></asp:TextBox> <a href="http://www.necpatelsamaj.com/cvvcode.aspx" target="_blank" style="font-size:11px">What is my CVV code?</a></td>
        </tr>
                    <tr>
            <td>Name on card <span style="color:red">*</span></td>
            <td>
                <asp:TextBox ID="txtNameOnCard" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td>Card Type <span style="color:red">*</span></td>
            <td>
                <asp:DropDownList ID="ddlCardType" runat="server">
                    <asp:ListItem Text="Select Type" Value="0"> </asp:ListItem>
                    <asp:ListItem Text="VISA" Value="visa"></asp:ListItem>
                    <asp:ListItem Text="Master Card" Value="mastercard"></asp:ListItem>
                    <asp:ListItem Text="American Express" Value="AMEX"></asp:ListItem>
                    <asp:ListItem Text="Discover" Value="Discover"></asp:ListItem>
                </asp:DropDownList>
                </td>
        </tr>
        <tr>
            <td>Card Expiry Month <span style="color:red">*</span></td>
            <td>
                <asp:DropDownList ID="ddlExpirtMonth" runat="server">
                    <asp:ListItem Text="Select Month" Value="0"></asp:ListItem>
                    <asp:ListItem Text="01 January" Value="1"></asp:ListItem>
                    <asp:ListItem Text="02 February" Value="2"></asp:ListItem>
                    <asp:ListItem Text="03 March" Value="3"></asp:ListItem>
                    <asp:ListItem Text="04 April" Value="4"></asp:ListItem>
                    <asp:ListItem Text="05 May" Value="5"></asp:ListItem>
                    <asp:ListItem Text="06 June" Value="6"></asp:ListItem>
                    <asp:ListItem Text="07 July" Value="7"></asp:ListItem>
                    <asp:ListItem Text="08 August" Value="8"></asp:ListItem>
                    <asp:ListItem Text="09 September" Value="9"></asp:ListItem>
                    <asp:ListItem Text="10 October" Value="10"></asp:ListItem>
                    <asp:ListItem Text="11 November" Value="11"></asp:ListItem>
                    <asp:ListItem Text="12 December" Value="12"></asp:ListItem>

                </asp:DropDownList>
            
                        
            </td>
        </tr>
        <tr>
            <td>Card Expiry Year <span style="color:red">*</span>
            </td>
            <td>
                <asp:DropDownList ID="ddlExpirtYear" runat="server">
                    <asp:ListItem Text="Select Year" Value="0"></asp:ListItem>
                    <asp:ListItem Text="2016" Value="2016"></asp:ListItem>
                    <asp:ListItem Text="2017" Value="2017"></asp:ListItem>
                    <asp:ListItem Text="2018" Value="2018"></asp:ListItem>
                    <asp:ListItem Text="2019" Value="2019"></asp:ListItem>
                    <asp:ListItem Text="2020" Value="2020"></asp:ListItem>
                    <asp:ListItem Text="2021" Value="2021"></asp:ListItem>
                    <asp:ListItem Text="2022" Value="2022"></asp:ListItem>
                    <asp:ListItem Text="2023" Value="2023"></asp:ListItem>
                    <asp:ListItem Text="2024" Value="2024"></asp:ListItem>
                    <asp:ListItem Text="2025" Value="2025"></asp:ListItem>
                    <asp:ListItem Text="2026" Value="2026"></asp:ListItem>
                    <asp:ListItem Text="2027" Value="2027"></asp:ListItem>
                    <asp:ListItem Text="2028" Value="2028"></asp:ListItem>
                    <asp:ListItem Text="2029" Value="2029"></asp:ListItem>
                    <asp:ListItem Text="2030" Value="2030"></asp:ListItem>
                </asp:DropDownList>
                </td>
        </tr>
        
       <%-- <tr>
            <td>Appartmant No <span style="color:red">*</span></td>
            <td>
                <asp:TextBox ID="txtAddress" runat="server"></asp:TextBox></td>
        </tr>--%>
        <tr>
            <td>Address <span style="color:red">*</span></td>
            <td>
                <asp:TextBox ID="txtStreet" runat="server"></asp:TextBox></td>
        </tr>
                    <tr>
            <td>Apt.&nbsp; # </td>
            <td>
                <asp:TextBox ID="txtAppartment" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td>City <span style="color:red">*</span></td>
            <td>
                <asp:TextBox ID="txtCity" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td>State <span style="color:red">*</span></td>
            <td>
                <asp:DropDownList ID="ddlState" runat="server">
                   
<asp:ListItem Text="Select State" Value="0"></asp:ListItem>
                     <asp:ListItem Text="Alabama" Value="AL"></asp:ListItem>
                    <asp:ListItem Text="Alaska" Value="AK"></asp:ListItem>
<asp:ListItem Text="Arizona" Value="AZ"></asp:ListItem>
<asp:ListItem Text="Arkansas" Value="AR"></asp:ListItem>
<asp:ListItem Text="California" Value="CA"></asp:ListItem>
<asp:ListItem Text="Colorado" Value="CO"></asp:ListItem>
<asp:ListItem Text="Connecticut" Value="CT"></asp:ListItem>
<asp:ListItem Text="Delaware" Value="DE"></asp:ListItem>
<asp:ListItem Text="District Of Columbia" Value="DC"></asp:ListItem>
<asp:ListItem Text="Florida" Value="FL"></asp:ListItem>
<asp:ListItem Text="Georgia" Value="GA"></asp:ListItem>
<asp:ListItem Text="Hawaii" Value="HI"></asp:ListItem>
<asp:ListItem Text="Idaho" Value="ID"></asp:ListItem>
<asp:ListItem Text="Illinois" Value="IL"></asp:ListItem>
<asp:ListItem Text="Indiana" Value="IN"></asp:ListItem>
<asp:ListItem Text="Iowa" Value="IA"></asp:ListItem>
<asp:ListItem Text="Kansas" Value="KS"></asp:ListItem>
<asp:ListItem Text="Kentucky" Value="KY"></asp:ListItem>
<asp:ListItem Text="Louisiana" Value="LA"></asp:ListItem>
<asp:ListItem Text="Maine" Value="ME"></asp:ListItem>
<asp:ListItem Text="Maryland" Value="MD"></asp:ListItem>
<asp:ListItem Text="Massachusetts" Value="MA" Selected="True"></asp:ListItem>
<asp:ListItem Text="Michigan" Value="MI"></asp:ListItem>
<asp:ListItem Text="Minnesota" Value="MN"></asp:ListItem>
<asp:ListItem Text="Mississippi" Value="MS"></asp:ListItem>
<asp:ListItem Text="Missouri" Value="MO"></asp:ListItem>
<asp:ListItem Text="Montana" Value="MT"></asp:ListItem>
<asp:ListItem Text="Nebraska" Value="NE"></asp:ListItem>
<asp:ListItem Text="Nevada" Value="NV"></asp:ListItem>
<asp:ListItem Text="New Hampshire" Value="NH"></asp:ListItem>
<asp:ListItem Text="New Jersey" Value="NJ"></asp:ListItem>
<asp:ListItem Text="New Mexico" Value="NM"></asp:ListItem>
<asp:ListItem Text="New York" Value="NY"></asp:ListItem>
<asp:ListItem Text="North Carolina" Value="NC"></asp:ListItem>
<asp:ListItem Text="North Dakota" Value="ND"></asp:ListItem>
<asp:ListItem Text="Ohio" Value="OH"></asp:ListItem>
<asp:ListItem Text="Oklahoma" Value="OK"></asp:ListItem>
<asp:ListItem Text="Oregon" Value="OR"></asp:ListItem>
<asp:ListItem Text="Pennsylvania" Value="PA"></asp:ListItem>
<asp:ListItem Text="Rhode Island" Value="RI"></asp:ListItem>
<asp:ListItem Text="South Carolina" Value="SC"></asp:ListItem>
<asp:ListItem Text="South Dakota" Value="SD"></asp:ListItem>
<asp:ListItem Text="Tennessee" Value="TN"></asp:ListItem>
<asp:ListItem Text="Texas" Value="TX"></asp:ListItem>
<asp:ListItem Text="Utah" Value="UT"></asp:ListItem>
<asp:ListItem Text="Vermont" Value="VT"></asp:ListItem>
<asp:ListItem Text="Virginia" Value="VA"></asp:ListItem>
<asp:ListItem Text="Washington" Value="WA"></asp:ListItem>
<asp:ListItem Text="West Virginia" Value="WV"></asp:ListItem>
<asp:ListItem Text="Wisconsin" Value="WI"></asp:ListItem>
<asp:ListItem Text="Wyoming" Value="WY"></asp:ListItem>
                    
                </asp:DropDownList>
                </td>
        </tr>
        <tr>
            <td>Zip Code <span style="color:red">*</span></td>
            <td>
                <asp:TextBox ID="txtPostalCode" runat="server" type="tel" onkeypress="return isNumber(event)"></asp:TextBox></td>
        </tr>
        <tr>
            <td>Phone Number</td>
            <td>
                <asp:TextBox ID="txtPhoneNumber" runat="server" type="tel" onkeypress="return isNumber(event)"></asp:TextBox></td>
        </tr>
                    
        <tr><td colspan="4">Fields marked with <span style="color:red">*</span> are mandotary</td></tr>
        <tr><td colspan="2"> <asp:Button ID="btnSubmit" runat="server" Text="Make Payment" OnClick="btnSave_Click" OnClientClick="return ValidatePaymentinformation();"/></td>
            
        </tr>
      
            <tr><td colspan="2"> <asp:Button ID="btnRequestforPayment" runat="server" Visible="false" Text="View Payment Details" OnClick="btnRequestforPayment_Click" /></td>
    </tr>
    </table>
            </td>
        </tr>
    </table>
          <tr><td colspan="3">
          <asp:Label ID="lblResult" runat="server" Text=""></asp:Label>  
</td></tr>
        </div>

</asp:Content>
