More user elements working, more corrections to database abstract, and database updates.
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 26 Jan 2015 14:05:56 +0000 (09:05 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 26 Jan 2015 14:05:56 +0000 (09:05 -0500)
31 files changed:
activate.php
classes/data/dataAccommodationTypes.php [new file with mode: 0644]
classes/data/dataCategories.php [new file with mode: 0644]
controllers/admin.php
css/admin.css
lib/GlmDataAbstract/DataAbstract.php
misc/databaseScripts/create_database_V0.1.sql
misc/smarty/templates_c/06926788f51c1a5a54be2a368556f9c37e2780da.file.badAction.html.php
misc/smarty/templates_c/081a36d97cdf30d438a1e104c26a275acc180da0.file.index.html.php
misc/smarty/templates_c/15f83071407dddb0b3c23ae1a70b66cefbd681db.file.header.html.php
misc/smarty/templates_c/1be35689c5d30d774f40ebc45e387f5f95c45e90.file.index.html.php
misc/smarty/templates_c/25c8610e0e0bacafec3046a296066e9f8eceedae.file.member.html.php
misc/smarty/templates_c/3ec5bcbe581d6335e06bc6c9474f73121a83d59b.file.header.html.php
misc/smarty/templates_c/47fb9b803e7138d215645f3c977b0b1dc2a9e718.file.index.html.php
misc/smarty/templates_c/4c287ca0e4946b3d644e61950c851e98e8906d49.file.list.html.php
misc/smarty/templates_c/50e78f1400d6db96c588c737669426ab57397d1d.file.footer.html.php
misc/smarty/templates_c/60cbe99d19bbec013cbca4d9344f2fd4a4152f52.file.index.html.php
misc/smarty/templates_c/6b21e44674b437b1c7d4844f49a7ab41316a5694.file.header.html.php
misc/smarty/templates_c/c74bd17240f8892f8955e8bedbedd434341aeca9.file.header.html.php
models/admin/configure/accommodationTypes.php [new file with mode: 0644]
models/admin/configure/categories.php [new file with mode: 0644]
models/admin/configure/cities.php
models/admin/configure/regions.php
views/admin/configure/accommodationTypes.html [new file with mode: 0644]
views/admin/configure/categories.html [new file with mode: 0644]
views/admin/configure/cities.html
views/admin/configure/header.html
views/admin/configure/memberTypes.html
views/admin/configure/regions.html
views/admin/member/index.html
views/admin/members/list.html

index ef29d27..e16009a 100644 (file)
@@ -42,7 +42,7 @@ class glmMembersPluginActivate extends glmPluginSupport
      * @access private
      */
     private $dbVersions = array(
-        '0.1' => array('version' => '0.1', 'tables' => 22)
+        '0.1' => array('version' => '0.1', 'tables' => 24)
     );
 
     /**
diff --git a/classes/data/dataAccommodationTypes.php b/classes/data/dataAccommodationTypes.php
new file mode 100644 (file)
index 0000000..76b7633
--- /dev/null
@@ -0,0 +1,157 @@
+<?php
+
+/**
+ * GLM Member-DB WordPress Plugin
+ * Accommodation Types data class
+ *
+ * PHP version 5.3
+ *
+ * @category Data
+ * @package  GLM Member-DB
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  SVN: $Id: dataMemberType.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ */
+
+/**
+ * EventManagementDataAccommodationTypes class
+ *
+ * PHP version 5
+ *
+ * @category Data
+ * @package EventManagement
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ *          @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          Exp $
+ * @link http://www.visitgreatlakesbay.org/
+ */
+abstract class GlmDataAccommodationTypes extends GlmDataAbstract
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+    /**
+     * Field definitions
+     *
+     * @var $ini
+     * @access public
+     */
+    public $table;
+
+    /**
+     * Field definitions
+     *
+     * 'type' is type of field as defined by the application
+     * text Regular text field
+     * pointer Pointer to an entry in another table
+     * 'filters' is the filter name for a particular filter ID in PHP filter
+     * functions
+     * See PHP filter_id()
+     *
+     * 'use' is when to use the field
+     * l = List
+     * g = Get
+     * n = New
+     * i = Insert
+     * e = Edit
+     * u = Update
+     * d = Delete
+     * a = All
+     *
+     * @var $ini
+     * @access public
+     */
+    public $fields = false;
+
+    /**
+     * Constructor
+     *
+     * @param object $d
+     *            database connection
+     *
+     * @return void
+     * @access public
+     */
+    function __construct ($wpdb, $config)
+    {
+        parent::__construct($wpdb, $config);
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+        /*
+         * Table Name
+         */
+        $this->table = GLM_MEMBERS_PLUGIN_DB_PREFIX . 'accommodation_types';
+
+        /*
+         * Table Data Fields
+         */
+        $this->fields = array(
+
+                'id' => array(
+                        'field' => 'id',
+                        'type' => 'integer',
+                        'view_only' => true,
+                        'use' => 'a'
+                ),
+
+                // Facility Type
+                'facility_type' => array (
+                        'field' => 'facility_type',
+                        'type' => 'list',
+                        'list' => $this->config['facility_type'],
+                        'required' => true,
+                        'use' => 'a'
+                ),
+
+                // Name
+                'name' => array(
+                        'field' => 'name',
+                        'type' => 'text',
+                        'required' => true,
+                        'unique' => true,
+                        'use' => 'a'
+                ),
+
+                // Description
+                'descr' => array(
+                        'field' => 'descr',
+                        'type' => 'text',
+                        'use' => 'a'
+                ),
+
+                // Short Description
+                'short_descr' => array(
+                        'field' => 'short_descr',
+                        'type' => 'text',
+                        'use' => 'a'
+                )
+
+
+        );
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+            glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table);
+        }
+
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/classes/data/dataCategories.php b/classes/data/dataCategories.php
new file mode 100644 (file)
index 0000000..66c8ee5
--- /dev/null
@@ -0,0 +1,161 @@
+<?php
+
+/**
+ * GLM Member-DB WordPress Plugin
+ * Categories data class
+ *
+ * PHP version 5.3
+ *
+ * @category Data
+ * @package  GLM Member-DB
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  SVN: $Id: dataMemberType.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ */
+
+/**
+ * EventManagementDataCategories class
+ *
+ * PHP version 5
+ *
+ * @category Data
+ * @package EventManagement
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ *          @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          Exp $
+ * @link http://www.visitgreatlakesbay.org/
+ */
+abstract class GlmDataCategories extends GlmDataAbstract
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+    /**
+     * Field definitions
+     *
+     * @var $ini
+     * @access public
+     */
+    public $table;
+
+    /**
+     * Field definitions
+     *
+     * 'type' is type of field as defined by the application
+     * text Regular text field
+     * pointer Pointer to an entry in another table
+     * 'filters' is the filter name for a particular filter ID in PHP filter
+     * functions
+     * See PHP filter_id()
+     *
+     * 'use' is when to use the field
+     * l = List
+     * g = Get
+     * n = New
+     * i = Insert
+     * e = Edit
+     * u = Update
+     * d = Delete
+     * a = All
+     *
+     * @var $ini
+     * @access public
+     */
+    public $fields = false;
+
+    /**
+     * Constructor
+     *
+     * @param object $d
+     *            database connection
+     *
+     * @return void
+     * @access public
+     */
+    function __construct ($wpdb, $config)
+    {
+        parent::__construct($wpdb, $config);
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+        /*
+         * Table Name
+         */
+        $this->table = GLM_MEMBERS_PLUGIN_DB_PREFIX . 'categories';
+
+        /*
+         * Table Data Fields
+         */
+        $this->fields = array(
+
+                'id' => array(
+                        'field' => 'id',
+                        'type' => 'integer',
+                        'view_only' => true,
+                        'use' => 'a'
+                ),
+
+                // Name
+                'name' => array(
+                        'field' => 'name',
+                        'type' => 'text',
+                        'required' => true,
+                        'unique' => true,
+                        'use' => 'a'
+                ),
+
+                // Parent
+                'parent' => array(
+                        'field' => 'parent',
+                        'type' => 'pointer',
+                            'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'categories',
+                            'p_field' => 'name',
+                            'p_orderby' => 'name',
+                            'p_blank' => true,
+
+                        'required' => false,
+                        'use' => 'a'
+                ),
+
+                // Description
+                'descr' => array(
+                        'field' => 'descr',
+                        'type' => 'text',
+                        'use' => 'a'
+                ),
+
+                // Short Description
+                'short_descr' => array(
+                        'field' => 'short_descr',
+                        'type' => 'text',
+                        'use' => 'a'
+                )
+
+
+        );
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+            glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table);
+        }
+
+    }
+}
+
+?>
\ No newline at end of file
index 67b05eb..5347f07 100644 (file)
@@ -44,8 +44,10 @@ $GLOBALS['glmMembersAdminValidActions'] = array(
         'configure' => array(
                 'index',
                 'memberTypes',
+                'categories',
                 'cities',
-                'regions'
+                'regions',
+                'accommodationTypes'
         ),
         'error' => array(
                 'index',
index dcaf052..420ff1f 100644 (file)
 }
 
 /* Admin table additions */
+.glm-admin-table {
+    border: 3px #ddd solid !important;
+}
+.glm-admin-table thead th{
+    border-bottom: 3px #ddd solid !important;
+    font-size: 15px;
+    font-weight: bold;
+}
 .glm-table-fieldname {
     text-align: left;
     vertical-align: top;
@@ -73,6 +81,9 @@
 }
 
 /* Overlay dialog box */
+.glm-dialog-box {
+    display: none;
+}
 .ui-dialog {
     background: #fff;
     border: 1px black solid;
index f16ec2c..ac6c02a 100755 (executable)
@@ -570,12 +570,22 @@ abstract class GlmDataAbstract
             $field_val = 'COALESCE(sum('.$field_val.'), 0) ';
         }
 
-        $field = "(
-            SELECT ".$field_val."
-              FROM ".$f['p_table']."
-                   $from
-             WHERE $where
-        ) ";
+        // Check for "as" option
+        $as = $f['field'];
+        if (isset($f['as']) && $f['as'] != '') {
+            $as = $f['as'];
+        }
+
+        $field = "
+            COALESCE(
+                (
+                SELECT ".$field_val."
+                  FROM ".$f['p_table']."
+                       $from
+                 WHERE $where
+                ), null
+            ) AS $as
+        ";
 
         return $field;
     }
@@ -604,7 +614,7 @@ abstract class GlmDataAbstract
     {
 
         // If the operation is Edit then we need to also get the options for select (unless it's p_static)
-        if ($forEdit && !($f['p_static'] === true)) {
+        if ($forEdit && !(isset($f['p_static']) && $f['p_static'] === true)) {
 
             // Get current value of pointer
             if ($id) {
@@ -613,8 +623,8 @@ abstract class GlmDataAbstract
                     FROM ".$this->table."
                     WHERE $idfield = $id
                 ";
-                $d = $this->wpdb->get_results($sql, ARRAY_A);
-                $p_value = $d['id'];
+                $p_data = $this->wpdb->get_row($sql, ARRAY_A);
+                $p_value = $p_data['id'];
             }
 
             // Get pointer options from specified table
@@ -625,7 +635,7 @@ abstract class GlmDataAbstract
 
             // Get picklist options from other table
             $where = '';
-            if ($f['p_where']) {
+            if (isset($f['p_where']) && $f['p_where']) {
                 $where = 'WHERE '.$f['p_where'];
             }
 
@@ -657,7 +667,7 @@ abstract class GlmDataAbstract
                 $pick_list[0] = array(\r
                     'value'   => '',\r
                     'name'    => $blankText,\r
-                    'default' => ($p['p_id'] == '')\r
+                    'default' => (!$p_value)\r
                 );\r
             }
 
@@ -785,10 +795,9 @@ abstract class GlmDataAbstract
         // Build pick select table
         $pick_select = false;
         $selected_name = '';
+        $pick_list = array();
         if (count($p_list) > 0) {
 
-            $pick_list = array();
-
             // Deal with optional blank entry
             $blankText = '';
             if (isset($f['p_blank_text']) && $f['p_blank_text'] != '') {
index 91a93fe..fe33169 100644 (file)
@@ -6,6 +6,18 @@
 -- To permit each query below to be executed separately,
 -- all queries must be separated by a line with ----
 
+CREATE TABLE {prefix}members (
+  id INT NOT NULL AUTO_INCREMENT,
+  active BOOLEAN NULL,
+  date_created TIMESTAMP NULL,
+  name TINYTEXT NULL,
+  data_records INT NULL,
+  PRIMARY KEY (id),
+  INDEX(name(20))
+);
+
+----
+
 CREATE TABLE {prefix}member_type (
   id INT NOT NULL AUTO_INCREMENT,
   name TINYTEXT NULL,
@@ -34,11 +46,11 @@ CREATE TABLE {prefix}regions (
 
 ----
 
-CREATE TABLE {prefix}members (
+CREATE TABLE {prefix}member_data (
   id INT NOT NULL AUTO_INCREMENT,
+  member INT NULL,
   status INT NULL,
   member_type INT NULL,
-  name TINYTEXT NULL,
   descr TEXT NULL,
   short_descr TINYTEXT NULL,
   addr1 TINYTEXT NULL,
@@ -56,17 +68,23 @@ CREATE TABLE {prefix}members (
   logo TINYTEXT NULL,
   cc_type INT NULL,
   join_date DATE NULL,
-  notex TEXT NULL,
+  notes TEXT NULL,
   create_time TIMESTAMP NULL,
   modify_time TIMESTAMP NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(status),
+  INDEX(city),
+  INDEX(zip(10)),
+  INDEX(lat),
+  INDEX(lon),
+  INDEX(region)
 );
 
 ----
 
 CREATE TABLE {prefix}locations (
   id INT NOT NULL AUTO_INCREMENT,
-  status INT NULL,
+  active BOOLEAN NULL,
   location_type INT NULL,
   member INT NULL,
   name TINYTEXT NULL,
@@ -88,14 +106,20 @@ CREATE TABLE {prefix}locations (
   notes TEXT NULL,
   create_time TIMESTAMP NULL,
   modify_time TIMESTAMP NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(name(20)),
+  INDEX(city),
+  INDEX(zip(10)),
+  INDEX(lat),
+  INDEX(lon),
+  INDEX(region)
 );
 
 ----
 
 CREATE TABLE {prefix}facilities (
   id INT NOT NULL AUTO_INCREMENT,
-  status INT NULL,
+  active BOOLEAN NULL,
   facility_type INT NULL,
   location INT NULL,
   name TINYTEXT NULL,
@@ -116,15 +140,20 @@ CREATE TABLE {prefix}facilities (
   notes TEXT NULL,
   create_time TIMESTAMP NULL,
   modify_time TIMESTAMP NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(name(20)),
+  INDEX(city),
+  INDEX(zip(10)),
+  INDEX(lat),
+  INDEX(lon)
 );
 
 ----
 
 CREATE TABLE {prefix}activties (
   id INT NOT NULL AUTO_INCREMENT,
-  status INT NULL,
-  activity_type TINYTEXT NULL,
+  active BOOLEAN NULL,
+  activity_type INT NULL,
   facility INT NULL,
   name TINYTEXT NULL,
   descr TEXT NULL,
@@ -136,15 +165,33 @@ CREATE TABLE {prefix}activties (
   modify_time TIMESTAMP NULL,
   ref_type INT NULL,
   ref_dest INT NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(activity_type),
+  INDEX(name(20)),
+  INDEX(ref_type),
+  INDEX(ref_dest)
+);
+
+----
+
+CREATE TABLE {prefix}accommodation_types (
+  id INT NOT NULL AUTO_INCREMENT,
+  facility_type INT NULL,
+  name TINYTEXT NULL,
+  descr TEXT NULL,
+  short_descr TINYTEXT NULL,
+  PRIMARY KEY (id),
+  INDEX(facility_type),
+  INDEX(name(20))
 );
 
 ----
 
 CREATE TABLE {prefix}accommodations (
   id INT NOT NULL AUTO_INCREMENT,
-  status INT NULL,
+  active BOOLEAN NULL,
   name TINYTEXT NULL,
+  accommodation_type INT NULL,
   descr TEXT NULL,
   short_descr TINYTEXT NULL,
   quant INT NULL,
@@ -153,14 +200,18 @@ CREATE TABLE {prefix}accommodations (
   year_round TINYINT(1) NULL,
   ref_type INT NULL,
   ref_dest INT NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(accommodation_type),
+  INDEX(name(20)),
+  INDEX(ref_type),
+  INDEX(ref_dest)
 );
 
 ----
 
 CREATE TABLE {prefix}golf (
   id INT NOT NULL AUTO_INCREMENT,
-  status INT NULL,
+  active BOOLEAN NULL,
   name TINYTEXT NULL,
   descr TEXT NULL,
   short_descr TINYTEXT NULL,
@@ -173,15 +224,31 @@ CREATE TABLE {prefix}golf (
   reservation_url TINYTEXT NULL,
   ref_type INT NULL,
   ref_dest INT NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(name(20)),
+  INDEX(ref_type),
+  INDEX(ref_dest)
+);
+
+----
+
+CREATE TABLE {prefix}restaurant_types (
+  id INT NOT NULL AUTO_INCREMENT,
+  active TINYINT(1) NULL,
+  name TINYTEXT NULL,
+  descr TEXT NULL,
+  short_descr TINYTEXT NULL,
+  PRIMARY KEY (id),
+  INDEX(name(20))
 );
 
 ----
 
 CREATE TABLE {prefix}restaurants (
   id INT NOT NULL AUTO_INCREMENT,
-  status INT NULL,
+  active BOOLEAN NULL,
   name TINYTEXT NULL,
+  restaurant_type INT NULL,
   descr TEXT NULL,
   short_descr TINYTEXT NULL,
   menu TEXT NULL,
@@ -195,14 +262,18 @@ CREATE TABLE {prefix}restaurants (
   notes TEXT NULL,
   ref_type INT NULL,
   ref_dest INT NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(restaurant_type),
+  INDEX(name(20)),
+  INDEX(ref_type),
+  INDEX(ref_dest)
 );
 
 ----
 
 CREATE TABLE {prefix}meals (
   id INT NOT NULL AUTO_INCREMENT,
-  status INT NULL,
+  active BOOLEAN NULL,
   name TINYTEXT NULL,
   descr TEXT NULL,
   short_descr TINYTEXT NULL,
@@ -248,16 +319,17 @@ CREATE TABLE {prefix}meals (
   sat_end_time TIME NULL,
   sat_res_req TINYINT(1) NULL,
   restaurant INT NULL,
-  PRIMARY KEY (id)
+  ref_type INT NULL,
+  ref_dest INT NULL,
+  PRIMARY KEY (id),
+  INDEX(name(20))
 );
 
 ----
 
 CREATE TABLE {prefix}contacts (
   id INT NOT NULL AUTO_INCREMENT,
-  status INT NULL,
-  ref_type INT NULL,
-  ref_dest INT NULL,
+  active BOOLEAN NULL,
   fname TINYTEXT NULL,
   lname TINYTEXT NULL,
   contact_type INT NULL,
@@ -283,7 +355,16 @@ CREATE TABLE {prefix}contacts (
   notes TEXT NULL,
   create_time TIMESTAMP NULL,
   modify_time TIMESTAMP NULL,
-  PRIMARY KEY (id)
+  ref_type INT NULL,
+  ref_dest INT NULL,
+  PRIMARY KEY (id),
+  INDEX(fname(20)),
+  INDEX(lname(20)),
+  INDEX(city),
+  INDEX(zip(10)),
+  INDEX(lat),
+  INDEX(lon),
+  INDEX(email(20))
 );
 
 ----
@@ -295,7 +376,8 @@ CREATE TABLE {prefix}amenities (
   descr TEXT NULL,
   short_descr TINYTEXT NULL,
   facility_type INT NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(name(20))
 );
 
 ----
@@ -310,23 +392,28 @@ CREATE TABLE {prefix}social_media (
 
 ----
 
-CREATE TABLE {prefix}social_media_member (
+CREATE TABLE {prefix}social_media_ref (
   id INT NOT NULL AUTO_INCREMENT,
   ref_type INT NULL,
   ref_dest INT NULL,
   social_media INT NULL,
   url TINYTEXT NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(ref_type),
+  INDEX(ref_dest),
+  INDEX(social_media)
 );
 
 ----
 
-CREATE TABLE {prefix}amenity_member (
+CREATE TABLE {prefix}amenity_ref (
   id INT NOT NULL AUTO_INCREMENT,
   amenity INT NULL,
   ref_type INT NULL,
   ref_dest INT NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(ref_type),
+  INDEX(ref_dest)
 );
 
 ----
@@ -336,7 +423,8 @@ CREATE TABLE {prefix}accounts (
   member INT NULL,
   payment_type INT NULL,
   invoice_delivery INT NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(member)
 );
 
 ----
@@ -354,11 +442,14 @@ CREATE TABLE {prefix}categories (
 
 CREATE TABLE {prefix}category_member (
   id INT NOT NULL AUTO_INCREMENT,
-  cateogory INT NULL,
-  main_category TINYINT(1) NULL,
+  category INT NULL,
+  main_category INT NULL,
   ref_type INT NULL,
   ref_dest INT NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(category),
+  INDEX(ref_type),
+  INDEX(ref_dest)
 );
 
 ----
@@ -374,7 +465,11 @@ CREATE TABLE {prefix}files (
   create_date DATE NULL,
   ref_type INT NULL,
   ref_dest INT NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(name(20)),
+  INDEX(file_name(20)),
+  INDEX(ref_type),
+  INDEX(ref_dest)
 );
 
 ----
@@ -389,5 +484,9 @@ CREATE TABLE {prefix}images (
   position INT NULL,
   ref_type INT NULL,
   ref_dest INT NULL,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  INDEX(name(20)),
+  INDEX(file_name(20)),
+  INDEX(ref_type),
+  INDEX(ref_dest)
 );
index 8804416..6e45c64 100644 (file)
@@ -1,29 +1,29 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-15 02:20:49
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 01:23:45
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/error/badAction.html" */ ?>
-<?php /*%%SmartyHeaderCode:210264866954b42dd4bbc715-16113482%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:105358588254c05121d677a6-75784395%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     '06926788f51c1a5a54be2a368556f9c37e2780da' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/error/badAction.html',
-      1 => 1421285081,
+      1 => 1421691086,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '210264866954b42dd4bbc715-16113482',
+  'nocache_hash' => '105358588254c05121d677a6-75784395',
   'function' => 
   array (
   ),
-  'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b42dd4c09430_68496846',
   'variables' => 
   array (
     'errorMsg' => 0,
   ),
   'has_nocache_code' => false,
+  'version' => 'Smarty-3.1.21-dev',
+  'unifunc' => 'content_54c05121d71ab3_37928404',
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b42dd4c09430_68496846')) {function content_54b42dd4c09430_68496846($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/error/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+<?php if ($_valid && !is_callable('content_54c05121d71ab3_37928404')) {function content_54c05121d71ab3_37928404($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/error/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 
     
     <h2>Sorry, we've had an error.</h2>
index 6f74ae1..71330b6 100644 (file)
@@ -1,30 +1,30 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-15 02:22:28
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 02:04:38
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/members/index.html" */ ?>
-<?php /*%%SmartyHeaderCode:206413157254b42f2535e168-27938613%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:43313958054c05ab60b0587-71987387%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     '081a36d97cdf30d438a1e104c26a275acc180da0' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/members/index.html',
-      1 => 1421288544,
+      1 => 1421691086,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '206413157254b42f2535e168-27938613',
+  'nocache_hash' => '43313958054c05ab60b0587-71987387',
   'function' => 
   array (
   ),
-  'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b42f25390269_82355360',
   'variables' => 
   array (
     'numbMembers' => 0,
     'thisURL' => 0,
   ),
   'has_nocache_code' => false,
+  'version' => 'Smarty-3.1.21-dev',
+  'unifunc' => 'content_54c05ab60bb1c1_03470573',
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b42f25390269_82355360')) {function content_54b42f25390269_82355360($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/members/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+<?php if ($_valid && !is_callable('content_54c05ab60bb1c1_03470573')) {function content_54c05ab60bb1c1_03470573($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/members/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 
     
     <h2>Members Dashboard</h2>
index 76a1638..a080e00 100644 (file)
@@ -1,22 +1,20 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-15 00:18:04
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 02:04:38
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/members/header.html" */ ?>
-<?php /*%%SmartyHeaderCode:81165772654b46f32298020-09293550%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:41614071154c05ab60be091-67045844%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     '15f83071407dddb0b3c23ae1a70b66cefbd681db' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/members/header.html',
-      1 => 1421281076,
+      1 => 1421691086,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '81165772654b46f32298020-09293550',
+  'nocache_hash' => '41614071154c05ab60be091-67045844',
   'function' => 
   array (
   ),
-  'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b46f322c0910_93147809',
   'variables' => 
   array (
     'thisURL' => 0,
@@ -24,8 +22,10 @@ $_valid = $_smarty_tpl->decodeProperties(array (
     'thisAction' => 0,
   ),
   'has_nocache_code' => false,
+  'version' => 'Smarty-3.1.21-dev',
+  'unifunc' => 'content_54c05ab60d1510_45219092',
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b46f322c0910_93147809')) {function content_54b46f322c0910_93147809($_smarty_tpl) {?><div class="wrap">
+<?php if ($_valid && !is_callable('content_54c05ab60d1510_45219092')) {function content_54c05ab60d1510_45219092($_smarty_tpl) {?><div class="wrap">
     <h2>Your Members</h2>
     <h2 class="nav-tab-wrapper">
         <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
index bd21250..1294cac 100644 (file)
@@ -1,22 +1,22 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-15 06:15:32
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 05:39:11
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/index.html" */ ?>
-<?php /*%%SmartyHeaderCode:163797333154b6ac77c986e8-14104892%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:94073808254c05abfc4adf1-45287000%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     '1be35689c5d30d774f40ebc45e387f5f95c45e90' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/index.html',
-      1 => 1421302521,
+      1 => 1421905148,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '163797333154b6ac77c986e8-14104892',
+  'nocache_hash' => '94073808254c05abfc4adf1-45287000',
   'function' => 
   array (
   ),
   'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b6ac77cbe666_15018258',
+  'unifunc' => 'content_54c05abfc64731_62067320',
   'variables' => 
   array (
     'deleted' => 0,
@@ -27,12 +27,12 @@ $_valid = $_smarty_tpl->decodeProperties(array (
   ),
   'has_nocache_code' => false,
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b6ac77cbe666_15018258')) {function content_54b6ac77cbe666_15018258($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/member/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+<?php if ($_valid && !is_callable('content_54c05abfc64731_62067320')) {function content_54c05abfc64731_62067320($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/member/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 
 
   <?php if (!$_smarty_tpl->tpl_vars['deleted']->value) {?>
     <div id="deleteMemberButton" class="button-primary glm-right">Delete this Member</div>
-    <div id="deleteMemberDialog" class="glm-dialog-box">
+    <div id="deleteMemberDialog" class="glm-dialog-box" title="Delete Member">
         <center>
             <p>Are you sure you want to delete this member?</p>
             <p><div id="deleteMemberConfirm" class="button-primary">Yes, delete this member</div></p>
@@ -44,18 +44,19 @@ $_valid = $_smarty_tpl->decodeProperties(array (
     <h2><?php echo $_smarty_tpl->tpl_vars['member']->value['name'];?>
 </h2>
 
-  <?php if ($_smarty_tpl->tpl_vars['deleted']->value) {?>
-        <h3 class="glm-notice">Member Has Been Deleted!</h3>
-  <?php } else { ?>
-    <?php if ($_smarty_tpl->tpl_vars['member']->value['active']['value']) {?>
-        <p>This member is active.</p>
-    <?php } else { ?>
-        <h3 class="glm-notice">Member Not Active</h3>
-    <?php }?>
-  <?php }?>
+    <h3 class="glm-notice"></h3>
     
     <table>
+        <tr>
+            <th class="glm-table-fieldname">Status</th>
+            <td<?php if ($_smarty_tpl->tpl_vars['member']->value['status']['name']=='Pending Review') {?> class="glm-notice"<?php } elseif ($_smarty_tpl->tpl_vars['member']->value['status']['name']=='Active') {?> class="glm-active"<?php }?>>
+                <?php echo $_smarty_tpl->tpl_vars['member']->value['status']['name'];?>
+
+            </td>
+        </tr>
         <tr><th class="glm-table-fieldname">Member Name:</th><td><?php echo $_smarty_tpl->tpl_vars['member']->value['name'];?>
+</td></tr>
+        <tr><th class="glm-table-fieldname">Type:</th><td><?php echo $_smarty_tpl->tpl_vars['member']->value['member_type'];?>
 </td></tr>
         <tr><th class="glm-table-fieldname">Description:</th><td><?php echo $_smarty_tpl->tpl_vars['member']->value['descr'];?>
 </td></tr>
@@ -68,6 +69,7 @@ $_valid = $_smarty_tpl->decodeProperties(array (
         jQuery(document).ready(function($) {
                $("#deleteMemberDialog").dialog({
                        autoOpen: false,
+                       minWidth: 400,
                        dialogClass: "glm-dialog-no-close"
                });
                $('#deleteMemberButton').click( function() {
index 256b564..2adf005 100644 (file)
@@ -1,32 +1,33 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-15 02:04:44
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 02:04:35
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/member.html" */ ?>
-<?php /*%%SmartyHeaderCode:172471491954b6e51b1368b6-20693769%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:101324643954c05ab3f0e228-27454872%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     '25c8610e0e0bacafec3046a296066e9f8eceedae' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/member.html',
-      1 => 1421287476,
+      1 => 1421872896,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '172471491954b6e51b1368b6-20693769',
+  'nocache_hash' => '101324643954c05ab3f0e228-27454872',
   'function' => 
   array (
   ),
-  'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b6e51b158d19_68572085',
   'variables' => 
   array (
     'haveMember' => 0,
     'thisURL' => 0,
     'thisPage' => 0,
     'member' => 0,
+    'v' => 0,
   ),
   'has_nocache_code' => false,
+  'version' => 'Smarty-3.1.21-dev',
+  'unifunc' => 'content_54c05ab4009233_84144294',
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b6e51b158d19_68572085')) {function content_54b6e51b158d19_68572085($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/member/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+<?php if ($_valid && !is_callable('content_54c05ab4009233_84144294')) {function content_54c05ab4009233_84144294($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/member/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 
     
     <?php if ($_smarty_tpl->tpl_vars['haveMember']->value) {?>
@@ -60,15 +61,37 @@ $_valid = $_smarty_tpl->decodeProperties(array (
             <tr>
                 <th>Active:</th>
                 <td>
-                    <input type="checkbox" name="active" <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldData']['active']['value']) {?>checked="checked"<?php }?>">
-                    <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldFail']['name']) {?><p><?php echo $_smarty_tpl->tpl_vars['member']->value['fieldFail']['name'];?>
+                    <select name="status">
+        <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
+ $_from = $_smarty_tpl->tpl_vars['member']->value['fieldData']['status']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
+foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
+$_smarty_tpl->tpl_vars['v']->_loop = true;
+?>
+                        <option value="<?php echo $_smarty_tpl->tpl_vars['v']->value['value'];?>
+"<?php if ($_smarty_tpl->tpl_vars['v']->value['default']) {?> selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['v']->value['name'];?>
+</option>
+        <?php } ?>
+                    </select>
+                    <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldFail']['status']) {?><p><?php echo $_smarty_tpl->tpl_vars['member']->value['fieldFail']['status'];?>
 </p><?php }?>
                 </td>
             </tr>
             <tr>
                 <th>Member Type:</th>
                 <td>
-                    Need to add "enum" type to data abstract.
+                    <select name="member_type">
+        <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
+ $_from = $_smarty_tpl->tpl_vars['member']->value['fieldData']['member_type']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
+foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
+$_smarty_tpl->tpl_vars['v']->_loop = true;
+?>
+                        <option value="<?php echo $_smarty_tpl->tpl_vars['v']->value['value'];?>
+"<?php if ($_smarty_tpl->tpl_vars['v']->value['default']) {?> selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['v']->value['name'];?>
+</option>
+        <?php } ?>
+                    </select>
+                    <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldFail']['member_type']) {?><p><?php echo $_smarty_tpl->tpl_vars['member']->value['fieldFail']['member_type'];?>
+</p><?php }?>
                 </td>
             </tr>            
             <tr>
index 9f3f0f1..9ea95c5 100644 (file)
@@ -1,22 +1,22 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 21:35:21
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 10:13:18
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/configure/header.html" */ ?>
-<?php /*%%SmartyHeaderCode:148991197854b4cb224461f5-92408371%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:124095827254c0496da79607-59867625%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     '3ec5bcbe581d6335e06bc6c9474f73121a83d59b' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/configure/header.html',
-      1 => 1421271318,
+      1 => 1421921594,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '148991197854b4cb224461f5-92408371',
+  'nocache_hash' => '124095827254c0496da79607-59867625',
   'function' => 
   array (
   ),
   'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b4cb22446989_15253660',
+  'unifunc' => 'content_54c0496da89482_99477612',
   'variables' => 
   array (
     'glmPluginName' => 0,
@@ -26,7 +26,7 @@ $_valid = $_smarty_tpl->decodeProperties(array (
   ),
   'has_nocache_code' => false,
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b4cb22446989_15253660')) {function content_54b4cb22446989_15253660($_smarty_tpl) {?><div class="wrap">
+<?php if ($_valid && !is_callable('content_54c0496da89482_99477612')) {function content_54c0496da89482_99477612($_smarty_tpl) {?><div class="wrap">
 
     <h2><?php echo $_smarty_tpl->tpl_vars['glmPluginName']->value;?>
  Configuration</h2>
@@ -37,16 +37,19 @@ $_valid = $_smarty_tpl->decodeProperties(array (
 &glm_action=index" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='index') {?>-active<?php }?>">General Options</a>
         <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
 ?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
-&glm_action=cities" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='cities') {?>-active<?php }?>">Cities List</a>
+&glm_action=memberTypes" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='memberTypes') {?>-active<?php }?>">Member Types</a>
         <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
 ?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
-&glm_action=states" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='add') {?>-active<?php }?>">States List</a>
+&glm_action=categories" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='categories') {?>-active<?php }?>">Member Categories</a>
         <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
 ?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
-&glm_action=countries" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='edit') {?>-active<?php }?>">Countries List</a>
+&glm_action=cities" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='cities') {?>-active<?php }?>">Cities</a>
         <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
 ?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
-&glm_action=Regions" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='edit') {?>-active<?php }?>">Regions List</a>
+&glm_action=regions" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='regions') {?>-active<?php }?>">Regions</a>
+        <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=accommodationTypes" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='accommodationTypes') {?>-active<?php }?>">Accommodation Types</a>
     </h2>
     <div id="glm-admin-content-container">
     <?php }} ?>
index 1770b38..0474448 100644 (file)
@@ -1,25 +1,25 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 17:04:39
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 00:50:53
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/configure/index.html" */ ?>
-<?php /*%%SmartyHeaderCode:113537149654b4ca1e9b41e6-15887083%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:135960089454c0496da6c5c6-30692976%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     '47fb9b803e7138d215645f3c977b0b1dc2a9e718' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/configure/index.html',
-      1 => 1421255040,
+      1 => 1421691086,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '113537149654b4ca1e9b41e6-15887083',
+  'nocache_hash' => '135960089454c0496da6c5c6-30692976',
   'function' => 
   array (
   ),
-  'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b4ca1e9c5b88_76832702',
   'has_nocache_code' => false,
+  'version' => 'Smarty-3.1.21-dev',
+  'unifunc' => 'content_54c0496da75c57_83289225',
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b4ca1e9c5b88_76832702')) {function content_54b4ca1e9c5b88_76832702($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/configure/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+<?php if ($_valid && !is_callable('content_54c0496da75c57_83289225')) {function content_54c0496da75c57_83289225($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/configure/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 
     
     <h2>General Configuration</h2>
index 3ac806c..d9e0024 100644 (file)
@@ -1,20 +1,22 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-15 00:17:02
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 05:35:31
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/members/list.html" */ ?>
-<?php /*%%SmartyHeaderCode:46596749754b706fe3a62d3-72547374%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:33593880254c05ab8e362a8-88978550%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     '4c287ca0e4946b3d644e61950c851e98e8906d49' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/members/list.html',
-      1 => 1421259050,
+      1 => 1421904927,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '46596749754b706fe3a62d3-72547374',
+  'nocache_hash' => '33593880254c05ab8e362a8-88978550',
   'function' => 
   array (
   ),
+  'version' => 'Smarty-3.1.21-dev',
+  'unifunc' => 'content_54c05ab8e47dd3_05464531',
   'variables' => 
   array (
     'haveMembers' => 0,
@@ -24,27 +26,20 @@ $_valid = $_smarty_tpl->decodeProperties(array (
     'm' => 0,
   ),
   'has_nocache_code' => false,
-  'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b706fe3c2516_38940524',
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b706fe3c2516_38940524')) {function content_54b706fe3c2516_38940524($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/members/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+<?php if ($_valid && !is_callable('content_54c05ab8e47dd3_05464531')) {function content_54c05ab8e47dd3_05464531($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/members/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 
     
     <h2>List of Members</h2>
     
-    <table class="wp-list-table widefat fixed posts">
+    <table class="wp-list-table widefat fixed posts glm-admin-table"">
         <thead>
             <tr>
                 <th>Member Name</th>
+                <th>Type</th>
                 <th>&nbsp;</th>
             </tr>
         </thead>
-        <tfoot>
-            <tr>
-                <th>Member Name</th>
-                <th>&nbsp;</th>
-            </tr>
-        </tfoot>
         <tbody>
 <?php if ($_smarty_tpl->tpl_vars['haveMembers']->value) {?>
     <?php $_smarty_tpl->tpl_vars["i"] = new Smarty_variable("0", null, 0);?>
@@ -65,7 +60,13 @@ $_smarty_tpl->tpl_vars['m']->_loop = true;
 </a>
                 </td>
                 <td>
-                    (nothing here yet)
+                    <?php echo $_smarty_tpl->tpl_vars['m']->value['member_type'];?>
+
+                </td>
+                <td>
+                    <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=glm-members-admin-menu-member&glm_action=index&member_id=<?php echo $_smarty_tpl->tpl_vars['m']->value['id'];?>
+" class="button-primary glm-right">Manage</a>
                 </td>
             </tr>
     <?php } ?>
index c82ad60..6f4882a 100644 (file)
@@ -1,22 +1,20 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-18 22:53:18
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 00:50:53
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/footer.html" */ ?>
-<?php /*%%SmartyHeaderCode:146319615854b4cb224487c6-63517443%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:186248802254c0496da8b546-87847278%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     '50e78f1400d6db96c588c737669426ab57397d1d' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/footer.html',
-      1 => 1421621593,
+      1 => 1421691086,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '146319615854b4cb224487c6-63517443',
+  'nocache_hash' => '186248802254c0496da8b546-87847278',
   'function' => 
   array (
   ),
-  'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b4cb2244e1c6_97382029',
   'variables' => 
   array (
     'glmPluginName' => 0,
@@ -26,8 +24,10 @@ $_valid = $_smarty_tpl->decodeProperties(array (
     'thisPage' => 0,
   ),
   'has_nocache_code' => false,
+  'version' => 'Smarty-3.1.21-dev',
+  'unifunc' => 'content_54c0496da905b3_89352768',
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b4cb2244e1c6_97382029')) {function content_54b4cb2244e1c6_97382029($_smarty_tpl) {?>
+<?php if ($_valid && !is_callable('content_54c0496da905b3_89352768')) {function content_54c0496da905b3_89352768($_smarty_tpl) {?>
     </div> <!-- / admin content area -->
     <div class="glm-copyright">
         <?php echo $_smarty_tpl->tpl_vars['glmPluginName']->value;?>
index cc82045..b511d05 100644 (file)
@@ -1,25 +1,25 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-15 01:25:35
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 05:12:19
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/error/index.html" */ ?>
-<?php /*%%SmartyHeaderCode:204984570454b42e9eaf47c6-75708563%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:74342921254c086b3b0af86-22635380%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     '60cbe99d19bbec013cbca4d9344f2fd4a4152f52' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/error/index.html',
-      1 => 1421285131,
+      1 => 1421691086,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '204984570454b42e9eaf47c6-75708563',
+  'nocache_hash' => '74342921254c086b3b0af86-22635380',
   'function' => 
   array (
   ),
-  'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b42e9eafe502_03625329',
   'has_nocache_code' => false,
+  'version' => 'Smarty-3.1.21-dev',
+  'unifunc' => 'content_54c086b3b1dd65_92948708',
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b42e9eafe502_03625329')) {function content_54b42e9eafe502_03625329($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/error/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+<?php if ($_valid && !is_callable('content_54c086b3b1dd65_92948708')) {function content_54c086b3b1dd65_92948708($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/error/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 
     
     <center>
index 7c7cc48..3367911 100644 (file)
@@ -1,29 +1,29 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-15 01:26:23
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 01:23:45
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/error/header.html" */ ?>
-<?php /*%%SmartyHeaderCode:112530116454b716e1691b91-32861276%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:66908105654c05121d74c63-58046810%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     '6b21e44674b437b1c7d4844f49a7ab41316a5694' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/error/header.html',
-      1 => 1421285180,
+      1 => 1421691086,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '112530116454b716e1691b91-32861276',
+  'nocache_hash' => '66908105654c05121d74c63-58046810',
   'function' => 
   array (
   ),
-  'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b716e1693c97_05571152',
   'variables' => 
   array (
     'glmPluginName' => 0,
   ),
   'has_nocache_code' => false,
+  'version' => 'Smarty-3.1.21-dev',
+  'unifunc' => 'content_54c05121d76603_49097204',
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b716e1693c97_05571152')) {function content_54b716e1693c97_05571152($_smarty_tpl) {?><div class="wrap">
+<?php if ($_valid && !is_callable('content_54c05121d76603_49097204')) {function content_54c05121d76603_49097204($_smarty_tpl) {?><div class="wrap">
        
     <h2><?php echo $_smarty_tpl->tpl_vars['glmPluginName']->value;?>
 </h2>
index f0a7244..a008c47 100644 (file)
@@ -1,22 +1,20 @@
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 22:28:02
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-22 02:04:35
          compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/header.html" */ ?>
-<?php /*%%SmartyHeaderCode:8257956454b6ac77cc21f2-25755845%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+<?php /*%%SmartyHeaderCode:145413007654c05ab400d0a2-83797817%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
 $_valid = $_smarty_tpl->decodeProperties(array (
   'file_dependency' => 
   array (
     'c74bd17240f8892f8955e8bedbedd434341aeca9' => 
     array (
       0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/header.html',
-      1 => 1421274467,
+      1 => 1421691086,
       2 => 'file',
     ),
   ),
-  'nocache_hash' => '8257956454b6ac77cc21f2-25755845',
+  'nocache_hash' => '145413007654c05ab400d0a2-83797817',
   'function' => 
   array (
   ),
-  'version' => 'Smarty-3.1.21-dev',
-  'unifunc' => 'content_54b6ac77cd9375_10535024',
   'variables' => 
   array (
     'thisURL' => 0,
@@ -26,8 +24,10 @@ $_valid = $_smarty_tpl->decodeProperties(array (
     'haveMember' => 0,
   ),
   'has_nocache_code' => false,
+  'version' => 'Smarty-3.1.21-dev',
+  'unifunc' => 'content_54c05ab4030650_34922061',
 ),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b6ac77cd9375_10535024')) {function content_54b6ac77cd9375_10535024($_smarty_tpl) {?><div class="wrap">
+<?php if ($_valid && !is_callable('content_54c05ab4030650_34922061')) {function content_54c05ab4030650_34922061($_smarty_tpl) {?><div class="wrap">
        
     <h2>Member Information</h2>
     
diff --git a/models/admin/configure/accommodationTypes.php b/models/admin/configure/accommodationTypes.php
new file mode 100644 (file)
index 0000000..044382b
--- /dev/null
@@ -0,0 +1,198 @@
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Admin Accommodation Types List
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @version  0.1
+ */
+
+// Load Member Types data abstract
+require_once(GLM_MEMBERS_PLUGIN_CLASS_DIR.'/data/dataAccommodationTypes.php');
+
+/*
+ * This class performs the work for the default action of the "Members" menu
+ * option, which is to display the members dashboard.
+ *
+ */
+class GlmMembersAdmin_configure_accommodationTypes extends GlmDataAccommodationTypes
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+
+    /*
+     * Constructor
+     *
+     * This contructor sets up this model. At this time that only includes
+     * storing away the WordPress data object.
+     *
+     * @return object Class object
+     *
+     */
+    public function __construct ($wpdb, $config)
+    {
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+        // Run constructor for members data class
+        parent::__construct($this->wpdb, $this->config);
+
+    }
+
+    /*
+     * Perform Model Action
+     *
+     * This method does the work for this model and returns any resulting data
+     *
+     * @return array Status and data array
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * 'menuItemRedirect'
+     *
+     * If not false, provides a menu item the controller should
+     * execute after this one. Normally if this is used, there would also be a
+     * modelRedirect value supplied as well.
+     *
+     * 'modelRedirect'
+     *
+     * If not false, provides an action the controller should execute after
+     * this one.
+     *
+     * 'view'
+     *
+     * A suggested view name that the contoller should use instead of the
+     * default view for this model or false to indicate that the default view
+     * should be used.
+     *
+     * 'data'
+     *
+     * Data that the model is returning for use in merging with the view to
+     * produce output.
+     *
+     */
+    public function modelAction ($redirectData = false)
+    {
+
+        $success = true;
+        $haveAccommodationTypes = false;
+        $accommodationTypes = false;
+        $error = false;
+
+        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'addNew') {
+
+            $accommodationTypes = $this->insertEntry();
+
+            if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                glmMembersAdmin::addNotice('&nbsp;&nbsp;New Entry Added ', 'Process');
+            }
+        }
+
+        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'delete' && isset($_REQUEST['accommodationTypeID'])) {
+
+            $id = $_REQUEST['accommodationTypeID']-0;
+            if ($id > 0) {
+                $this->deleteEntry($id, true);
+            }
+
+            if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                glmMembersAdmin::addNotice('&nbsp;&nbsp;Entry Deleted: id = '.$id, 'Process');
+            }
+
+        }
+
+        // Check if a accommodation type ID is supplied
+        if (isset($_REQUEST['accommodationType_id'])) {
+            // Make sure it's a number
+            $accommodationTypeID = $_REQUEST['accommodationType_id']-0;
+        }
+
+        // Check for action option
+        $option = false;
+        if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') {
+            $option = $_REQUEST['option'];
+        }
+
+// Check for options
+
+        // Get a current list of accommodation types
+        $accommodationTypes = $this->getList();
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+            glmMembersAdmin::addNotice($accommodationTypes, 'DataBlock', 'Accommodation Type Data');
+        }
+
+        // If we have list entries - even if it's an empty list
+        $success = true;
+        $haveAccommodationTypes = false;
+        if ($accommodationTypes !== false) {
+
+            $success = true;
+
+            // If we have any entries
+            if (count($accommodationTypes) > 0) {
+                $haveAccommodationTypes = true;
+            }
+        }
+
+        // If we had a fatal error, redirect to the error page
+        if ($error) {
+            return array(
+                    'status' => $success,
+                    'menuItemRedirect' => 'error',
+                    'modelRedirect' => 'index',
+                    'view' => 'admin/error/index.html',
+                    'data' => false
+            );
+        }
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+            glmMembersAdmin::addNotice($accommodationTypes, 'DataBlock', 'Accommodation Types Data');
+        }
+
+        // Compile template data
+        $templateData = array(
+            'haveRegions' => $haveAccommodationTypes,
+            'accommodationTypes' => $accommodationTypes
+        );
+
+        // Return status, suggested view, and data to controller
+        return array(
+            'status' => $success,
+            'menuItemRedirect' => false,
+            'modelRedirect' => false,
+            'view' => 'admin/configure/accommodationTypes.html',
+            'data' => $templateData
+        );
+
+    }
+
+
+}
+
+?>
\ No newline at end of file
diff --git a/models/admin/configure/categories.php b/models/admin/configure/categories.php
new file mode 100644 (file)
index 0000000..a755876
--- /dev/null
@@ -0,0 +1,199 @@
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Admin Categories List
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @version  0.1
+ */
+
+// Load Member Types data abstract
+require_once(GLM_MEMBERS_PLUGIN_CLASS_DIR.'/data/dataCategories.php');
+
+/*
+ * This class performs the work for the default action of the "Members" menu
+ * option, which is to display the members dashboard.
+ *
+ */
+class GlmMembersAdmin_configure_categories extends GlmDataCategories
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+
+    /*
+     * Constructor
+     *
+     * This contructor sets up this model. At this time that only includes
+     * storing away the WordPress data object.
+     *
+     * @return object Class object
+     *
+     */
+    public function __construct ($wpdb, $config)
+    {
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+        // Run constructor for members data class
+        parent::__construct($this->wpdb, $this->config);
+
+    }
+
+    /*
+     * Perform Model Action
+     *
+     * This method does the work for this model and returns any resulting data
+     *
+     * @return array Status and data array
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * 'menuItemRedirect'
+     *
+     * If not false, provides a menu item the controller should
+     * execute after this one. Normally if this is used, there would also be a
+     * modelRedirect value supplied as well.
+     *
+     * 'modelRedirect'
+     *
+     * If not false, provides an action the controller should execute after
+     * this one.
+     *
+     * 'view'
+     *
+     * A suggested view name that the contoller should use instead of the
+     * default view for this model or false to indicate that the default view
+     * should be used.
+     *
+     * 'data'
+     *
+     * Data that the model is returning for use in merging with the view to
+     * produce output.
+     *
+     */
+    public function modelAction ($redirectData = false)
+    {
+
+        $success = true;
+        $haveCategories = false;
+        $categories = false;
+        $error = false;
+
+        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'addNew') {
+
+            $categories = $this->insertEntry();
+
+            if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                glmMembersAdmin::addNotice('&nbsp;&nbsp;New Entry Added ', 'Process');
+                glmMembersAdmin::addNotice($categories, 'DataBlock', 'New Member Category Data');
+            }
+        }
+
+        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'delete' && isset($_REQUEST['categoryID'])) {
+
+            $id = $_REQUEST['categoryID']-0;
+            if ($id > 0) {
+                $this->deleteEntry($id, true);
+            }
+
+            if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                glmMembersAdmin::addNotice('&nbsp;&nbsp;Entry Deleted: id = '.$id, 'Process');
+            }
+
+        }
+
+        // Check if a category ID is supplied
+        if (isset($_REQUEST['category_id'])) {
+            // Make sure it's a number
+            $categoryID = $_REQUEST['category_id']-0;
+        }
+
+        // Check for action option
+        $option = false;
+        if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') {
+            $option = $_REQUEST['option'];
+        }
+
+// Check for options
+
+        // Get a current list of members
+        $categories = $this->getList();
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+            glmMembersAdmin::addNotice($categories, 'DataBlock', 'Category Data');
+        }
+
+        // If we have list entries - even if it's an empty list
+        $success = true;
+        $haveCategories = false;
+        if ($categories !== false) {
+
+            $success = true;
+
+            // If we have any entries
+            if (count($categories) > 0) {
+                $haveCategories = true;
+            }
+        }
+
+        // If we had a fatal error, redirect to the error page
+        if ($error) {
+            return array(
+                    'status' => $success,
+                    'menuItemRedirect' => 'error',
+                    'modelRedirect' => 'index',
+                    'view' => 'admin/error/index.html',
+                    'data' => false
+            );
+        }
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+            glmMembersAdmin::addNotice($categories, 'DataBlock', 'Categories Data');
+        }
+
+        // Compile template data
+        $templateData = array(
+            'haveCategories' => $haveCategories,
+            'categories' => $categories
+        );
+
+        // Return status, suggested view, and data to controller
+        return array(
+            'status' => $success,
+            'menuItemRedirect' => false,
+            'modelRedirect' => false,
+            'view' => 'admin/configure/categories.html',
+            'data' => $templateData
+        );
+
+    }
+
+
+}
+
+?>
\ No newline at end of file
index d9e9252..2f78a42 100644 (file)
@@ -101,18 +101,27 @@ class GlmMembersAdmin_configure_cities extends GlmDataCities
 
         $success = true;
         $haveCities = false;
-        $citiew = false;
+        $cities = false;
         $error = false;
 
         if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'addNew') {
             $cities = $this->insertEntry();
+            if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                glmMembersAdmin::addNotice('&nbsp;&nbsp;New Entry Added ', 'Process');
+            }
         }
 
         if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'delete' && isset($_REQUEST['cityID'])) {
+
             $id = $_REQUEST['cityID']-0;
             if ($id > 0) {
                 $this->deleteEntry($id, true);
             }
+
+            if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                glmMembersAdmin::addNotice('&nbsp;&nbsp;Entry Deleted: id = '.$id, 'Process');
+            }
+
         }
 
         // Check if a city ID is supplied
@@ -169,7 +178,7 @@ class GlmMembersAdmin_configure_cities extends GlmDataCities
             'haveCities' => $haveCities,
             'cities' => $cities
         );
-echo "!@#!@##";
+
         // Return status, suggested view, and data to controller
         return array(
             'status' => $success,
index 45b7fd6..0ed1257 100644 (file)
@@ -101,24 +101,35 @@ class GlmMembersAdmin_configure_regions extends GlmDataRegions
 
         $success = true;
         $haveRegions = false;
-        $citiew = false;
+        $regions = false;
         $error = false;
 
         if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'addNew') {
+
             $regions = $this->insertEntry();
+
+            if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                glmMembersAdmin::addNotice('&nbsp;&nbsp;New Entry Added ', 'Process');
+            }
         }
 
-        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'delete' && isset($_REQUEST['cityID'])) {
-            $id = $_REQUEST['cityID']-0;
+        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'delete' && isset($_REQUEST['regionID'])) {
+
+            $id = $_REQUEST['regionID']-0;
             if ($id > 0) {
                 $this->deleteEntry($id, true);
             }
+
+            if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                glmMembersAdmin::addNotice('&nbsp;&nbsp;Entry Deleted: id = '.$id, 'Process');
+            }
+
         }
 
-        // Check if a city ID is supplied
-        if (isset($_REQUEST['city_id'])) {
+        // Check if a region ID is supplied
+        if (isset($_REQUEST['region_id'])) {
             // Make sure it's a number
-            $cityID = $_REQUEST['city_id']-0;
+            $regionID = $_REQUEST['region_id']-0;
         }
 
         // Check for action option
@@ -133,7 +144,7 @@ class GlmMembersAdmin_configure_regions extends GlmDataRegions
         $regions = $this->getList();
 
         if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
-            glmMembersAdmin::addNotice($regions, 'DataBlock', 'City Data');
+            glmMembersAdmin::addNotice($regions, 'DataBlock', 'Region Data');
         }
 
         // If we have list entries - even if it's an empty list
diff --git a/views/admin/configure/accommodationTypes.html b/views/admin/configure/accommodationTypes.html
new file mode 100644 (file)
index 0000000..da2150a
--- /dev/null
@@ -0,0 +1,123 @@
+{include file='admin/configure/header.html'}
+
+    <div id="newAccommodationTypeButton" class="button-primary glm-right">Add a Accommodation Type</div>
+    <div id="newAccommodationTypeDialog" class="glm-dialog-box" title="Enter a New Accommodation Type">
+        <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
+            <input type="hidden" name="glm_action" value="accommodationTypes">
+            <input type="hidden" name="option" value="addNew">
+            
+            <table class="form-table">
+                <tr>
+                    <th class="glm-required">Accommodation Type Name:</th>
+                    <td>
+                        <input type="text" name="name" class="glm-form-text-input">
+                    </td>
+                </tr>
+                <tr>
+                    <th>Description:</th>
+                    <td>
+                        <textarea name="descr" class="glm-form-textarea"></textarea>
+                    </td>
+                </tr>
+                <tr>
+                    <th>Description:</th>
+                    <td>
+                        <input type="text" name="short_descr" class="glm-form-text-input">
+                    </td>
+                </tr>
+                
+                
+            </table>
+            <p><span class="glm-required">*</span> Required</p>
+            <a id="newAccommodationTypeCancel" class="button-primary glm-right">Cancel</a>
+            <input type="submit" value="Add new Accommodation Type">
+            
+        </form>
+    </div>
+    <div id="deleteAccommodationTypeDialog" class="glm-dialog-box" title="Delete Accommodation Type">
+        <center>
+            <p>Are you sure you want to delete this accommodation type?</p>
+            <p><div id="deleteAccommodationTypeConfirm" class="button-primary">Yes, delete this accommodation type</div></p>
+            <p><div id="deleteAccommodationTypeCancel" class="button-primary">No, I don't want to delete this accommodation</div></p>
+        </center>
+    </div>
+                    
+    
+    <h2>Accommodation Types</h2>
+
+    <table class="wp-list-table widefat fixed posts glm-admin-table"">
+        <thead>
+            <tr>
+                <th>Accommodation Type</th>
+                <th>Description</th>
+                <th>Short Description</th>
+                <th>&nbsp;</th>
+            </tr>
+        </thead>
+        <tbody>
+{if $haveAccommodationTypes}
+    {assign var="i" value="0"}
+    {foreach $accommodationTypes as $t}
+        {if $i++ is odd by 1} 
+            <tr>
+        {else}
+            <tr class="alternate">
+        {/if}
+                <td>
+                    {$t.name}
+                </td>
+                <td>
+                    {$t.descr}
+                </td>
+                <td>
+                    {$t.short_descr}
+                </td>
+                <td>
+                    <div class="deleteAccommodationTypeButton button-primary glm-right" data-accommodationTypeID="{$t.id}">Delete</div>
+                </td>
+            </tr>
+    {/foreach}
+{else}
+            <tr class="alternate"><td colspan="2">(no accommodationTypes listed)</td></tr>
+{/if}
+        </tbody>
+    </table>
+
+    <script type="text/javascript">
+        jQuery(document).ready(function($) {
+               
+            $("#newAccommodationTypeDialog").dialog({
+               autoOpen: false,
+               minWidth: 400,
+                dialogClass: "glm-dialog-no-close"
+            });
+            $("#deleteAccommodationTypeDialog").dialog({
+                autoOpen: false,
+                minWidth: 400,
+                dialogClass: "glm-dialog-no-close"
+            });
+
+            $('#newAccommodationTypeButton').click( function() {
+                $("#newAccommodationTypeDialog").dialog("open");
+            });
+            $('#newAccommodationTypeCancel').click( function() {
+                $("#newAccommodationTypeDialog").dialog("close");
+            });
+
+            var id = false;
+            $('.deleteAccommodationTypeButton').click( function() {
+                id = $(this).attr('data-accommodationTypeID');
+                $("#deleteAccommodationTypeDialog").dialog("open");
+            });
+            $('#deleteAccommodationTypeConfirm').click( function() {
+                $("#deleteAccommodationTypeDialog").dialog("close");
+                window.location.href = "{$thisURL}?page={$thisPage}&glm_action=accommodationTypes&option=delete&accommodationTypeID=" + id;
+            });
+            $('#deleteAccommodationTypeCancel').click( function() {
+                $("#deleteAccommodationTypeDialog").dialog("close");
+            });
+
+        });
+    </script>
+            
+{include file='admin/footer.html'}
diff --git a/views/admin/configure/categories.html b/views/admin/configure/categories.html
new file mode 100644 (file)
index 0000000..27337b8
--- /dev/null
@@ -0,0 +1,141 @@
+{include file='admin/configure/header.html'}
+
+    <div id="newCategoryButton" class="button-primary glm-right">Add a Category</div>
+    <div id="newCategoryDialog" class="glm-dialog-box" title="Enter a New Category">
+        <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
+            <input type="hidden" name="glm_action" value="categories">
+            <input type="hidden" name="option" value="addNew">
+            
+            <table class="form-table">
+                <tr>
+                    <th class="glm-required">Category Name:</th>
+                    <td>
+                        <input type="text" name="name" class="glm-form-text-input">
+                    </td>
+                </tr>
+                <tr>
+                    <th>Parent Category:</th>
+                    <td>
+                        <select name="parent">
+                            <option value=""></option>
+            {if $haveCategories}
+                {foreach $categories as $t}
+                            <option value="{$t.id}">{$t.name}</option>
+                {/foreach}
+            {/if}
+                        </select>
+                        
+                    </td>
+                </tr>
+                <tr>
+                    <th>Description:</th>
+                    <td>
+                        <textarea name="descr" class="glm-form-textarea"></textarea>
+                    </td>
+                </tr>
+                <tr>
+                    <th>Description:</th>
+                    <td>
+                        <input type="text" name="short_descr" class="glm-form-text-input">
+                    </td>
+                </tr>
+                
+                
+            </table>
+            <p><span class="glm-required">*</span> Required</p>
+            <a id="newCategoryCancel" class="button-primary glm-right">Cancel</a>
+            <input type="submit" value="Add new Category">
+            
+        </form>
+    </div>
+    <div id="deleteCategoryDialog" class="glm-dialog-box" title="Delete Category">
+        <center>
+            <p>Are you sure you want to delete this category?</p>
+            <p><div id="deleteCategoryConfirm" class="button-primary">Yes, delete this category</div></p>
+            <p><div id="deleteCategoryCancel" class="button-primary">No, I don't want to delete this category</div></p>
+        </center>
+    </div>
+                    
+    
+    <h2>Categories</h2>
+
+    <table class="wp-list-table widefat fixed posts glm-admin-table"">
+        <thead>
+            <tr>
+                <th>Category</th>
+                <th>Parent</th>
+                <th>Description</th>
+                <th>Short Description</th>
+                <th>&nbsp;</th>
+            </tr>
+        </thead>
+        <tbody>
+{if $haveCategories}
+    {assign var="i" value="0"}
+    {foreach $categories as $t}
+        {if $i++ is odd by 1} 
+            <tr>
+        {else}
+            <tr class="alternate">
+        {/if}
+                <td>
+                    {$t.name}
+                </td>
+                <td>
+                    {$t.parent}
+                </td>
+                <td>
+                    {$t.descr}
+                </td>
+                <td>
+                    {$t.short_descr}
+                </td>
+                <td>
+                    <div class="deleteCategoryButton button-primary glm-right" data-categoryID="{$t.id}">Delete</div>
+                </td>
+            </tr>
+    {/foreach}
+{else}
+            <tr class="alternate"><td colspan="2">(no categories listed)</td></tr>
+{/if}
+        </tbody>
+    </table>
+
+    <script type="text/javascript">
+        jQuery(document).ready(function($) {
+               
+            $("#newCategoryDialog").dialog({
+               autoOpen: false,
+               minWidth: 400,
+                dialogClass: "glm-dialog-no-close"
+            });
+            $("#deleteCategoryDialog").dialog({
+                autoOpen: false,
+                minWidth: 400,
+                dialogClass: "glm-dialog-no-close"
+            });
+
+            $('#newCategoryButton').click( function() {
+                $("#newCategoryDialog").dialog("open");
+            });
+            $('#newCategoryCancel').click( function() {
+                $("#newCategoryDialog").dialog("close");
+            });
+
+            var id = false;
+            $('.deleteCategoryButton').click( function() {
+                id = $(this).attr('data-categoryID');
+                $("#deleteCategoryDialog").dialog("open");
+            });
+            $('#deleteCategoryConfirm').click( function() {
+                $("#deleteCategoryDialog").dialog("close");
+                window.location.href = "{$thisURL}?page={$thisPage}&glm_action=categories&option=delete&categoryID=" + id;
+            });
+            $('#deleteCategoryCancel').click( function() {
+                $("#deleteCategoryDialog").dialog("close");
+            });
+
+        });
+    </script>
+            
+{include file='admin/footer.html'}
index 46a5af8..047ca06 100644 (file)
     
     <h2>Cities</h2>
 
-    <table class="wp-list-table widefat fixed posts">
+    <table class="wp-list-table widefat fixed posts glm-admin-table"">
         <thead>
             <tr>
                 <th>City</th>
                 <th>&nbsp;</th>
             </tr>
         </thead>
-        <tfoot>
-            <tr>
-                <th>City</th>
-                <th>&nbsp;</th>
-            </tr>
-        </tfoot>
         <tbody>
 {if $haveCities}
     {assign var="i" value="0"}
             $('#newCityButton').click( function() {
                 $("#newCityDialog").dialog("open");
             });
-            $('#newCityConfirm').click( function() {
-                $("#newCityDialog").dialog("close");
-                window.location.href = "{$thisURL}?page={$thisPage}&glm_action=cities&option=addNew";
-            });
             $('#newCityCancel').click( function() {
                 $("#newCityDialog").dialog("close");
             });
index a44cbb4..7b073cf 100644 (file)
@@ -5,8 +5,10 @@
     <h2 class="nav-tab-wrapper">
         <a href="{$thisURL}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index}-active{/if}">General Options</a>
         <a href="{$thisURL}?page={$thisPage}&glm_action=memberTypes" class="nav-tab{if $thisAction==memberTypes}-active{/if}">Member Types</a>
+        <a href="{$thisURL}?page={$thisPage}&glm_action=categories" class="nav-tab{if $thisAction==categories}-active{/if}">Member Categories</a>
         <a href="{$thisURL}?page={$thisPage}&glm_action=cities" class="nav-tab{if $thisAction==cities}-active{/if}">Cities</a>
         <a href="{$thisURL}?page={$thisPage}&glm_action=regions" class="nav-tab{if $thisAction==regions}-active{/if}">Regions</a>
+        <a href="{$thisURL}?page={$thisPage}&glm_action=accommodationTypes" class="nav-tab{if $thisAction==accommodationTypes}-active{/if}">Accommodation Types</a>
     </h2>
     <div id="glm-admin-content-container">
     
\ No newline at end of file
index a702086..80a6b94 100644 (file)
@@ -39,7 +39,7 @@
     
     <h2>Member Types</h2>
 
-    <table class="wp-list-table widefat fixed posts">
+    <table class="wp-list-table widefat fixed posts glm-admin-table">
         <thead>
             <tr>
                 <th>Member Type</th>
                 <th>&nbsp;</th>
             </tr>
         </thead>
-        <tfoot>
-            <tr>
-                <th>Member Type</th>
-                <th>Description</th>
-                <th>&nbsp;</th>
-            </tr>
-        </tfoot>
         <tbody>
 {if $haveMemberTypes}
     {assign var="i" value="0"}
             $('#newMemberTypeButton').click( function() {
                 $("#newMemberTypeDialog").dialog("open");
             });
-            $('#newMemberTypeConfirm').click( function() {
-                $("#newMemberTypeDialog").dialog("close");
-                window.location.href = "{$thisURL}?page={$thisPage}&glm_action=memberTypes&option=addNew";
-            });
             $('#newMemberTypeCancel').click( function() {
                 $("#newMemberTypeDialog").dialog("close");
             });
index aa82f21..3721af4 100644 (file)
                         <textarea name="descr" class="glm-form-textarea"></textarea>
                     </td>
                 </tr>
+                <tr>
+                    <th>Description:</th>
+                    <td>
+                        <input type="text" name="short_descr" class="glm-form-text-input">
+                    </td>
+                </tr>
                 
                 
             </table>
@@ -37,9 +43,9 @@
     </div>
                     
     
-    <h2>Cities</h2>
+    <h2>Regions</h2>
 
-    <table class="wp-list-table widefat fixed posts">
+    <table class="wp-list-table widefat fixed posts glm-admin-table"">
         <thead>
             <tr>
                 <th>Region</th>
                 <th>&nbsp;</th>
             </tr>
         </thead>
-        <tfoot>
-            <tr>
-                <th>Region</th>
-                <th>Description</th>
-                <th>Short Description</th>
-                <th>&nbsp;</th>
-            </tr>
-        </tfoot>
         <tbody>
-{if $haveCities}
+{if $haveRegions}
     {assign var="i" value="0"}
     {foreach $regions as $t}
         {if $i++ is odd by 1} 
             $('#newRegionButton').click( function() {
                 $("#newRegionDialog").dialog("open");
             });
-            $('#newRegionConfirm').click( function() {
-                $("#newRegionDialog").dialog("close");
-                window.location.href = "{$thisURL}?page={$thisPage}&glm_action=regions&option=addNew";
-            });
             $('#newRegionCancel').click( function() {
                 $("#newRegionDialog").dialog("close");
             });
index a2dc6e5..39602ed 100644 (file)
@@ -23,6 +23,7 @@
             </td>
         </tr>
         <tr><th class="glm-table-fieldname">Member Name:</th><td>{$member.name}</td></tr>
+        <tr><th class="glm-table-fieldname">Type:</th><td>{$member.member_type}</td></tr>
         <tr><th class="glm-table-fieldname">Description:</th><td>{$member.descr}</td></tr>
         <tr><th class="glm-table-fieldname">Short Description:</th><td>{$member.short_descr}</td></tr>
     </table>
index 941e6f0..a4114c7 100644 (file)
@@ -2,19 +2,14 @@
     
     <h2>List of Members</h2>
     
-    <table class="wp-list-table widefat fixed posts">
+    <table class="wp-list-table widefat fixed posts glm-admin-table"">
         <thead>
             <tr>
                 <th>Member Name</th>
+                <th>Type</th>
                 <th>&nbsp;</th>
             </tr>
         </thead>
-        <tfoot>
-            <tr>
-                <th>Member Name</th>
-                <th>&nbsp;</th>
-            </tr>
-        </tfoot>
         <tbody>
 {if $haveMembers}
     {assign var="i" value="0"}
                     <a href="{$thisURL}?page=glm-members-admin-menu-member&glm_action=index&member_id={$m.id}">{$m.name}</a>
                 </td>
                 <td>
-                    (nothing here yet)
+                    {$m.member_type}
+                </td>
+                <td>
+                    <a href="{$thisURL}?page=glm-members-admin-menu-member&glm_action=index&member_id={$m.id}" class="button-primary glm-right">Manage</a>
                 </td>
             </tr>
     {/foreach}