/* (Start of comment block) Overview of Functionalities 1. Daily Personal Schedule for a given day. 2. Weekly Personal Schedule for a given week. 3. Personal Schedule details for an activity. 4. Login 5. Enter/Leave 6. Security - User activated 7. Security - System generated 8. Security - User input pers_handle 9. Security - System generated pers_handle 10. Change door colour 11. Turn off lights automatically (when no occupants in house) 12. Intruder alarm (when no occupants in house and intruder tries to enter) 13. Welcome messages from database 14. Tell jokes 15. Leave messages for other users 16. Show messages from other users 17. Light sensor (eg refresh page to check time and changing background colour subsequently) 18. Clock 19. Weather updates ?20. Self Diagnostics? (End of comment block) */ // SCHEDULE table // ------------------------------------------------------- // SUGGEST sch_id activity id // sch_from_id number corresponds to PEOPLE.pers_id // sch_start date ORACLE's date format contains time data // sch_end date " " // sch_activity varchar2(40) brief description of event // sch_notes varchar2(500) additional info, elaboration, etc // ------------------------------------------------------- // the activities of all users are stored in this table. However, upon logon, only the current user's schedule is displayed, ie. you can only see your own schedule. SCHEDULE.sch_from_id is compared to PEOPLE.pers_id // Entries should be deleted after they occur, but this is up to implementation people. =) // ****** 1) Daily Personal Schedule for a given day. // activated: by link or button on door, given option of today (by which the today's date would be passed) or a certain date by entering day, month, year // input: pers_id, date in the format Day Month Year. All integers Day(1-31), Month(1-12), Year(2000-2099). // output: date (as above format), list of [time from sch_start, time from sch_end, sch_activity, link to activity details] // result: page with output sorted by sch_start, period from 00:00hrs - 23:59hrs // future implementation?: Tomorrow; Yesterday; Scrolling by day; // ****** 2) Weekly Personal Schedule for a given week. // activated: by link or button on door, given option of this week (by which the today's date would be passed) or a certain date by entering day, month, year // input: pers_id, any date (of that week) in the format Day Month Year. All integers Day(1-31), Month(1-12), Year(2000-2099). // output: date start (week to start on Monday, as above format), date end, list of [time from sch_start, time from sch_end, sch_activity, link to activity details] // result: page with output sorted by day; within each day, by sch_start, period from 00:00hrs - 23:59hrs (as in daily schedule) // future implementation?: Next week; previous week; scrolling by week; // ****** 3) Personal Schedule details for an activity. // activated: by link generated by daily or weekly schedule for every activity listed // input: sch_id // output: date, time from sch_start, time from sch_end, sch_activity, sch_notes // result: page with details of the activity // future implementation?: Input new activity; // PEOPLE table // ------------------------------------------------------- // pers_id number primary key // pers_handle char(10) used for login; also called user id // pers_first_name varchar2(20) used for greeting // pers_last_name varchar2(20) used for formal purposes // pers_status number(1) 0 for occupant, 1 for friendly, 2 for unwanted // pers_birthdate date used for birthday greeting, see WELCOME // pers_location number(1) 0 for outside, 1 for inside // pers_prefs custom type to be defined as necessary // ------------------------------------------------------- // pers_prefs is a custom type so we can add on to it when we decide what preferences need to be stored. // Eg. pers_prefs.lights_auto_on, pers_prefs.GUI_theme, etc // I've used pers_handle and user id to mean the same thing // ****** 4) login // activated: by clicking a button and entering user id // input: pers_handle // output: whether pers_handle exists in the table, if yes, proceed to provide user functionalities, if not, deny access // result: either welcome page for user or access denied page // future implementation?: password access; // ****** 5) Enter/Leave // activated: by clicking a Enter/Leave button depending on state // input: pers_handle, pers_location // output: update pers_location accordingly // result: changes enter button to leave button or leave button to enter button // future implementation?: list of users in house/outside shown; // ****** 6) Security - User activated // description: to initiate a simulation of someone approaching the door // activated: by clicking a button // input: // output: // result: screen for selection for input method for pers_handle // future implementation?: // ****** 7) Security - System generated // description: to initiate a simulation of someone approaching the door // activated: not activated by user, but "generated" via "screen refresh" in a small frame of the page // input: // output: // result: screen for selection for input method for pers_handle // future implementation?: // ****** 8) Security - User input pers_handle // description: to select the person who's approaching the door // activated: by entering user id // input: pers_handle // output: pers_status // result: appropriate screens for occupant, friendly guest or unwanted people // future implementation?: // ****** 9) Security - System generated pers_handle // description: to select the person who's approaching the door // activated: not activated by user, but "generated" via "screen refresh" in a small frame of the page // input: // output: pers_handle, pers_status // result: screen showing the person generated then appropriate screens for occupant, friendly guest or unwanted people // future implementation?: // ****** 10) Change door colour // activated: by selecting colour from drop down box // input: new colour // output: store colour preference into pers_prefs.Door_Colour // result: screen showing the changed door colour // future implementation?: // ****** 11) Turn off lights automatically (when no occupants in house) // activated: not activated by user, but checked via "screen refresh" in a small frame of the page // input: pers_location of all users // output: on or off depending on whether there is still anyone in the house // result: a frame showing the status by changing the background colour depending on output eg white for lights on, black for lights off // future implementation?: // ****** 12) Intruder alarm (when no occupants in house and intruder tries to enter) // activated: activated when a user that's not an occupant tries to enter if there's noone in the house. // input: pers_handle, pers_location of all users // output: trigger alarm if noone in house, else ignore // result: an intruder alarm screen if triggered // future implementation?: // WELCOME table // ------------------------------------------------------- // wel_id number primary key // wel_txt varchar2(500) welcome message text // wel_type number(1) 0 for generic, 1 for birthday, 2 for holidays // wel_date date only for holidays // ------------------------------------------------------- // On normal days, a random generic message is displayed. // eg "Good $time_of_day, $name!", "Lovely day, isn't it?" // On birthdays, a random birthday greeting // eg "Happy $age, $name!", "Happy Birthday, and more to come!" // On holidays, relevant seasons greetings // eg "Merry Christmas!", "Happy New Year!" // ****** 13) Welcome messages from database // activated: when user logs in and is in the house (i.e. also activated when user clicks enter) // input: wel_type (always 0 for current use) // output: wel_txt // result: screen showing the randomly generated welcome message from the database // future implementation?: customised message checking birthday and holidays; // JOKE table // ------------------------------------------------------- // joke_id number primary key // joke_txt varchar2(500) joke text // joke_cat number(1) joke categories. 0 for political, 1 for lightbulbs, etc // ------------------------------------------------------- // Users can subscribe to preferred categories, storing in prefs. Then only jokes from those categories will be displayed. // ****** 14) Tell jokes // activated: when user clicks on a button // input: // output: joke_txt // result: screen showing the randomly generated joke from the database // future implementation?: generating based on category of the joke; // MESSAGE table // ------------------------------------------------------- // msg_from_id number corresponds to PEOPLE.pers_id // msg_to_id number " " // msg_time date date/time stamp // msg_txt varchar2(500) message text // ------------------------------------------------------- // Similar to Scheduler. User IDs are checked to show messages to the right person. Message deleted after read. It's really up to the implementation people. If they want to give the end-user a choice, also can. Can add a msg_read field if needed. // ****** 15) Leave messages for other users // activated: when user clicks button and comes to a screen with a form to enter pers_handle of other person and message // input: pers_handle of other person, msg_txt // output: enter input into database together with current date/time and pers_id of current user // result: screen saying message left for user // future implementation?: // ****** 16) Show messages from other users // activated: when user login and enters // input: pers_id of current user // output: msg_from_id translate to pers_handle of person from, msg_time and msg_txt // result: shown on same screen as welcome message // future implementation?: // NON DATABASE FUNCTIONS // ****** 17) Light sensor (eg refresh page to check time and changing background colour subsequently) // activated: not activated by user, but checked via "screen refresh" in a small frame of the page // input: current time // output: on or off depending on time, eg 7am-7pm off, 7pm to 7am on lights // result: a frame showing the status by changing the background colour depending on output eg white for lights on, black for lights off // future implementation?: // ****** 18) Clock // activated: not activated by user, shown all the time on the door // input: // output: current date/time // result: somewhere on the door showing the current date/time // future implementation?: // ****** 19) Weather updates // activated: by clicking on a link or button // input: // output: weather report of singapore from some external website (eg yahoo) // result: screen showing the weather report // future implementation?: weather for other cities/places // ****** 20) Self Diagnostics // KIV // ******************************************************************* // *********** PHP Controller Config (work-in-progress) ************** // ******************************************************************* /* All GUI Must Include a html form control with name "Function" and specify the Function Name for it. The Function Name must be one of the following: */ $IDEA['Functions']['IDEA_Welcome'] = 'IDEA_Welcome' $IDEA['IDEA_Welcome']['Command'] = 'java IDEAWelcome.Welcome'; $IDEA['IDEA_Welcome']['Params'] = 'IDEA_LoginName IDEA_Password'; $IDEA['IDEA_Welcome']['Returns'] = 'IDEA_NAME_EXISTS IDEA_NAME_NOT_EXISTS'; $IDEA['IDEA_Welcome']['Pass'] = 'IDEA_LoginName'; $IDEA['IDEA_Welcome']['Output'] = 'welcome.html wrongid.html'; /* //Sample INI entry $IDEA['Functions']['IDEA_CheckName'] = 'IDEA_CheckName' $IDEA['IDEA_CheckName']['Command'] = 'java CheckName'; $IDEA['IDEA_CheckName']['Params'] = 'IDEA_LoginName IDEA_Password'; $IDEA['IDEA_CheckName']['Returns'] = 'IDEA_CHECKNAME_EXISTS IDEA_CHECKNAME_NOT_EXISTS'; $IDEA['IDEA_CheckName']['Pass'] = 'IDEA_LoginName'; $IDEA['IDEA_CheckName']['Output'] = 'welcome.html wrongid.html'; */