| Main Page |
| General |
|---|
|
Basic Use Custom Formats Extra Info Credits |
| Modules |
|
Address Book Datebook DOC List Memo Pad MobileDB SmallBASIC Todo |
| Examples |
|
Bookmark Test Spade Twister |
| SourceForge |
|
Download Project Page Mailing Lists Bug Reporting |
This class uses a completely different for for storing information about events. It is supposed to make things easier, but might be a bit complex to learn at first.
If you install a database created with this class onto your handheld, it will overwrite the one that already exists on your handheld. This is because a new database will have the same name as the current database on your handheld and you can't change the name of the database otherwise the application won't work. This is obviously irritating -- please keep this in mind. An ideal use for this PHP class would be for talking to a conduit, where the conduit would upload the current data, the server would parse it and add/modify/delete entries with this class, the server would send the modified file back to the conduit, and the conduit would replace the device's database with the modified one.
| include 'php-pdb.inc'; include 'modules/datebook.inc'; |
Since a datebook has a specified type, creator, and name, the class takes care of knowing what they are. Creation of a new datebook is a snap.
| $DB = new PalmDatebook(); |
This is the same as the base class. See Basic Use for more information.
This is the same as the base class. See Basic Use for more information.
The data for the GetRecordRaw and the data returned from SetRecordRaw is a specially formatted array, as detailed below. Optional values can be set to '' or not defined. If an optional value is anything else (including zero), it is considered to be set.
| Key | Example | Description |
|---|---|---|
| StartTime | 2:00 | Starting time of the event, 24 hour format |
| Date | 2001-01-23 | Year, month, and day of the event |
| Description | Eat At Joe's | The title or the name of the event |
| EndTime | 13:00 | [Optional] Ending time of the event, 24 hour format. |
| Alarm | 5d | [Optional] A number of units before the event to sound an alarm (m = minutes, h = hours, d = days) |
| Repeat | Special | [Optional] An array detailing how the event should repeat |
| Note | Order a burger and fries | [Optional] A note for the event |
| Exceptions | Special | [Optional] Exceptions when the event should not happen |
| WhenChanged | 1 | [Optional] True if the "when info" for the event has changed. |
| Flags | 3 | [Optional] User flags for the event |
EndTime must happen at or after StartTime. The time the event occurs may not pass midnight (0:00). If the event doesn't have a time (an all-day event), use '' or do not define StartTime and EndTime.
Exceptions are specified in an array consisting of dates the event occured and did not happen or should not be shown. Dates are in the format YYYY-MM-DD, just like the Date attribute of the record.
Repeating events are special, and the Repeat attribute of the record is set to an array.
"I'm not sure what this is, but the Datebook app appears to perform some hairy calculations involving this."
There are also two mysterious 'unknown' fields for the repeat event and they will be populated if the database is loaded from a file. They will otherwise default to 0. They are 'unknown1' and 'unknown2'.
| // Create an instance of the class $pdb = new PalmDatebook(); // Create a repeating event that happens every other Friday. // I want it to be an all-day event that says "Pay Day!" $Repeat = array( "Type" => PDB_DATEBOOK_REPEAT_WEEKLY, "Frequency" => 2, "Days" => "5", "StartOfWeek" => 0 ); $Record = array( "Date" => "2001-11-2", "Description" => "Pay Day!", "Repeat" => $Repeat ); // Add the record to the datebook $pdb->SetRecordRaw($Record); // Advance to the next record just in case we want to add more events $pdb->GoToRecord("+1"); |