/*
 * Author       : the_pc_gamer
 * Generated on : 23-Nov-2009 00:19:36
 * Version      : 3.0
 */
application "NGN Application"
{
    type = public
    allow html = true
    date format = "dd-MMM-yyyy"
    time zone = "US/Arizona"
    section Home
    {
        form  NGNApp
        {
            displayname  =  "NGN Application"
            success message  =  "Data Added Successfully!"
            
            must  have  Applying_For
            (
                displayname  =  "Applying For"
                type  =  picklist
                values  =  {"Reviewer",   "PHP/Java/HTML coder",   "Graphic Artist",   "News Correspondent"}
            )

            must  have  Your_First_Name
            (
                displayname  =  "Your First Name"
                type  =  text
            )

            must  have  Applicant_Name
            (
                displayname  =  "Your Nickname"
                type  =  text
                width  =  30
                maxchar  =  30
            )

            must  have  Email_ID
            (
                displayname  =  "Contact Email"
                type  =  email
                maxchar  =  50
            )

            must  have  Country
            (
                type  =  text
            )

            Date_of_Birth
            (
                displayname  =  "Date of Birth"
                type  =  date
            )

            must  have  Preferred_Platform
            (
                displayname  =  "Preferred Platform"
                type  =  checkboxes
                values  =  {"PC",   "Consoles",   "Handheld"}
            )

            How_many_hours_per_week_do_you_spend_on_games
            (
                displayname  =  "How many hours per week do you spend on games?"
                type  =  picklist
                values  =  {"1-3 hrs",   "3-6 hrs",   "6-10 hrs",   "10-15 hrs",   "15+ hrs"}
            )

            must  have  What_makes_good
            (
                displayname  =  "What makes you a good candidate?"
                type  =  textarea
                width  =  4 , 27
            )

            Your_Favorite_game_websites
            (
                displayname  =  "Your Favorite game websites"
                type  =  textarea
            )

            Other_Info
            (
                displayname  =  "Other Info"
                type  =  textarea
            )

            Resume
            (
                type = upload file
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                        on success
                        {
                            sendmail
                            (
                                To       :  "the_pc_gamer@newgamenetwork.com", "nutcrackr@newgamenetwork.com" 
                                From     :  zoho.adminuserid 
                                Subject  :  "New NGN Application" 
                                Message  :  "<br />\n<span style=\"font-weight: bold;\">A new application has been submitted</span><br />\n<br />\n<span style=\"font-weight: bold;\">Applicant ID: </span>" + input.ID + "<br />\n<br />\n<span style=\"font-weight: bold;\">Applying for:</span> " + input.Applying_For + "<br />\n<span style=\"font-weight: bold;\">Applicant Nick:</span> " + input.Applicant_Name + "<br />\n<span style=\"font-weight: bold;\">Applicant Name:</span> " + input.Your_First_Name + "<br />\n<br />\n<span style=\"font-weight: bold;\">Contact Email:</span> " + input.Email_ID + "<br />\n<span style=\"font-weight: bold;\">Country:</span> " + input.Country + "<br />\n<br />\n<span style=\"font-weight: bold;\">DOB:</span> " + input.Date_of_Birth + "<br />\n<span style=\"font-weight: bold;\">Fav Platform: </span>" + input.Preferred_Platform + "<br />\n<span style=\"font-weight: bold;\">Fav game websites:</span> " + input.Your_Favorite_game_websites + "<br />\n<br />\n<span style=\"font-weight: bold;\">Hrs per week on games: </span>" + input.How_many_hours_per_week_do_you_spend_on_games + "<br />\n<br />\n<span style=\"font-weight: bold;\">What makes you a good choice?</span> " + input.What_makes_good + "<br />\n<br />\n<span style=\"font-weight: bold;\">Other Info:</span> " + input.Other_Info + "<br />\n<br />\n<span style=\"font-weight: bold;\">Resume:</span> " + input.Resume + "<br />" 
                            )
                            openUrl("http://www.newgamenetwork.com", "same window");
                        }
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  NGNApp_View
        {
            displayname = "NGNApp View"
            show  all  rows  from  NGNApp 
            (
                ID
                Added_User as "Added User"
                Added_Time as "Added Time"
                Modified_User as "Last Modified User"
                Modified_Time as "Last Modified Time"
                Added_User_IP_Address as "Added User IP Address"
                Modified_User_IP_Address as "Modified User IP Address"
                Applying_For as "Applying For"
                Applicant_Name as "Applicant Name"
                Email_ID as "Email ID"
                Date_of_Birth as "Date of Birth"
                What_makes_good as "Address"
                Your_First_Name as "Your First Name"
                Resume
                Country
                Preferred_Platform as "Preferred Platform"
                Other_Info as "Other Info"
                Your_Favorite_game_websites as "Your Favorite game websites"
                How_many_hours_per_week_do_you_spend_on_games as "How many hours per week do you spend on games?"
            )
            filters 
            (
                How_many_hours_per_week_do_you_spend_on_games
            )
            options
            (
                display rows = 100
            )
        }

    }

}
