/*
 * Author       : pageantcast
 * Generated on : 23-Nov-2009 03:36:54
 * Version      : 3.0
 */
application "E-mail Police on the Scene!"
{
    type = public
    date format = "dd-MMM-yyyy"
    time zone = "America/Chicago"
    section Home
    {
        form  Main_Form
        {
            displayname  =  "E-mail Us!"
            captcha = true
            success message  =  "Thank you for your e-mail! It is being sent directly to J.D. Dhein by our crack forces of good and light!"
            
            Your_Email_Address
            (
                displayname  =  "Your Email Address"
                type  =  email
            )

            How_did_you_find_out_about_Police_on_the_Scene_with_a_Crime_Prevention_Lean
            (
                displayname  =  "How did you find out about Police on the Scene with a Crime Prevention Lean?"
                type  =  picklist
                values  =  {"Podcast search",   "Podcast Pickle",   "Ed Ovett",   "Double M / Mark Baars",   "Friend",   "iTunes",   "other"}
            )

            must  have  Feedback_Category
            (
                displayname  =  "Feedback Category"
                type  =  picklist
                values  =  {"Podcast Suggestion",   "Comment",   "Website Suggestion",   "Correction",   "Show idea",   "Scam alert",   "Stupid Criminal Story"}
                sortorder  =  ascending
            )

            Comments
            (
                type  =  textarea
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                        on success
                        {
                            sendmail
                            (
                                To       :  "policeonthescene@yahoo.com" 
                                From     :  zoho.adminuserid 
                                Subject  :  input.Feedback_Category + " : Received an e-mail from the form" 
                                Message  :  input.formdata 
                            )
                        }
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  Main_Form_View
        {
            displayname = "Main Form View"
            show  all  rows  from  Main_Form 
            (
                ID
                Added_User as "Added User"
                Added_Time as "Added Time"
                Modified_User as "Last Modified User"
                Modified_Time as "Last Modified Time"
                Your_Email_Address as "Your Email Address"
                Feedback_Category as "Feedback Category"
                Comments
            )
            options
            (
                display rows = 100
            )
        }

    }

}
