/*
 * Author       : joinpank
 * Generated on : 23-Nov-2009 06:25:42
 * Version      : 3.0
 */
application "~Pankhudi Foundation"
{
    type = public
    date format = "dd-MMM-yyyy"
    time zone = "America/Los_Angeles"
    section Home
    {
        form  Pankhudi_Foundation
        {
            displayname  =  "~Pankhudi Foundation"
            captcha = true
            success message  =  "Data Added Successfully!"
            
            must  have  Name
            (
                type  =  text
            )

            must  have  Email_Address
            (
                displayname  =  "Email Address"
                type  =  email
            )

            Gender
            (
                type  =  radiobuttons
                values  =  {"Male",   "Female"}
            )

            must  have  Date_of_Birth
            (
                displayname  =  "Date of Birth"
                type  =  text
            )

            must  have  Contact_Number
            (
                displayname  =  "Contact Number"
                type  =  text
            )

            must  have  Address
            (
                type  =  textarea
            )

            must  have  Current_City_of_Residence
            (
                displayname  =  "Current City of Residence"
                type  =  text
            )

            must  have  Nationality
            (
                type  =  text
            )

            must  have  City
            (
                type  =  text
                width  =  30
            )

            must  have  Zip_Code
            (
                displayname  =  "Zip Code"
                type  =  text
                width  =  20
            )

            must  have  State
            (
                type  =  text
            )

            must  have  Country
            (
                type  =  text
            )

            must  have  Profession
            (
                type  =  text
            )

            must  have  Qualification
            (
                type  =  text
            )

            must  have  Passport_Driving_License_PAN_Number
            (
                displayname  =  "Passport/Driving License/PAN Number"
                type  =  text
            )

            Photo
            (
                type = upload file
            )

            must  have  How_did_you_come_to_know_about_Pankhudi_Foundation
            (
                displayname  =  "How did you come to know about ~Pankhudi Foundation:"
                type  =  picklist
                values  =  {"Friends",   "Web",   "Others"}
            )

            must  have  The_reason_behind_your_desire_to_volunteer_Please_fill_in_brief
            (
                displayname  =  "The reason behind your desire to volunteer (Please fill in brief)"
                type  =  textarea
            )

            Describe_your_prior_experience_of_working_with_children_if_any
            (
                displayname  =  "Describe your prior experience of working with children (if any)"
                type  =  textarea
            )

            must  have  How_would_you_like_to_help_us
            (
                displayname  =  "How would you like to help us?"
                type  =  checkboxes
                values  =  {"By Active participation",   "By Monetary Contribution",   "Joining Admin teams: Design Team",   "Joining Admin teams: PR Work",   "Joining Admin teams: Web related work and processes",   "Joining Admin teams: Documentation and Media related",   "Joining Admin teams: Children Content Development"}
            )

            Reference_of_1_persons_in_known_Pankhudi_If_any_Name_Contact
            (
                displayname  =  "Reference of 1 person(s) in known ~Pankhudi"
                type  =  textarea
                tooltip  =  "Please include name and contact number"
            )

            must  have  Reference_of_any_2_persons_who_know_you
            (
                displayname  =  " Reference of  any 2 persons who know you:"
                type  =  textarea
                tooltip  =  "Please include contact number"
            )

            must  have  Checkbox_1
            (
                displayname  =  "The details provided above are true to my knowledge and I wish to volunteer ~Pankhudi Foundation and abide by the rules put forth."
                type  =  checkboxes
                values  =  {"Agree",   "Disagree"}
            )

            must  have  Date__field
            (
                displayname  =  "Date"
                type  =  date
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                        on success
                        {
                            sendmail
                            (
                                To       :  "join@pankhudifoundation.org" 
                                From     :  zoho.adminuserid 
                                CC       :  "shahzad.wakeel@gmail.com"
                                Subject  :  "New Volunteer Data" 
                                Message  :  "<span style=\"color: rgb(128, 0, 0);\">Dear Join Desk,</span><br style=\"color: rgb(128, 0, 0);\" /><span style=\"color: rgb(128, 0, 0);\">Following person has entered the personal data. </span><br style=\"color: rgb(128, 0, 0);\" /><span style=\"color: rgb(128, 0, 0);\">Regards</span><br style=\"color: rgb(128, 0, 0);\" /><span style=\"color: rgb(128, 0, 0);\">Shahzad Wakeel<br /><br /><br />===================================<br />" + input.Qualification + input.Current_City_of_Residence + input.Passport_Driving_License_PAN_Number + input.City + input.Contact_Number + input.Nationality + input.Reference_of_any_2_persons_who_know_you + input.Profession + input.Describe_your_prior_experience_of_working_with_children_if_any + input.Address + input.Checkbox_1 + input.Name + input.Reference_of_1_persons_in_known_Pankhudi_If_any_Name_Contact + input.Gender + input.State + input.Date_of_Birth + input.How_would_you_like_to_help_us + input.Zip_Code + input.The_reason_behind_your_desire_to_volunteer_Please_fill_in_brief + input.Country + input.Photo + input.Email_Address + input.How_did_you_come_to_know_about_Pankhudi_Foundation + input.Added_User + "</span>" 
                            )
                            sendmail
                            (
                                To       :  "pr@pankhudifoundation.org", input.Email_Address, "shahzad.wakeel@gmail.com" 
                                From     :  zoho.adminuserid 
                                Subject  :  " Data Successfully added." 
                                Message  :  "Dear Volunteer,<br />Your personal details are added in our database. <br />Pleas now contact our PR Reps to know our activities in your city. <br /><br />Regards,<br />Join Desk" 
                            )
                            success message "Data added/edited successfully";
                        }
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        grid  Pankhudi_Foundation_View
        {
            displayname = "~Pankhudi Foundation View"
            show  all  rows  from  Pankhudi_Foundation [Date__field == (zoho.currentdate  -  '0W:1D:0H:0M:0S')]
            (
                Added_Time as "Added Time"
                Date__field as "Date"
            )
            filters 
            (
                Added_Time
                Modified_Time
                Date__field
            )
        }

    }

}
