PluginProbe
Bookit — Booking & Appointment Calendar / 1.2
Bookit — Booking & Appointment Calendar v1.2
2.6.0.4 2.6.0.3 2.6.0.2 2.6.0.1 2.6.0 trunk 1.2 1.2.2 1.2.3 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 All 61 releases
bookit / db / appointments.table.php

appointments.table.php in Bookit — Booking & Appointment Calendar 1.2, at db/appointments.table.php

41 lines 966 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 add_action('init', 'stm_bookit_db_install');
4
5 register_activation_hook( STM_BOOKIT_CALENDAR_FILE, 'stm_bookit_db_install' );
6
7 global $bookit_db_version;
8 $bookit_db_version = '1.0';
9
10 function stm_bookit_db_install() {
11 global $wpdb;
12 global $bookit_db_version;
13
14 /**
15 * Create Appoinment Database Table
16 */
17 $table_name = stm_bookit_appointments_table_name($wpdb);
18
19 $charset_collate = $wpdb->get_charset_collate();
20
21 $sql = "CREATE TABLE $table_name (
22 id mediumint(9) NOT NULL AUTO_INCREMENT,
23 appointment_id mediumint(9) NOT NULL,
24 resource_id mediumint(9) NOT NULL,
25 starttime INT NOT NULL,
26 endtime INT NOT NULL,
27 PRIMARY KEY (id)
28 ) $charset_collate;";
29
30 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
31 dbDelta( $sql );
32
33 add_option( 'bookit_db_version', $bookit_db_version );
34
35 /**
36 * Generate User Token
37 */
38 $user_id = get_current_user_id();
39 $token = uniqid($user_id . '|');
40 update_option('bookit_user_' . $user_id, $token);
41 }