/*
 * Author       : futrera
 * Generated on : 22-Nov-2009 22:12:24
 * Version      : 3.0
 */
application "Suscripciones"
{
    type = public
    date format = "dd-MMM-yyyy"
    time zone = "America/Cancun"
    section Home
    {
        form  formulario
        {
            
            must  have  Nombre
            (
                type  =  text
            )

            Direcci_n
            (
                displayname  =  "Dirección"
                type  =  text
            )

            Tel_fono
            (
                displayname  =  "Teléfono"
                type  =  text
            )

            must  have  Correo
            (
                type  =  email
            )

            Comentarios
            (
                type  =  textarea
            )

            must  have  Desea_suscribirse_al_Bolet_n
            (
                displayname  =  "¿Desea suscribirse al Boletín?"
                type  =  radiobuttons
                values  =  {"Si",   "No"}
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                        on success
                        {
                            sendmail
                            (
                                To       :  "futrera@gmail.com" 
                                From     :  zoho.adminuserid 
                                Subject  :  "Datos de formulario" 
                                Message  :  input.Nombre + input.Desea_suscribirse_al_Bolet_n + input.formdata 
                            )
                        }
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

    }

    section datos
    {
        list  formulario_View
        {
            displayname = "formulario View"
            show  all  rows  from  formulario 
            (
                Nombre
                Direcci_n as "Dirección"
                Tel_fono as "Teléfono"
                Correo
                Comentarios
                Desea_suscribirse_al_Bolet_n as "¿Desea suscribirse al Boletín?"
            )
            filters 
            (
                Desea_suscribirse_al_Bolet_n
            )
            options
            (
                display rows = 100
            )
        }

    }

}
