Adding the tables and start of menu
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 15 Nov 2016 21:52:20 +0000 (16:52 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 15 Nov 2016 21:52:20 +0000 (16:52 -0500)
Adding Coupons to the glmAssoc menu
Adding table setup script.

setup/adminMenus.php
setup/databaseScripts/UltiSnips/sql.snippets [new file with mode: 0644]
setup/databaseScripts/create_database_V0.0.1.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php [new file with mode: 0644]

index 292a8d9..a2a1604 100644 (file)
  * is named the same as the "glm_action" parameter.
  *
  */
-
+add_submenu_page(
+    'glm-members-admin-menu-members',
+    'Coupons',
+    'Coupons',
+    'glm_members_members',
+    'glm-members-admin-menu-coupons',
+    function(){$this->controller('coupons');}
+);
diff --git a/setup/databaseScripts/UltiSnips/sql.snippets b/setup/databaseScripts/UltiSnips/sql.snippets
new file mode 100644 (file)
index 0000000..864ce4e
--- /dev/null
@@ -0,0 +1,9 @@
+snippet ctable
+-- $1
+CREATE TABLE \{prefix\}$2 (
+    id INT NOT NULL AUTO_INCREMENT,
+    $0,
+    PRIMARY KEY (id)
+);
+
+endsnippet
diff --git a/setup/databaseScripts/create_database_V0.0.1.sql b/setup/databaseScripts/create_database_V0.0.1.sql
new file mode 100644 (file)
index 0000000..d916acf
--- /dev/null
@@ -0,0 +1,66 @@
+-- Gaslight Media Members Database - Coupons Add-On
+-- File Created: 11/15/16
+-- Database Version: 0.0.1
+-- Database Creation Script
+--
+-- This file is called to create a new set of tables for this
+-- add-on for the most recent database version for this add-on.
+--
+-- There should only be one such file in this directory
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+
+
+-- Coupons
+CREATE TABLE {prefix}coupons (
+    id INT NOT NULL AUTO_INCREMENT,
+    status INT NULL,                  -- Status of the Coupon (Active Pending)
+    created DATETIME NULL,            -- Create date
+    updated DATETIME NULL,            -- Update date
+    approved DATETIME NULL,           -- Approved date
+    start_date DATE NULL,               -- Starting date of the coupon
+    end_date DATE NULL,                 -- Ending date of the coupon
+    expire DATE NULL,                 -- Expire date of the coupon
+    name TINYTEXT NULL,               -- Coupon name
+    name_slug TINYTEXT NULL,          -- Coupon name slug
+    ref_type INT NULL,                -- Ref type
+    ref_dest INT NULL,                -- Id from ref type table
+    descr TEXT NULL,                  -- Description of the coupon
+    image TINYTEXT NULL,              -- Coupon image
+    url TINYTEXT NULL,                -- website of the coupon
+    PRIMARY KEY(id),
+    INDEX(ref_type),
+    INDEX(ref_dest),
+    INDEX(start_date),
+    INDEX(end_date)
+);
+
+----
+
+-- Categories
+CREATE TABLE {prefix}categories (
+    id INT NOT NULL AUTO_INCREMENT,
+    name TINYTEXT NULL,               -- Category Name
+    PRIMARY KEY (id),
+    INDEX(name(20))
+);
+
+----
+
+-- Settings
+CREATE TABLE {prefix}settings (
+    id INT NOT NULL AUTO_INCREMENT,
+    notify_to TINYTEXT NULL,          -- To for the notify email
+    notify_from TINYTEXT NULL,        -- From header for notify email
+    notify_message TEXT NULL,         -- Message to add to the notify email
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Data for Settings
+INSERT INTO {prefix}settings
+(id,notify_to,notify_from,notify_message)
+VALUES
+(1, '', '', '');
diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php
new file mode 100644 (file)
index 0000000..03688e7
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * GLM Members Coupons DB Versions
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  dbVersions.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link     http://dev.gaslightmedia.com/
+ */
+
+$glmMembersCouponsDbVersions = array(
+    '0.0.1' => array('version' => '0.0.1', 'tables' => 3),
+);
+