/*
 * Author       : ellyssa
 * Generated on : 23-Nov-2009 09:20:35
 * Version      : 3.0
 */
application "Library Reference Statistical Analysis"
{
    type = public
    date format = "dd-MMM-yyyy"
    time zone = "America/Los_Angeles"
    section Home
    {
        form  Daily_Reference_Stats
        {
            displayname  =  "Daily Reference Stats"
            
            must  have  Day
            (
                type  =  picklist
                values  =  {"Monday",   "Tuesday",   "Wednesday",   "Thursday",   "Friday",   "Saturday",   "Sunday"}
            )

            must  have  Date_1
            (
                displayname  =  "Date"
                type  =  date
            )

            must  have  Time
            (
                type  =  picklist
                values  =  {"9:00-10:00",   "10:00-11:00",   "11:00-12:00",   "12:00-1:00",   "1:00-2:00",   "2:00-3:00",   "3:00-4:00",   "4:00-5:00",   "5:00-6:00",   "6:00-7:00",   "7:00-8:00",   "8:00-9:00"}
            )

            must  have  Patron_Location
            (
                displayname  =  "Patron Location"
                type  =  radiobuttons
                values  =  {"In-Person",   "Telephone",   "IM"}
            )

            must  have  Question_Type
            (
                displayname  =  "Question Type"
                type  =  radiobuttons
                values  =  {"Directional (Where are the bathrooms?)",   "Informational (What are the library hours?)",   "Research (How do I find resources on...?)"}
            )

            plain
            (
                type  =  plaintext
                value = "If the question is a research one, please type the query in the box below so that we can gain a sense of what types of questions we are being asked at the desk.&nbsp; Thanks!\n"
            )

            Research_Questions
            (
                displayname  =  "Research Questions"
                type  =  textarea
            )

            actions
            {
                on add
                {
                    on load
                    {
                        input.Date_1 = zoho.currentdate;
                    }
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  Daily_Reference_Stats_View
        {
            displayname = "Daily Reference Stats View"
            show  all  rows  from  Daily_Reference_Stats 
            (
                Day
                Date_1 as "Date 1"
                Time
                Patron_Location as "Patron Location"
                Question_Type as "Question Type"
                Research_Questions as "Research Questions"
            )
            options
            (
                display rows = 100
            )
        }

        list  Thursday_August_9th_Report
        {
            displayname = "Thursday, August 9th Report"
            show  all  rows  from  Daily_Reference_Stats [(Date_1 == '09-Aug-2007')]
            (
                Day
                Date_1 as "Date"
                Time
                Patron_Location as "Patron Location"
                Question_Type as "Question Type"
                Research_Questions as "Research Questions"
            )
            filters 
            (
                Day
                Time
                Patron_Location
                Question_Type
            )
            options
            (
                display rows = 100
            )
        }

        list  IM_Questions_Only
        {
            displayname = "IM Questions Only"
            show  all  rows  from  Daily_Reference_Stats [Patron_Location == "IM"]
            (
                Day
                Date_1 as "Date"
                Time
                Patron_Location as "Patron Location"
                Question_Type as "Question Type"
                Research_Questions as "Research Questions"
            )
            filters 
            (
                Day
                Time
                Patron_Location
                Question_Type
            )
            options
            (
                display rows = 100
            )
        }

        list  Research_Questions_Only
        {
            displayname = "Research Questions Only"
            show  all  rows  from  Daily_Reference_Stats [Question_Type == "Research (How do I find resources on...?)"]
            (
                Day
                Date_1 as "Date"
                Time
                Patron_Location as "Patron Location"
                Question_Type as "Question Type"
                Research_Questions as "Research Questions"
            )
            filters 
            (
                Day
                Time
                Patron_Location
                Question_Type
            )
            options
            (
                display rows = 100
            )
        }

        list  Copy_of_Thursday_August_9th_Report
        {
            displayname = "Copy of Thursday, August 9th Report"
            show  all  rows  from  Daily_Reference_Stats [(Date_1 == '09-Aug-2007')]
            (
                Day
                Date_1 as "Date"
                Time
                Patron_Location as "Patron Location"
                Question_Type as "Question Type"
                Research_Questions as "Research Questions"
            )
            filters 
            (
                Day
                Time
                Patron_Location
                Question_Type
            )
            options
            (
                display rows = 100
            )
        }

    }

}
