/*
 * Author       : gabrielcoch
 * Generated on : 24-Nov-2009 16:49:00
 * Version      : 3.0
 */
application "FAST FOOD TRACKER (V2)"
{
    type = public
    date format = "dd-MMM-yyyy"
    time zone = "America/Los_Angeles"
    section File
    {
        form  Franchises
        {
            captcha = true
            success message  =  "Data Added Successfully!"
            
            column
            {
                must  have  Company
                (
                    type  =  picklist
                    values  =  {"McDONALD'S",   "BURGER KING",   "WENDY'S"}
                )

                must  have  FastFoodState
                (
                    displayname  =  "State"
                    type  =  picklist
                    values  =  State.Abbreviation
                    sortorder  =  ascending
                )

                must  have  City
                (
                    type  =  text
                )

            }
            column
            {
                must  have  Latitude
                (
                    type  =  decimal
                    width  =  20
                    decimalplace  =  6
                )

                must  have  Longitude
                (
                    type  =  decimal
                    width  =  20
                    decimalplace  =  6
                )

            }
            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

    }

    section Edit1
    {
        displayname = "Edit"
        list  Franchises_View
        {
            displayname = "Franchises View"
            show  all  rows  from  Franchises 
            (
                Company
                Latitude
                Longitude
                City
                FastFoodState as "State"
            )
            filters 
            (
                Company
                FastFoodState
            )
            options
            (
                display rows = 100
            )
        }

        list  South_Eastern_US
        {
            displayname = "South Eastern US"
            show  all  rows  from  Franchises [(((((((FastFoodState == "FL" || FastFoodState == "GA") || FastFoodState == "MS") || FastFoodState == "LA") || FastFoodState == "AL") || FastFoodState == "SC") || FastFoodState == "NC") || FastFoodState == "TN")]
            (
                Company
                Latitude
                Longitude
                City
                FastFoodState as "State"
            )
            filters 
            (
                Company
                FastFoodState
            )
            sort by
            (
                FastFoodState   ascending
            )
            options
            (
                display rows = 100
            )
        }

    }

    section View
    {
        htmlpage Fast_Food_Dashboard()
displayname = "Fast Food Dashboard"
content
        <%{%>
<div style="text-align: center;"><font color="#666666" size="1"><font size="4"><strong>FAST FOOD NATION</strong></font></font><br />
<font color="#666666" size="1"><em> </em></font></div>
<img width='800' height='600' title='true' description='true' src='http://db.zoho.com:80/ZohoDBChart.png?OBJID=22749000000014111&WIDTH=800&HEIGHT=600&TITLE=false&DESCRIPTION=true&STANDALONE=true&ZDB_THEME_NAME=brown'> </img>        <%}%>

    }

    section Lookups
    {
        hide = true
        form  State
        {
            
            StateName
            (
                displayname  =  "Name"
                type  =  text
            )

            Abbreviation
            (
                type  =  text
                maxchar  =  2
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  State_View
        {
            displayname = "State View"
            show  all  rows  from  State 
            (
                StateName as "Name"
                Abbreviation
            )
            options
            (
                display rows = 100
            )
        }

    }

    customize
    {
        layout = "drop down menu"
        base theme = "professional"
        color = "blue"
    }
}
