/*
 * Author       : aleksandar_86
 * Generated on : 23-Nov-2009 00:34:17
 * Version      : 3.0
 */
application "sanmarco"
{
    type = public
    date format = "dd-MMM-yyyy"
    time zone = "Europe/Belgrade"
    section Home
    {
        form  sanmarco_rezervacija
        {
            displayname  =  "MOTEL - RESTAURANT SAN MARCO - RESERVATION"
            success message  =  "Data Added Successfully!"
            
            must  have  First_Name
            (
                displayname  =  "First Name:"
                type  =  text
            )

            must  have  Last_Name
            (
                displayname  =  "Last Name:"
                type  =  text
            )

            Email
            (
                displayname  =  "Email:"
                type  =  email
            )

            must  have  Phone
            (
                displayname  =  "Phone:"
                type  =  text
            )

            must  have  Date_of_Arrival
            (
                displayname  =  "Date of Arrival:"
                type  =  date
            )

            Time_of_Stay
            (
                displayname  =  "Time of Stay:"
                type  =  number
                width  =  20
                maxchar  =  3
                tooltip  =  "Days"
            )

            must  have  Room
            (
                displayname  =  "Room:"
                type  =  picklist
                values  =  {"Single Room",   "Double Room",   "Rooms With a Double Ded",   "Triple Room"}
            )

            Other_Information
            (
                displayname  =  "Other Information:"
                type  =  textarea
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                        on success
                        {
                            //You can drag and drop tasks from the immediate left pane
                            //Below is the SAMPLE email notification
                            sendmail
                            (
                                To       :  "sanmarco@gradiska.com" 
                                From     :  zoho.adminuserid 
                                Subject  :  "Nova Rezervacija" 
                                Message  :  "<p>First Name: " + input.First_Name + "</p><p>Last Name: " + input.Last_Name + "</p><p>Email: " + input.Email + "</p><p>Phone: " + input.Phone + "</p><p>Date of Arrival: " + input.Date_of_Arrival + "</p><p>Time of Stay: " + input.Time_of_Stay + " days</p><p>Room: " + input.Room + "</p><p>Other Information: " + input.Other_Information + "</p>" 
                            )
                        }
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  sanmarco_rezervacija_View
        {
            displayname = "sanmarco-rezervacija View"
            show  all  rows  from  sanmarco_rezervacija 
            (
                First_Name as "First Name:"
                Last_Name as "Last Name"
                Phone as "Phone:"
                Email as "Email:"
                Date_of_Arrival as "Date of Arrival:"
                Time_of_Stay as "Time of Stay:"
                Room as "Room:"
                Other_Information as "Other Information:"
            )
            filters 
            (
                Date_of_Arrival
                Room
            )
            options
            (
                display rows = 100
            )
        }

    }

}
