1. The table that will be used for the calendar implementation is “events”.
CREATE TABLE `events` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) DEFAULT NULL, `description` varchar(128) DEFAULT NULL, `start_date` date DEFAULT NULL, `start_time` time DEFAULT NULL, `end_date` date DEFAULT NULL, `end_time` time DEFAULT NULL, `recurrent` varchar(1) DEFAULT NULL, `period` varchar(1) DEFAULT NULL, `users` varchar(10) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
2. Select the table fields that will be used in the application.
Items with “*” are required to create the application. The other fields are only used for information to the agenda.
- Id: Used to identify the record, select the primary key field in this table. (Int (11))
- Title: Used to store the subject of each activity that is displayed in the application. ((Varchar (50))
- Start date: the start date of the activity will be recorded. * (Date or datetime)
- Start Time: Will record the start time of the activity. * (Date or datetime)
- End date: end date of the activity will be recorded. * (Date or datetime)
- End Time: Will record the finish time of the activity. * (Date or datetime)
- Recurrence: Used to state whether the event repeats in a month, week or day. (Int) (1)
- Period: Used to state the type of recurrence reptição: month, week or day. (Int) (1)
Note: If you have a field of type datetime in the database, you can list the options date and time using the same datetime field from the database. The application will take the two values and will concatenate them before saving in the database.
3. After compiling your new calendar application, you will see four types of display: month, week, day and agenda.
4. To add a record, click the area corresponding to the event date and time desired. Will open a simple form, either through inclusion in modal.