PluginProbe
Bookit — Booking & Appointment Calendar / 2.6.0.5
Bookit — Booking & Appointment Calendar v2.6.0.5
2.6.0.5 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 All 62 releases
bookit / includes / classes / database / Coupons.php

Coupons.php in Bookit — Booking & Appointment Calendar 2.6.0.5, at includes/classes/database/Coupons.php

35 lines 861 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Bookit\Classes\Database;
4
5 use Bookit\Classes\Vendor\DatabaseModel;
6
7 class Coupons extends DatabaseModel {
8
9 /**
10 * Create Table
11 */
12 public static function create_table() {
13 global $wpdb;
14 require_once ABSPATH . 'wp-admin/includes/upgrade.php';
15
16 $table_name = self::_table();
17 $primary_key = self::$primary_key;
18
19 $sql = "CREATE TABLE IF NOT EXISTS {$table_name} (
20 `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
21 `discount` INT UNSIGNED NOT NULL,
22 `code` VARCHAR(255) NOT NULL,
23 `usage_limit` INT UNSIGNED DEFAULT NULL,
24 `once_per_user` INT UNSIGNED DEFAULT NULL,
25 `services` longtext DEFAULT NULL,
26 `staff` longtext DEFAULT NULL,
27 `created_at` DATETIME NOT NULL,
28 `updated_at` DATETIME NOT NULL,
29 PRIMARY KEY ({$primary_key})
30 ) {$wpdb->get_charset_collate()};";
31
32 maybe_create_table( $table_name, $sql );
33 }
34 }
35