Interim update during development of Event/Regstrations linking code.
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 14 Aug 2017 15:49:42 +0000 (11:49 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 14 Aug 2017 15:49:42 +0000 (11:49 -0400)
Reorcanization of front-end models.

46 files changed:
activate.php
config/plugin.ini
deactivate.php
defines.php
index.php
models/admin/registrations/accounts.php
models/admin/registrations/events.php
models/admin/registrations/requests.php
models/front/registrations/account.php [new file with mode: 0644]
models/front/registrations/cart.php [new file with mode: 0644]
models/front/registrations/checkout.php [new file with mode: 0644]
models/front/registrations/index.php [new file with mode: 0644]
models/front/registrations/list.php [new file with mode: 0644]
models/front/registrations/registrationAccountSummary.php [deleted file]
models/front/registrations/registrationCart.php [deleted file]
models/front/registrations/registrationCheckout.php [deleted file]
models/front/registrations/registrationSelect.php [deleted file]
models/front/registrations/registrationSummary.php [deleted file]
models/front/registrations/select.php [new file with mode: 0644]
models/front/registrations/summary.php [new file with mode: 0644]
setup/adminHooks.php
setup/adminMenus.php
setup/shortcodes.php
setup/validActions.php
uninstall.php
views/admin/registrations/accountEdit.html [new file with mode: 0644]
views/admin/registrations/editAccount.html [deleted file]
views/admin/registrations/editRequest.html [deleted file]
views/admin/registrations/eventDashboard.html [new file with mode: 0644]
views/admin/registrations/eventEdit.html [new file with mode: 0644]
views/admin/registrations/eventList.html [new file with mode: 0644]
views/admin/registrations/events.html [deleted file]
views/admin/registrations/requestEdit.html [new file with mode: 0644]
views/admin/registrations/text_input.html [new file with mode: 0644]
views/front/registrations/account.html [new file with mode: 0644]
views/front/registrations/cart.html [new file with mode: 0644]
views/front/registrations/checkout.html [new file with mode: 0644]
views/front/registrations/list.html [new file with mode: 0644]
views/front/registrations/login.html [new file with mode: 0644]
views/front/registrations/registrationAccountSummary.html [deleted file]
views/front/registrations/registrationCart.html [deleted file]
views/front/registrations/registrationCheckout.html [deleted file]
views/front/registrations/registrationSelect.html [deleted file]
views/front/registrations/registrationSummary.html [deleted file]
views/front/registrations/select.html [new file with mode: 0644]
views/front/registrations/summary.html [new file with mode: 0644]

index bb07afd..11dbb5c 100644 (file)
@@ -16,7 +16,8 @@
 
 // Check that we're being called by WordPress.
 if (!defined('ABSPATH')) {
-    die("Please do not call this code directly!");
+    header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html");
+    die();
 }
 
 /*
index a2c58b8..f8cc7f3 100644 (file)
@@ -23,14 +23,13 @@ registration_account_option[1]                 = 'Guest Registration'
 registration_account_option[2]                 = 'Saved Registration Accounts'
 registration_account_option[3]                 = 'Member Contact Registrations'
 
-registration_account_option['Guest']           = 1
-registration_account_option['Saved']           = 2
-registration_account_option['Member']          = 3
+registration_account_option_numb['Guest']       = 1
+registration_account_option_numb['Saved']       = 2
+registration_account_option_numb['Member']      = 3
 
 ;
 ; Payment Method - Use as Bitmap Index or List
 ;
-payment_method[0]                               = 'Not Yet Defined'
 payment_method[1]                               = 'No Charge'
 payment_method[2]                               = 'Comp Code'
 payment_method[3]                               = 'Cash'
@@ -38,7 +37,6 @@ payment_method[4]                               = 'Check'
 payment_method[5]                               = 'Credit Card'
 payment_method[6]                               = 'Call from Merchant' 
 
-payment_method_numb['Not Yet Defined']          = 0
 payment_method_numb['No Charge']                = 1
 payment_method_numb['Comp Code']                = 2
 payment_method_numb['Cash']                     = 3
index 4e6e743..f077e2c 100644 (file)
@@ -15,7 +15,8 @@
 
 // Check that we're being called by WordPress.
 if (!defined('ABSPATH')) {
-    die("Please do not call this code directly!");
+    header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html");
+    die();
 }
 
 /*
index 84c7f23..67bce71 100644 (file)
@@ -5,6 +5,12 @@
  * Set standard defined parameters
  */
 
+// Check that we're being called by WordPress.
+if (!defined('ABSPATH')) {
+    header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html");
+    die();
+}
+
 // NOTE: Plugin & Database versions are defined in "/glm-member-db.php".
 
 define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_NAME', 'Gaslight Media Event Registrations');
index 1629e26..3b9c19b 100644 (file)
--- a/index.php
+++ b/index.php
  * @version 0.0.1
  */
 
-/*
+// Check that we're being called by WordPress.
+if (!defined('ABSPATH')) {
+    header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html");
+    die();
+}
+
+    /*
  *  Plugin and Database Versions
  *
  *  Note that the database version matches the version of the last
@@ -65,12 +71,6 @@ if (GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION != get_option('glmMembersRegistrati
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-
-// Check that we're being called by WordPress.
-if (!defined('ABSPATH')) {
-    die("Please do not call this code directly!");
-}
-
 /*
 * Some initial setup and tests
 */
index aaceb75..17bcaa2 100644 (file)
@@ -128,7 +128,7 @@ class GlmMembersAdmin_registrations_accounts extends GlmDataRegistrationsAccount
 
         }
 
-        $view = 'editAccount';
+        $view = 'accountEdit';
 
         switch ( $option ) {
         case 'add':
index 3e8c90f..cc3da3c 100644 (file)
@@ -14,9 +14,9 @@
  */
 
 // Load Registrations data abstract
-// require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegistrations.php';
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
 
-class GlmMembersAdmin_registrations_events // extends GlmDataRegistrations
+class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
 {
 
     /**
@@ -81,21 +81,169 @@ class GlmMembersAdmin_registrations_events // extends GlmDataRegistrations
          * Note, the third parameter is a flag that indicates to the Contacts
          * data class that it should flag a group of fields as 'view_only'.
          */
-//        parent::__construct(false, false, true);
+        parent::__construct(false, false, true);
 
     }
 
     public function modelAction($actionData = false)
-    {
+    {  
+
+        $option         = 'list';
+        $template       = 'list.html';
+        $haveEvent      = false;
+        $eventID        = false;
+        $haveRegEvent   = false;
+        $regEventID     = false;
+        $reason         = false;
+        
+        // Get any provided option
+        if (isset($_REQUEST['option'])) {
+            $option = $_REQUEST['option'];
+        }
+
+        // Check for a supplied regEvent record ID
+        if (isset($_REQUEST['regEvent']) && $_REQUEST['regEvent'] != '') {
+            $regEventID = ($_REQUEST['regEvent'] - 0);
+            if ($regEventID > 0) {
+                $regEvent = $this->getEntry($regEventID);
+                if ($regEvent) {
+                    $haveRegEvent = true;
+                }
+            }
+        }
+        
+        // Check for an event ID and make sure it's a positive integer
+        if (isset($_REQUEST['event']) && $_REQUEST['event'] != '') {
+            $eventID = ($_REQUEST['event']-0);
+        }
+        
+        // If we don't have a regEvent or likely event ID, force option to a list
+        if (!$haveRegEvent && !$eventID) {
+            $option = 'list';
+        }
+        
+        switch( $option ) {
+            
+            case 'add':
+            case 'edit':
+
+                if ($option == 'add') {
+
+                    // Verify that event is not already listed
+                    $regEvent = $this->getEntry($eventID, 'event');
+                    if (!$regEvent) {
+                        
+                        // Get data on this event from events add-on
+                        $eventData = apply_filters('glm-member-db-events-get-event', $eventID);
+          
+                        // Did we get event data?
+                        if ($eventData) {
+                            
+                            // Add event to registrations
+                            $sql = "
+                                INSERT INTO ".$this->table." 
+                                    (
+                                    event,
+                                    event_name,
+                                    event_code,
+                                    notify_email,
+                                    admin_active,
+                                    active,
+                                    attendees,
+                                    attendee_max,
+                                    attendee_max_per_reg,
+                                    reg_hold_minutes,
+                                    cart_hold_days,
+                                    registration_account_options,
+                                    payment_methods,
+                                    restricted_payment_methods,
+                                    terms
+                                    )
+                                  VALUES
+                                    (
+                                    ".$eventData['id'].",
+                                    '".$eventData['name']."',
+                                    '".$eventData['name_slug']."',
+                                    '".$eventData['admin_email']."',
+                                    true,
+                                    ".($eventData['status']['value'] == 10 ? 'true' : 'false').",
+                                    true,
+                                    0,
+                                    0,
+                                    60,
+                                    10,
+                                    0,
+                                    0,
+                                    0,
+                                    ''
+                                    )      
+                            ;";
+                            $this->wpdb->query($sql);
+                            $regEventID = $this->wpdb->insert_id;
+                        
+                        }
+                        
+                    } else {
+                        $reason = "Trying to add an event that is already listed in Registrations.";
+                    }
+                    
+                }
+
+                // If there's no problem yet, try to get the regEvent data for edit
+                if ($reason == '') {
+                    if ($regEventID) {
+                        $regEvent = $this->editEntry($regEventID);
+                        if ($regEvent) {
+                            $haveRegEvent = true;
+                        }
+                    }
+                }
+                
+                $template = 'eventEdit.html';
+                break;
+                
+            case 'dashboard':
 
+                if ($regEventID) {
+                    $regEvent = $this->editEntry($regEventID);
+                    if ($regEvent) {
+                        $haveRegEvent = true;
+                    }
+                }
+                
+                if (!$haveRegEvent) {
+                    $reason = 'Unable to load registration event data.';
+                }
+                
+                $template = 'eventDashboard.html';
+                break;
+                
+            case 'list':
+            default:
+                
+                $regEventList = $this->getList();
+                
+                $template = 'eventList.html';
+                break;
+           
+        }
+        
+        
         // Compile template data
         $templateData = array(
+            'haveEvent'     => $haveEvent,
+            'eventID'       => $eventID,
+            'haveRegEvent'  => $haveRegEvent,
+            'regEventID'    => $regEventID,
+            'regEvent'      => $regEvent,
+            'reason'        => $reason
         );
-             // Return status, any suggested view, and any data to controller
+        
+        // Return status, any suggested view, and any data to controller
         return array(
             'status'        => true,
             'modelRedirect' => false,
-            'view'          => 'admin/registrations/events.html',
+            'view'          => 'admin/registrations/'.$template,
             'data'          => $templateData
         );
 
index 307cc6b..c72671a 100644 (file)
@@ -136,7 +136,7 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRequest
                         $errorMsg = $requestCart['errorMsg'];
                     }
 
-                    $view = 'editRequest.html';
+                    $view = 'requestEdit.html';
 
                     break;
 
diff --git a/models/front/registrations/account.php b/models/front/registrations/account.php
new file mode 100644 (file)
index 0000000..ee63b2c
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataAccount.php';
+ class GlmMembersFront_registrations_account extends GlmDataRegistrationsAccount {
+    /**
+    * WordPress Database Object
+    *
+    * @var $wpdb
+    * @access public
+    */
+    public $wpdb;
+    /**
+    * Plugin Configuration Data
+    *
+    * @var $config
+    * @access public
+    */
+    public $config;
+    /**
+     * Constructor
+     *
+     * This contructor performs the work for this model. This model returns
+     * an array containing the following.
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * '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.
+     *
+     * @wpdb object WordPress database object
+     *
+     * @return array Array containing status, suggested view, and any data
+     */
+    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(false, false);
+
+    }
+    
+    public function modelAction($actionData = false)
+    {
+   
+
+        // Get any provided option
+        if (isset($_REQUEST['option'])) {
+            $option = $_REQUEST['option'];
+        }
+
+        // Get account ID if supplied
+        if (isset($_REQUEST['account'])) {
+
+            // Make sure it's numeric
+            $this->accountID = ($_REQUEST['account'] - 0);
+
+            if ($this->accountID <= 0) {
+                $this->accountID = false;
+            }
+
+        }
+
+        $view = 'summary';
+
+        switch ( $option ) {
+
+        }
+
+        // Compile template data
+        $templateData = array(
+
+        );
+             // Return status, any suggested view, and any data to controller
+        return array(
+            'status'        => true,
+            'modelRedirect' => false,
+            'view'          => 'front/registrations/' . $view . '.html',
+            'data'          => $templateData
+        );
+
+    }
+ }
diff --git a/models/front/registrations/cart.php b/models/front/registrations/cart.php
new file mode 100644 (file)
index 0000000..ada99c0
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+
+ class GlmMembersFront_registrations_cart extends GlmDataRegistrationsRegEvent {
+    /**
+    * WordPress Database Object
+    *
+    * @var $wpdb
+    * @access public
+    */
+    public $wpdb;
+    /**
+    * Plugin Configuration Data
+    *
+    * @var $config
+    * @access public
+    */
+    public $config;
+    /**
+     * Constructor
+     *
+     * This contructor performs the work for this model. This model returns
+     * an array containing the following.
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * '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.
+     *
+     * @wpdb object WordPress database object
+     *
+     * @return array Array containing status, suggested view, and any data
+     */
+
+    public function modelAction($actionData = false)
+    {
+
+        // Get any provided option
+        if (isset($_REQUEST['option'])) {
+            $option = $_REQUEST['option'];
+        }
+
+        // Get account ID if supplied
+        if (isset($_REQUEST['account'])) {
+
+            // Make sure it's numeric
+            $this->accountID = ($_REQUEST['account'] - 0);
+
+            if ($this->accountID <= 0) {
+                $this->accountID = false;
+            }
+        }
+
+        $view = 'cart';
+
+        switch ( $option ) {
+
+        }
+
+        // Compile template data
+        $templateData = array(
+
+        );
+             // Return status, any suggested view, and any data to controller
+        return array(
+            'status'        => true,
+            'modelRedirect' => false,
+            'view'          => 'front/registrations/' . $view . '.html',
+            'data'          => $templateData
+        );
+
+    }
+ }
diff --git a/models/front/registrations/checkout.php b/models/front/registrations/checkout.php
new file mode 100644 (file)
index 0000000..2a91f0a
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+
+ class GlmMembersFront_registrations_checkout extends GlmDataRegistrationsRegEvent {
+    /**
+    * WordPress Database Object
+    *
+    * @var $wpdb
+    * @access public
+    */
+    public $wpdb;
+    /**
+    * Plugin Configuration Data
+    *
+    * @var $config
+    * @access public
+    */
+    public $config;
+    /**
+     * Constructor
+     *
+     * This contructor performs the work for this model. This model returns
+     * an array containing the following.
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * '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.
+     *
+     * @wpdb object WordPress database object
+     *
+     * @return array Array containing status, suggested view, and any data
+     */
+
+    public function modelAction($actionData = false)
+    {
+
+        // Get any provided option
+        if (isset($_REQUEST['option'])) {
+            $option = $_REQUEST['option'];
+        }
+
+        // Get account ID if supplied
+        if (isset($_REQUEST['account'])) {
+
+            // Make sure it's numeric
+            $this->accountID = ($_REQUEST['account'] - 0);
+
+            if ($this->accountID <= 0) {
+                $this->accountID = false;
+            }
+        }
+
+        $view = 'checkout';
+
+        switch ( $option ) {
+
+        }
+
+        // Compile template data
+        $templateData = array(
+
+        );
+             // Return status, any suggested view, and any data to controller
+        return array(
+            'status'        => true,
+            'modelRedirect' => false,
+            'view'          => 'front/registrations/' . $view . '.html',
+            'data'          => $templateData
+        );
+
+    }
+ }
diff --git a/models/front/registrations/index.php b/models/front/registrations/index.php
new file mode 100644 (file)
index 0000000..42179bf
--- /dev/null
@@ -0,0 +1,103 @@
+<?php
+/*
+ * This class determines which registration page to run 
+ * then calls it and returns the result back to the controller.
+ *
+ */  
+class GlmMembersFront_registrations_index
+{
+    /**
+    * 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 and GLM associate plugin configuration array.
+     *
+     * @return object Class object
+     *
+     */
+    public function __construct ($wpdb, $config)
+    {
+        
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+        
+        // Save plugin configuration object
+        $this->config = $config;
+        
+    }
+
+    /*
+     * Perform Model Action
+     *
+     * This method determines which registrations page is requested, loads and runs that
+     * model, then returns the result array back to the controller.
+     *
+     * @return array Status and data array
+     *
+     * 'status'
+     *
+     * True if successful 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 controller 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($actionData = false)
+    {
+
+        // Check for valid page - if not valid default to "list"
+        $page = $actionData['request']['page'];
+
+        // Make sure the specified page is valid or default to "list"
+        if (!in_array($page, array('list', 'select', 'cart', 'checkout', 'summary', 'login', 'account'))) {
+            $page = 'list';
+        }
+        
+        // Load the specified model
+        $pageFile = GLM_MEMBERS_REGISTRATIONS_PLUGIN_PATH.'/models/front/registrations/'.$page.'.php';
+        require_once($pageFile);
+
+        // load and run the model
+        $regClass = 'GlmMembersFront_registrations_'.$page;
+        $regModel = new $regClass($this->wpdb, $this->config);
+        $regResult = $regModel->modelAction($actionData);
+
+        return $regResult;
+        
+    }
+ }
diff --git a/models/front/registrations/list.php b/models/front/registrations/list.php
new file mode 100644 (file)
index 0000000..bef41e1
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+
+ class GlmMembersFront_registrations_list extends GlmDataRegistrationsRegEvent {
+    /**
+    * WordPress Database Object
+    *
+    * @var $wpdb
+    * @access public
+    */
+    public $wpdb;
+    /**
+    * Plugin Configuration Data
+    *
+    * @var $config
+    * @access public
+    */
+    public $config;
+    /**
+     * Constructor
+     *
+     * This contructor performs the work for this model. This model returns
+     * an array containing the following.
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * '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.
+     *
+     * @wpdb object WordPress database object
+     *
+     * @return array Array containing status, suggested view, and any data
+     */
+
+    public function modelAction($actionData = false)
+    {
+
+        // Get any provided option
+        if (isset($_REQUEST['option'])) {
+            $option = $_REQUEST['option'];
+        }
+
+        // Get account ID if supplied
+        if (isset($_REQUEST['account'])) {
+
+            // Make sure it's numeric
+            $this->accountID = ($_REQUEST['account'] - 0);
+
+            if ($this->accountID <= 0) {
+                $this->accountID = false;
+            }
+        }
+
+        $view = 'list';
+
+        switch ( $option ) {
+
+        }
+
+        // Compile template data
+        $templateData = array(
+
+        );
+             // Return status, any suggested view, and any data to controller
+        return array(
+            'status'        => true,
+            'modelRedirect' => false,
+            'view'          => 'front/registrations/' . $view . '.html',
+            'data'          => $templateData
+        );
+
+    }
+ }
diff --git a/models/front/registrations/registrationAccountSummary.php b/models/front/registrations/registrationAccountSummary.php
deleted file mode 100644 (file)
index 6b0e568..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
- require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataAccount.php';
- class GlmMembersFront_registrations_registrationAccountSummary extends GlmDataRegistrationsAccount {
-    /**
-    * WordPress Database Object
-    *
-    * @var $wpdb
-    * @access public
-    */
-    public $wpdb;
-    /**
-    * Plugin Configuration Data
-    *
-    * @var $config
-    * @access public
-    */
-    public $config;
-    /**
-     * Constructor
-     *
-     * This contructor performs the work for this model. This model returns
-     * an array containing the following.
-     *
-     * 'status'
-     *
-     * True if successfull and false if there was a fatal failure.
-     *
-     * '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.
-     *
-     * @wpdb object WordPress database object
-     *
-     * @return array Array containing status, suggested view, and any data
-     */
-    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(false, false);
-
-    }
-    
-    public function modelAction($actionData = false)
-    {
-   
-
-        // Get any provided option
-        if (isset($_REQUEST['option'])) {
-            $option = $_REQUEST['option'];
-        }
-
-        // Get account ID if supplied
-        if (isset($_REQUEST['account'])) {
-
-            // Make sure it's numeric
-            $this->accountID = ($_REQUEST['account'] - 0);
-
-            if ($this->accountID <= 0) {
-                $this->accountID = false;
-            }
-
-        }
-
-        $view = 'registrationAccountSummary';
-
-        switch ( $option ) {
-
-        }
-
-        // Compile template data
-        $templateData = array(
-
-        );
-             // Return status, any suggested view, and any data to controller
-        return array(
-            'status'        => true,
-            'modelRedirect' => false,
-            'view'          => 'front/registrations/' . $view . '.html',
-            'data'          => $templateData
-        );
-
-    }
- }
diff --git a/models/front/registrations/registrationCart.php b/models/front/registrations/registrationCart.php
deleted file mode 100644 (file)
index 166addd..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<?php
- require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
-
- class GlmMembersFront_registrations_registrationCart extends GlmDataRegistrationsRegEvent {
-    /**
-    * WordPress Database Object
-    *
-    * @var $wpdb
-    * @access public
-    */
-    public $wpdb;
-    /**
-    * Plugin Configuration Data
-    *
-    * @var $config
-    * @access public
-    */
-    public $config;
-    /**
-     * Constructor
-     *
-     * This contructor performs the work for this model. This model returns
-     * an array containing the following.
-     *
-     * 'status'
-     *
-     * True if successfull and false if there was a fatal failure.
-     *
-     * '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.
-     *
-     * @wpdb object WordPress database object
-     *
-     * @return array Array containing status, suggested view, and any data
-     */
-
-    public function modelAction($actionData = false)
-    {
-
-        // Get any provided option
-        if (isset($_REQUEST['option'])) {
-            $option = $_REQUEST['option'];
-        }
-
-        // Get account ID if supplied
-        if (isset($_REQUEST['account'])) {
-
-            // Make sure it's numeric
-            $this->accountID = ($_REQUEST['account'] - 0);
-
-            if ($this->accountID <= 0) {
-                $this->accountID = false;
-            }
-        }
-
-        $view = 'registrationCart';
-
-        switch ( $option ) {
-
-        }
-
-        // Compile template data
-        $templateData = array(
-
-        );
-             // Return status, any suggested view, and any data to controller
-        return array(
-            'status'        => true,
-            'modelRedirect' => false,
-            'view'          => 'front/registrations/' . $view . '.html',
-            'data'          => $templateData
-        );
-
-    }
- }
diff --git a/models/front/registrations/registrationCheckout.php b/models/front/registrations/registrationCheckout.php
deleted file mode 100644 (file)
index 658eeab..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<?php
- require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
-
- class GlmMembersFront_registrations_registrationCheckout extends GlmDataRegistrationsRegEvent {
-    /**
-    * WordPress Database Object
-    *
-    * @var $wpdb
-    * @access public
-    */
-    public $wpdb;
-    /**
-    * Plugin Configuration Data
-    *
-    * @var $config
-    * @access public
-    */
-    public $config;
-    /**
-     * Constructor
-     *
-     * This contructor performs the work for this model. This model returns
-     * an array containing the following.
-     *
-     * 'status'
-     *
-     * True if successfull and false if there was a fatal failure.
-     *
-     * '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.
-     *
-     * @wpdb object WordPress database object
-     *
-     * @return array Array containing status, suggested view, and any data
-     */
-
-    public function modelAction($actionData = false)
-    {
-
-        // Get any provided option
-        if (isset($_REQUEST['option'])) {
-            $option = $_REQUEST['option'];
-        }
-
-        // Get account ID if supplied
-        if (isset($_REQUEST['account'])) {
-
-            // Make sure it's numeric
-            $this->accountID = ($_REQUEST['account'] - 0);
-
-            if ($this->accountID <= 0) {
-                $this->accountID = false;
-            }
-        }
-
-        $view = 'registrationCheckout';
-
-        switch ( $option ) {
-
-        }
-
-        // Compile template data
-        $templateData = array(
-
-        );
-             // Return status, any suggested view, and any data to controller
-        return array(
-            'status'        => true,
-            'modelRedirect' => false,
-            'view'          => 'front/registrations/' . $view . '.html',
-            'data'          => $templateData
-        );
-
-    }
- }
diff --git a/models/front/registrations/registrationSelect.php b/models/front/registrations/registrationSelect.php
deleted file mode 100644 (file)
index 346ba4b..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-<?php
- require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
-
- class GlmMembersFront_registrations_registrationSelect extends GlmDataRegistrationsRegEvent {
-    /**
-    * WordPress Database Object
-    *
-    * @var $wpdb
-    * @access public
-    */
-    public $wpdb;
-    /**
-    * Plugin Configuration Data
-    *
-    * @var $config
-    * @access public
-    */
-    public $config;
-    /**
-     * Constructor
-     *
-     * This contructor performs the work for this model. This model returns
-     * an array containing the following.
-     *
-     * 'status'
-     *
-     * True if successfull and false if there was a fatal failure.
-     *
-     * '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.
-     *
-     * @wpdb object WordPress database object
-     *
-     * @return array Array containing status, suggested view, and any data
-     */
-
-    public function modelAction($actionData = false)
-    {
-        $events = array();
-
-        // Get any provided option
-        if (isset($_REQUEST['option'])) {
-            $option = $_REQUEST['option'];
-        }
-
-        // Get account ID if supplied
-        if (isset($_REQUEST['account'])) {
-
-            // Make sure it's numeric
-            $this->accountID = ($_REQUEST['account'] - 0);
-
-            if ($this->accountID <= 0) {
-                $this->accountID = false;
-            }
-        }
-
-        $view = 'registrationSelect';
-
-        switch ( $option ) {
-
-        }
-
-        $events = array(
-            1 => array(
-                'id'         => 1,
-                'title'      => 'PHP Payment Gateways',
-                'short_desc' => 'Setting up your developer account and testing payment gateways',
-                'levels'     => array(
-                    3 => array(
-                        'id'          => 3,
-                        'title'       => 'General Admittance',
-                        'registrants' => array(
-                            1 => array(
-                                'id'    => 1,
-                                'fname' => 'Dan',
-                                'lname' => 'Smith',
-                                'email' => 'dan@smith.com',
-                            ),
-                            3 => array(
-                                'id'    => 3,
-                                'fname' => 'Tony',
-                                'lname' => 'Johnson',
-                                'email' => 'tj@website.com',
-                            ),
-                        ),
-                    ),
-                ),
-            ),
-            2 => array(
-                'id'         => 2,
-                'title'       => 'Mailchimp Newsletters',
-                'short_desc' => 'Learning how to setup test and use mailchimp to the fullest.',
-                'levels'     => array(
-                    4 => array(
-                        'id'    => 4,
-                        'title' => 'General Admittance',
-                        'registrants' => array(
-                            2 => array(
-                                'id'    => 2,
-                                'fname' => 'John',
-                                'lname' => 'Handler',
-                                'email' => 'johny@handler.com',
-                            ),
-                        ),
-                    ),
-                ),
-            )
-        );
-        //echo '<pre>$events: ' . print_r( $events, true ) . '</pre>';
-
-        // Compile template data
-        $templateData = array(
-            'events' => $events,
-        );
-             // Return status, any suggested view, and any data to controller
-        return array(
-            'status'        => true,
-            'modelRedirect' => false,
-            'view'          => 'front/registrations/' . $view . '.html',
-            'data'          => $templateData
-        );
-
-    }
- }
diff --git a/models/front/registrations/registrationSummary.php b/models/front/registrations/registrationSummary.php
deleted file mode 100644 (file)
index 3027348..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<?php
- require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
- class GlmMembersFront_registrations_registrationSummary extends GlmDataRegistrationsRegEvent {
-    /**
-    * WordPress Database Object
-    *
-    * @var $wpdb
-    * @access public
-    */
-    public $wpdb;
-    /**
-    * Plugin Configuration Data
-    *
-    * @var $config
-    * @access public
-    */
-    public $config;
-    /**
-     * Constructor
-     *
-     * This contructor performs the work for this model. This model returns
-     * an array containing the following.
-     *
-     * 'status'
-     *
-     * True if successfull and false if there was a fatal failure.
-     *
-     * '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.
-     *
-     * @wpdb object WordPress database object
-     *
-     * @return array Array containing status, suggested view, and any data
-     */
-    
-    public function modelAction($actionData = false)
-    {
-   
-        // Get any provided option
-        if (isset($_REQUEST['option'])) {
-            $option = $_REQUEST['option'];
-        }
-
-        // Get account ID if supplied
-        if (isset($_REQUEST['account'])) {
-
-            // Make sure it's numeric
-            $this->accountID = ($_REQUEST['account'] - 0);
-
-            if ($this->accountID <= 0) {
-                $this->accountID = false;
-            }
-        }
-
-        $view = 'registrationSummary';
-
-        switch ( $option ) {
-
-        }
-
-        // Compile template data
-        $templateData = array(
-
-        );
-             // Return status, any suggested view, and any data to controller
-        return array(
-            'status'        => true,
-            'modelRedirect' => false,
-            'view'          => 'front/registrations/' . $view . '.html',
-            'data'          => $templateData
-        );
-
-    }
- }
diff --git a/models/front/registrations/select.php b/models/front/registrations/select.php
new file mode 100644 (file)
index 0000000..0b8abda
--- /dev/null
@@ -0,0 +1,118 @@
+<?php
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+
+ class GlmMembersFront_registrations_select extends GlmDataRegistrationsRegEvent {
+    /**
+    * WordPress Database Object
+    *
+    * @var $wpdb
+    * @access public
+    */
+    public $wpdb;
+    /**
+    * Plugin Configuration Data
+    *
+    * @var $config
+    * @access public
+    */
+    public $config;
+
+    public function __construct ($wpdb, $config)
+    {
+        
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+        
+        // Save plugin configuration object
+        $this->config = $config;
+        
+    }
+    
+    public function modelAction($actionData = false)
+    {
+        $events = array();
+        
+        // Get any provided option
+        if (isset($_REQUEST['option'])) {
+            $option = $_REQUEST['option'];
+        }
+
+        // Get account ID if supplied
+        if (isset($_REQUEST['account'])) {
+
+            // Make sure it's numeric
+            $this->accountID = ($_REQUEST['account'] - 0);
+
+            if ($this->accountID <= 0) {
+                $this->accountID = false;
+            }
+        }
+
+        $view = 'select';
+
+        switch ( $option ) {
+
+        }
+
+        $events = array(
+            1 => array(
+                'id'         => 1,
+                'title'      => 'PHP Payment Gateways',
+                'short_desc' => 'Setting up your developer account and testing payment gateways',
+                'levels'     => array(
+                    3 => array(
+                        'id'          => 3,
+                        'title'       => 'General Admittance',
+                        'registrants' => array(
+                            1 => array(
+                                'id'    => 1,
+                                'fname' => 'Dan',
+                                'lname' => 'Smith',
+                                'email' => 'dan@smith.com',
+                            ),
+                            3 => array(
+                                'id'    => 3,
+                                'fname' => 'Tony',
+                                'lname' => 'Johnson',
+                                'email' => 'tj@website.com',
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+            2 => array(
+                'id'         => 2,
+                'title'       => 'Mailchimp Newsletters',
+                'short_desc' => 'Learning how to setup test and use mailchimp to the fullest.',
+                'levels'     => array(
+                    4 => array(
+                        'id'    => 4,
+                        'title' => 'General Admittance',
+                        'registrants' => array(
+                            2 => array(
+                                'id'    => 2,
+                                'fname' => 'John',
+                                'lname' => 'Handler',
+                                'email' => 'johny@handler.com',
+                            ),
+                        ),
+                    ),
+                ),
+            )
+        );
+        //echo '<pre>$events: ' . print_r( $events, true ) . '</pre>';
+
+        // Compile template data
+        $templateData = array(
+            'events' => $events,
+        );
+             // Return status, any suggested view, and any data to controller
+        return array(
+            'status'        => true,
+            'modelRedirect' => false,
+            'view'          => 'front/registrations/' . $view . '.html',
+            'data'          => $templateData
+        );
+
+    }
+ }
diff --git a/models/front/registrations/summary.php b/models/front/registrations/summary.php
new file mode 100644 (file)
index 0000000..f1167a9
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+ class GlmMembersFront_registrations_summary extends GlmDataRegistrationsRegEvent {
+    /**
+    * WordPress Database Object
+    *
+    * @var $wpdb
+    * @access public
+    */
+    public $wpdb;
+    /**
+    * Plugin Configuration Data
+    *
+    * @var $config
+    * @access public
+    */
+    public $config;
+    /**
+     * Constructor
+     *
+     * This contructor performs the work for this model. This model returns
+     * an array containing the following.
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * '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.
+     *
+     * @wpdb object WordPress database object
+     *
+     * @return array Array containing status, suggested view, and any data
+     */
+    
+    public function modelAction($actionData = false)
+    {
+   
+        // Get any provided option
+        if (isset($_REQUEST['option'])) {
+            $option = $_REQUEST['option'];
+        }
+
+        // Get account ID if supplied
+        if (isset($_REQUEST['account'])) {
+
+            // Make sure it's numeric
+            $this->accountID = ($_REQUEST['account'] - 0);
+
+            if ($this->accountID <= 0) {
+                $this->accountID = false;
+            }
+        }
+
+        $view = 'summary';
+
+        switch ( $option ) {
+
+        }
+
+        // Compile template data
+        $templateData = array(
+
+        );
+             // Return status, any suggested view, and any data to controller
+        return array(
+            'status'        => true,
+            'modelRedirect' => false,
+            'view'          => 'front/registrations/' . $view . '.html',
+            'data'          => $templateData
+        );
+
+    }
+ }
index c2b0eaf..54e529f 100644 (file)
@@ -46,13 +46,32 @@ add_filter('glm-member-db-admin-management-hooksHelp', function($content) {
 // Add a filter to include a link to either create registrations for an event or to update that.
 add_filter(
     'glm_members_add_link_to_event_list_entry',
-    function( $content, $eventId ){
-
+    function( $content ){
+        
         // Check if there's an existing reg_event record for the supplied event ID.
-        require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php';
+        require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+        $RegEvent = new GlmDataRegistrationsRegEvent($this->wpdb, $this->config);
+        
+        // If we were passed a valid Event ID
+        $eventId = $content-0;
+        if ($eventId > 0) {
 
+            // Try to get get the registrations data for this event
+            $regEvent = $RegEvent->getEntry($eventId, 'event');
+            
+            // If we received valid registrations data for this event then it's already in registrations 
+            if ($regEvent) {
+                
+                // Return link title and URL for this event in registrations
+                return array('title' => 'Registrations', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-events&option=dashboard&event=".$eventId);
+                
+            }
+            
+        }
+        
+        // Since we must not have had a good event ID or didn't find the event in registrations, return title and url to add this event to registrations
+        return array('title' => 'Add Registrations To Event', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-events&option=add&event=".$eventId);
 
-        return '';
     },
     10,
     2
index 67d3f9a..5145682 100644 (file)
@@ -78,7 +78,7 @@ add_submenu_page(
 );
 add_submenu_page(
     'glm-members-admin-menu-members',
-    'Registration Events',
+    'Registration Accounts',
     '&nbsp;&nbsp;&nbsp;&nbsp;Accounts',
     'glm_members_members',
     'glm-members-admin-menu-registrations-accounts',
index cb9b811..297d7f8 100644 (file)
  */
 
 $glmMembersRegistrationsShortcodes = array(
-    'glm-registration-summary' => array(
+    
+    // Short code for all registrations related pages. "page" parameter sets page to be produced.
+    'glm-members-registrations' => array(
         'plugin'     => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
         'menu'       => 'registrations',
-        'action'     => 'registrationSummary',
+        'action'     => 'index',
         'table'      => false,
         'attributes' => array(
-            'id'         => false,
-            'member_only' => false,
+            'page'          => false,
+            'cart'          => false,
+            'event'         => false,
+            'time'          => false,
+            'datetime'      => false,
+            'time'          => false,
+            'account'       => false,
+            
         )
-    ),
-    'glm-registration-account-summary' => array(
-        'plugin'     => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-        'menu'       => 'registrations',
-        'action'     => 'registrationAccountSummary',
-        'table'      => false,
-        'attributes' => array(
-            'id'         => false,
-            'member_only' => false,
-        )
-    ),
-    'glm-registration-select' => array(
-        'plugin'     => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-        'menu'       => 'registrations',
-        'action'     => 'registrationSelect',
-        'table'      => false,
-        'attributes' => array(
-            'id'         => false,
-            'member_only' => false,
-        )
-    ),
-    'glm-registration-checkout' => array(
-        'plugin'     => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-        'menu'       => 'registrations',
-        'action'     => 'registrationCheckout',
-        'table'      => false,
-        'attributes' => array(
-            'id'         => false,
-            'member_only' => false,
-        )
-    ),
-    'glm-registration-cart' => array(
-        'plugin'     => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-        'menu'       => 'registrations',
-        'action'     => 'registrationCart',
-        'table'      => false,
-        'attributes' => array(
-            'id'         => false,
-            'member_only' => false,
-        )
-    ),
+    )
+    
 );
 
-$glmMembersRegistrationsShortcodesDescription = '';
+$glmMembersRegistrationsShortcodesDescription = '
+    <tr><th>Shortcode</th><th>Attribute</th><th>Description</th></tr>
+    <tr>
+        <th>[glm-members-registrations]</th>
+        <td>&nbsp;</td>
+        <td width="50%">
+            By default shows a list of current and upcoming events that are set to accept 
+            registrations. The added "page" parameter can be used to specify the desired
+            registrations page. 
+        </td>
+    </tr>
+    <tr>
+        <td>&nbsp;</td>
+        <th>page="{registrations page}"</th>
+        <td>
+            The "page" attribute is used to select the registrations page that should be
+            produced. Below is a list of possible pages.
+            <p>
+                <table width="100%">
+                    <tr><th colspan=3">List Types</th></tr>
+                    <tr><td>(none)</td><td>Default page - same as "list" below</td></tr>
+                    <tr><td>list</td><td>List of events available for registration</td></tr>
+                    <tr><td>select</td><td>Registration selection for a particular event</td></tr>
+                    <tr><td>cart</td><td>Cart page (if logged in there may more more than one that could be displayed)</td></tr>
+                    <tr><td>checkout</td><td>Checkout page for selected cart</td></tr>
+                    <tr><td>summary</td><td>Successful checkout summary</td></tr>
+                    <tr><td>login</td><td>Account Login page</td></tr>
+                    <tr><td>account</td><td>Account dashboard page</td></tr>
+                </table>
+            </p>
 
+        </td>
+    </tr>
+    <tr>
+        <td>&nbsp;</td>
+        <th>cart="{ID of a specific cart}"</th>
+        <td>
+            The "cart" attribute is used to specify the ID of a particular user cart. 
+            Note that if a user is logged in to a registrations "account", that they may have one 
+            or more completed carts and one or more carts in progress. 
+        </td>
+    </tr>
+    <tr>
+        <td>&nbsp;</td>
+        <th>event="{event ID or event code}"</th>
+        <td>
+            The "event" attribute is used to specify the ID of an event for registration. 
+            This may also be the "event code" for an event that offers registrations.
+        </td>
+    </tr>
+    <tr>
+        <td>&nbsp;</td>
+        <th>datetime="{date/time ID}"</th>
+        <td>
+            This specifies the ID of a specific date/time instance for date and time specific events.
+            This ID must match an existing ID in the schedule for the event as set by and "Event Schedule" in
+            the Events plugin.
+        </td>
+    </tr>
+    <tr>
+        <td>&nbsp;</td>
+        <th>date="{a text date}"</th>
+        <td>
+            A date string used to search for matching event instances, primarily for the "Registrations List" page.
+            This can be used to list the times for all events that can take reservations on that date or 
+            can be used along with the "event" ID attribute to list all times on that date for the specified
+            event. Additionally both "date" and "time" can be used to together to list all occurances on a 
+            specific date and at a specific time.
+        </td>
+    </tr>
+    <tr>
+        <td>&nbsp;</td>
+        <th>time="{a text time}"</th>
+        <td>
+            A time string used to search for matching event instances, primarily for the "Registrations List" page.
+            This can be used to list the dates for all events that can take reservations at that particular time of day or 
+            can be used along with the "event" ID attribute to list all dates for that time for the specified
+            event. Additionally both "date" and "time" can be used to together to list all occurances on a 
+            specific date and at a specific time.
+        </td>
+    </tr>
+    <tr>
+        <td>&nbsp;</td>
+        <th>account="{ID of a specific user account}"</th>
+        <td>
+            This is the ID of a specific registration user account. Registration "accounts" hold information on 
+            a particular person. That person/account may have been registered for one or more event or may have
+            submitted one or more registreation carts.<br>
+            This is primarily used to specify the 
+            currently logged-in account, but it is more likely to be obtained from currently logged-in
+            information that is stored along with some type of browser storage or session. Use of an account
+            that is not currently logged in may be permitted in some restricted cases.  
+        </td>
+    </tr>
+';
index 208e067..37c0f22 100644 (file)
@@ -61,27 +61,23 @@ $glmMembersRegistrationsAddOnValidActions = array(
     'adminActions' => array(
         'registrations' => array(
             'index'                     => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-            'list'                      => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
             'events'                    => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-            'accounts'                  => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-            'requests'                  => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG
+            'requests'                  => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+            'accounts'                  => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG
         ),
         'management' => array(
             'registrations'             => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-            'regterms'                  => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+            'regterms'                  => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG
         ),
         'settings' => array(
             'registrationsPaymentCode'  => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-            'registrationsMisc'         => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+            'registrationsMisc'         => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG
         ),
     ),
     'frontActions' => array(
         'registrations' => array(
-            'registrationSummary'           => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-            'registrationAccountSummary'    => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-            'registrationSelect'            => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-            'registrationCheckout'          => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-            'registrationCart'              => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+            'index'                     => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG
+         
         )
     ),
 );
index 81189e2..dd1262c 100644 (file)
@@ -18,7 +18,8 @@ die('uninstall not configured - See plugin uninstall.php script!');
 
 // Check that we're being called by WordPress.
 if (!defined('ABSPATH')) {
-    die("Please do not call this code directly!");
+    header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html");
+    die();
 }
 
 //if uninstall not called from WordPress exit
diff --git a/views/admin/registrations/accountEdit.html b/views/admin/registrations/accountEdit.html
new file mode 100644 (file)
index 0000000..58f9a2d
--- /dev/null
@@ -0,0 +1,515 @@
+{include file='admin/registrations/header.html'}
+
+    <a href="{$thisUrl}?page={$thisPage}&glm_action=accounts"
+       class="button button-secondary glm-button glm-right">Return to Account List</a>
+
+  {if $option == 'edit' || $option == 'update'}
+    <a id="deleteAccountButton" class="button button-secondary glm-button glm-right">Delete this Account</a>
+    <div id="deleteAccountDialog" class="glm-dialog-box" title="Delete Account">
+        <center>
+            <p><a id="deleteAccountCancel" class="button button-primary">Cancel</a></p>
+            <p><input id="deleteAccountSubmit" type="submit" value="Delete this contact"></p>
+        </center>
+        <div class="glm-item-container">
+            <p><center><span class="glm-error">WARNING:</span></center></p>
+            <p>
+                <span class="glm-warning">Clicking the "Delete this Account" button above will
+                delete all of the data and images associated with this contact.
+                </span>
+            </p>
+            <p>
+                <span class="glm-error">Once deleted, this information will no longer be available and cannot be retrieved!</span>
+            </p>
+        </div>
+    </div>
+    <h2>Edit Account
+  {else}
+    <h2>Add new Account
+  {/if}
+        &nbsp;&nbsp;&nbsp;
+        {if $accountUpdated}<span class="glm-notice glm-flash-updated">Account Updated</span>{/if}
+        {if $accountUpdateError}<span class="glm-error glm-flash-updated">Account Update Error</span>{/if}
+        {if $accountAdded}<span class="glm-notice glm-flash-updated">Account Added</span>{/if}
+        {if $accountAddError}<span class="glm-error glm-flash-updated">Account Add Error</span>{/if}
+    </h2>
+
+
+    <form action="{$thisUrl}?page={$thisPage}" method="post" id="searchForm">
+        <input type="hidden" name="glm_action" value="accounts">
+    {if $haveAccount}
+        <input type="hidden" name="option" value="update">
+        <input type="hidden" name="account" value="{$accountID}">
+    {else}
+        <input type="hidden" name="option" value="insert">
+    {/if}
+        <input type="hidden" name="contact_id" value="0">
+        <table id="glm-table-account" class="glm-admin-table glm-account-table">
+
+        <tr>
+            <th {if $account.fieldRequired.date_created} class="glm-required"}{/if}>Date Created</th>
+            <td {if $account.fieldFail.date_created}class="glm-form-bad-input" data-tabid="glm-date-created"{/if}>
+            {$account.fieldData.date_created.timestamp|date_format:"%D"}
+            <input type="hidden" name="date_created" value="{$account.fieldData.date_created.timestamp|date_format:"%D"}">
+            {if $account.fieldFail.date_created}<p>{$account.fieldFail.date_created}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.user_trace_info} class="glm-required"}{/if}>User Trace Info</th>
+            <td {if $account.fieldFail.user_trace_info}class="glm-form-bad-input" data-tabid="glm-user-trace-info"{/if}>
+            {$account.fieldData.user_trace_info}
+            {if $account.fieldFail.user_trace_info}<p>{$account.fieldFail.user_trace_info}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.member_id} class="glm-required"}{/if}>Member ID</th>
+            <td {if $account.fieldFail.member_id}class="glm-form-bad-input" data-tabid="glm-member-id"{/if}>
+                <input type="text" name="member_id" value="{$account.fieldData.member_id}" class="glm-form-text-input-short">
+            {if $account.fieldFail.member_id}<p>{$account.fieldFail.member_id}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.active} class="glm-required"}{/if}>Active</th>
+            <td {if $account.fieldFail.active}class="glm-form-bad-input" data-tabid="glm-active"{/if}>
+                <input type="checkbox" name="active" {if $account.fieldData.active.value} checked{/if}>
+            {if $account.fieldFail.active}<p>{$account.fieldFail.active}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr><th colspan="2"><h3>General Information</h3></th></tr>
+
+        <tr>
+            <th {if $account.fieldRequired.fname} class="glm-required"}{/if}>First Name</th>
+            <td {if $account.fieldFail.fname}class="glm-form-bad-input" data-tabid="glm-fname"{/if}>
+                <input type="text" name="fname" value="{$account.fieldData.fname}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.fname}<p>{$account.fieldFail.fname}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.lname} class="glm-required"}{/if}>Last Name</th>
+            <td {if $account.fieldFail.lname}class="glm-form-bad-input" data-tabid="glm-lname"{/if}>
+                <input type="text" name="lname" value="{$account.fieldData.lname}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.lname}<p>{$account.fieldFail.lname}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.org} class="glm-required"}{/if}>Organization</th>
+            <td {if $account.fieldFail.org}class="glm-form-bad-input" data-tabid="glm-org"{/if}>
+                <input type="text" name="org" value="{$account.fieldData.org}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.org}<p>{$account.fieldFail.org}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.title} class="glm-required"}{/if}>Title</th>
+            <td {if $account.fieldFail.title}class="glm-form-bad-input" data-tabid="glm-title"{/if}>
+                <input type="text" name="title" value="{$account.fieldData.title}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.title}<p>{$account.fieldFail.title}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.addr1} class="glm-required"}{/if}>Address 1</th>
+            <td {if $account.fieldFail.addr1}class="glm-form-bad-input" data-tabid="glm-addr1"{/if}>
+                <input type="text" name="addr1" value="{$account.fieldData.addr1}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.addr1}<p>{$account.fieldFail.addr1}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.addr2} class="glm-required"}{/if}>Address 2</th>
+            <td {if $account.fieldFail.addr2}class="glm-form-bad-input" data-tabid="glm-addr2"{/if}>
+                <input type="text" name="addr2" value="{$account.fieldData.addr2}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.addr2}<p>{$account.fieldFail.addr2}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.city} class="glm-required"}{/if}>City</th>
+            <td {if $account.fieldFail.city}class="glm-form-bad-input" data-tabid="glm-city"{/if}>
+                <input type="text" name="city" value="{$account.fieldData.city}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.city}<p>{$account.fieldFail.city}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.state} class="glm-required"}{/if}>State</th>
+            <td {if $account.fieldFail.state}class="glm-form-bad-input" data-tabid="glm-state"{/if}>
+                <input type="text" name="state" value="{$account.fieldData.state}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.state}<p>{$account.fieldFail.state}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.zip} class="glm-required"}{/if}>ZIP</th>
+            <td {if $account.fieldFail.zip}class="glm-form-bad-input" data-tabid="glm-zip"{/if}>
+                <input type="text" name="zip" value="{$account.fieldData.zip}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.zip}<p>{$account.fieldFail.zip}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.country} class="glm-required"}{/if}>Country</th>
+            <td {if $account.fieldFail.country}class="glm-form-bad-input" data-tabid="glm-country"{/if}>
+                <input type="text" name="country" value="{$account.fieldData.country}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.country}<p>{$account.fieldFail.country}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.phone} class="glm-required"}{/if}>Phone</th>
+            <td {if $account.fieldFail.phone}class="glm-form-bad-input" data-tabid="glm-phone"{/if}>
+                <input type="text" name="phone" value="{$account.fieldData.phone}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.phone}<p>{$account.fieldFail.phone}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.fax} class="glm-required"}{/if}>Fax</th>
+            <td {if $account.fieldFail.fax}class="glm-form-bad-input" data-tabid="glm-fax"{/if}>
+                <input type="text" name="fax" value="{$account.fieldData.fax}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.fax}<p>{$account.fieldFail.fax}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr><th colspan="2"><h3>Billing Information</h3></th></tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_fname} class="glm-required"}{/if}>First Name</th>
+            <td {if $account.fieldFail.bill_fname}class="glm-form-bad-input" data-tabid="glm-bill-fname"{/if}>
+                <input type="text" name="bill_fname" value="{$account.fieldData.bill_fname}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_fname}<p>{$account.fieldFail.bill_fname}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_lname} class="glm-required"}{/if}>Last Name</th>
+            <td {if $account.fieldFail.bill_lname}class="glm-form-bad-input" data-tabid="glm-bill-lname"{/if}>
+                <input type="text" name="bill_lname" value="{$account.fieldData.bill_lname}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_lname}<p>{$account.fieldFail.bill_lname}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_org} class="glm-required"}{/if}>Organization</th>
+            <td {if $account.fieldFail.bill_org}class="glm-form-bad-input" data-tabid="glm-bill-org"{/if}>
+                <input type="text" name="bill_org" value="{$account.fieldData.bill_org}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_org}<p>{$account.fieldFail.bill_org}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_title} class="glm-required"}{/if}>Title</th>
+            <td {if $account.fieldFail.bill_title}class="glm-form-bad-input" data-tabid="glm-bill-title"{/if}>
+                <input type="text" name="bill_title" value="{$account.fieldData.bill_title}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_title}<p>{$account.fieldFail.bill_title}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_addr1} class="glm-required"}{/if}>Address 1</th>
+            <td {if $account.fieldFail.bill_addr1}class="glm-form-bad-input" data-tabid="glm-bill-addr1"{/if}>
+                <input type="text" name="bill_addr1" value="{$account.fieldData.bill_addr1}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_addr1}<p>{$account.fieldFail.bill_addr1}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_addr2} class="glm-required"}{/if}>Address 2</th>
+            <td {if $account.fieldFail.bill_addr2}class="glm-form-bad-input" data-tabid="glm-bill-addr2"{/if}>
+                <input type="text" name="bill_addr2" value="{$account.fieldData.bill_addr2}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_addr2}<p>{$account.fieldFail.bill_addr2}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_city} class="glm-required"}{/if}>City</th>
+            <td {if $account.fieldFail.bill_city}class="glm-form-bad-input" data-tabid="glm-bill-city"{/if}>
+                <input type="text" name="bill_city" value="{$account.fieldData.bill_city}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_city}<p>{$account.fieldFail.bill_city}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_state} class="glm-required"}{/if}>State</th>
+            <td {if $account.fieldFail.bill_state}class="glm-form-bad-input" data-tabid="glm-bill-state"{/if}>
+                <input type="text" name="bill_state" value="{$account.fieldData.bill_state}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_state}<p>{$account.fieldFail.bill_state}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_zip} class="glm-required"}{/if}>ZIP</th>
+            <td {if $account.fieldFail.bill_zip}class="glm-form-bad-input" data-tabid="glm-bill-zip"{/if}>
+                <input type="text" name="bill_zip" value="{$account.fieldData.bill_zip}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_zip}<p>{$account.fieldFail.bill_zip}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_country} class="glm-required"}{/if}>Country</th>
+            <td {if $account.fieldFail.bill_country}class="glm-form-bad-input" data-tabid="glm-bill-country"{/if}>
+                <input type="text" name="bill_country" value="{$account.fieldData.bill_country}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_country}<p>{$account.fieldFail.bill_country}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_phone} class="glm-required"}{/if}>Phone</th>
+            <td {if $account.fieldFail.bill_phone}class="glm-form-bad-input" data-tabid="glm-bill-phone"{/if}>
+                <input type="text" name="bill_phone" value="{$account.fieldData.bill_phone}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_phone}<p>{$account.fieldFail.bill_phone}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.bill_fax} class="glm-required"}{/if}>Fax</th>
+            <td {if $account.fieldFail.bill_fax}class="glm-form-bad-input" data-tabid="glm-bill-fax"{/if}>
+                <input type="text" name="bill_fax" value="{$account.fieldData.bill_fax}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.bill_fax}<p>{$account.fieldFail.bill_fax}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.email} class="glm-required"}{/if}>Email</th>
+            <td {if $account.fieldFail.email}class="glm-form-bad-input" data-tabid="glm-email"{/if}>
+                <input type="text" name="email" value="{$account.fieldData.email}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.email}<p>{$account.fieldFail.email}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.password} class="glm-required"}{/if}>Login Password</th>
+            <td {if $account.fieldFail.password}class="glm-form-bad-input" data-tabid="glm-password"{/if}>
+                <input type="text" name="password" value="{$account.fieldData.password}" class="glm-form-text-input-medium" placeholder="{if $option=='create'}(no spaces permitted){else}(Password does not show, only enter to change password.){/if}">
+                {if $option == 'create'}
+                    <span class="glm-notice">Save this password.</span>
+                    <br>A randomly generated password has been supplied. You may change this as desired.
+                    There is no way to view a password once it's set. However, a user may recover a password using their
+                    Email address at the login page.
+                {else}
+                    <br>NOTE: Enter a password here <b><i>only</i></b> if you need to change it.
+                {/if}
+                    <br>The password must be at least 8 characters and include at least one number, one letter, and at least one
+                    special character. (# . - _ , $ % & !)</b>
+            {if $account.fieldFail.password}<p>{$account.fieldFail.password}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.email_ok} class="glm-required"}{/if}>Email OK?</th>
+            <td {if $account.fieldFail.email_ok}class="glm-form-bad-input" data-tabid="glm-email-ok"{/if}>
+                <input type="checkbox" name="email_ok" {if $account.fieldData.email_ok.value} checked{/if}>
+            {if $account.fieldFail.email_ok}<p>{$account.fieldFail.email_ok}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.is_member} class="glm-required"}{/if}>Is Member?</th>
+            <td {if $account.fieldFail.is_member}class="glm-form-bad-input" data-tabid="glm-is-member"{/if}>
+                <input type="checkbox" name="is_member" {if $account.fieldData.is_member.value} checked{/if}>
+            {if $account.fieldFail.is_member}<p>{$account.fieldFail.is_member}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr><th colspan="2"><h3>Contact Information</h3></th></tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_fname} class="glm-required"}{/if}>First Name</th>
+            <td {if $account.fieldFail.contact_fname}class="glm-form-bad-input" data-tabid="glm-contact-fname"{/if}>
+                <input type="text" name="contact_fname" value="{$account.fieldData.contact_fname}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_fname}<p>{$account.fieldFail.contact_fname}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_lname} class="glm-required"}{/if}>Last Name</th>
+            <td {if $account.fieldFail.contact_lname}class="glm-form-bad-input" data-tabid="glm-contact-lname"{/if}>
+                <input type="text" name="contact_lname" value="{$account.fieldData.contact_lname}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_lname}<p>{$account.fieldFail.contact_lname}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_org} class="glm-required"}{/if}>Organization</th>
+            <td {if $account.fieldFail.contact_org}class="glm-form-bad-input" data-tabid="glm-contact-org"{/if}>
+                <input type="text" name="contact_org" value="{$account.fieldData.contact_org}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_org}<p>{$account.fieldFail.contact_org}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_title} class="glm-required"}{/if}>Title</th>
+            <td {if $account.fieldFail.contact_title}class="glm-form-bad-input" data-tabid="glm-contact-title"{/if}>
+                <input type="text" name="contact_title" value="{$account.fieldData.contact_title}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_title}<p>{$account.fieldFail.contact_title}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_addr1} class="glm-required"}{/if}>Address 1</th>
+            <td {if $account.fieldFail.contact_addr1}class="glm-form-bad-input" data-tabid="glm-contact-addr1"{/if}>
+                <input type="text" name="contact_addr1" value="{$account.fieldData.contact_addr1}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_addr1}<p>{$account.fieldFail.contact_addr1}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_addr2} class="glm-required"}{/if}>Address 2</th>
+            <td {if $account.fieldFail.contact_addr2}class="glm-form-bad-input" data-tabid="glm-contact-addr2"{/if}>
+                <input type="text" name="contact_addr2" value="{$account.fieldData.contact_addr2}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_addr2}<p>{$account.fieldFail.contact_addr2}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_city} class="glm-required"}{/if}>City</th>
+            <td {if $account.fieldFail.contact_city}class="glm-form-bad-input" data-tabid="glm-contact-cite"{/if}>
+                <input type="text" name="contact_city" value="{$account.fieldData.contact_city}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_city}<p>{$account.fieldFail.contact_city}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_state} class="glm-required"}{/if}>State</th>
+            <td {if $account.fieldFail.contact_state}class="glm-form-bad-input" data-tabid="glm-contact-state"{/if}>
+                <input type="text" name="contact_state" value="{$account.fieldData.contact_state}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_state}<p>{$account.fieldFail.contact_state}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_zip} class="glm-required"}{/if}>ZIP</th>
+            <td {if $account.fieldFail.contact_zip}class="glm-form-bad-input" data-tabid="glm-contact-zip"{/if}>
+                <input type="text" name="contact_zip" value="{$account.fieldData.contact_zip}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_zip}<p>{$account.fieldFail.contact_zip}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_country} class="glm-required"}{/if}>Country</th>
+            <td {if $account.fieldFail.contact_country}class="glm-form-bad-input" data-tabid="glm-contact-country"{/if}>
+                <input type="text" name="contact_country" value="{$account.fieldData.contact_country}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_country}<p>{$account.fieldFail.contact_country}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_phone} class="glm-required"}{/if}>Contact Phone</th>
+            <td {if $account.fieldFail.contact_phone}class="glm-form-bad-input" data-tabid="glm-contact-phone"{/if}>
+                <input type="text" name="contact_phone" value="{$account.fieldData.contact_phone}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_phone}<p>{$account.fieldFail.contact_phone}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_fax} class="glm-required"}{/if}>Contact Fax</th>
+            <td {if $account.fieldFail.contact_fax}class="glm-form-bad-input" data-tabid="glm-contact-fax"{/if}>
+                <input type="text" name="contact_fax" value="{$account.fieldData.contact_fax}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_fax}<p>{$account.fieldFail.contact_fax}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_email} class="glm-required"}{/if}>Contact Email</th>
+            <td {if $account.fieldFail.contact_email}class="glm-form-bad-input" data-tabid="glm-contact-email"{/if}>
+                <input type="text" name="contact_email" value="{$account.fieldData.contact_email}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.contact_email}<p>{$account.fieldFail.contact_email}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.contact_email_ok} class="glm-required"}{/if}>Contact Email OK?</th>
+            <td {if $account.fieldFail.contact_email_ok}class="glm-form-bad-input" data-tabid="glm-contact-email-ok"{/if}>
+                <input type="checkbox" name="contact_email_ok" {if $account.fieldData.contact_email_ok.value} checked{/if}>
+            {if $account.fieldFail.contact_email_ok}<p>{$account.fieldFail.contact_email_ok}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.guardian} class="glm-required"}{/if}>Guardian</th>
+            <td {if $account.fieldFail.guardian}class="glm-form-bad-input" data-tabid="glm-guardian"{/if}>
+                <input type="text" name="guardian" value="{$account.fieldData.guardian}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.guardian}<p>{$account.fieldFail.guardian}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr><th colspan="2"><h3>Emergency Contact Information</h3></th></tr>
+
+
+        <tr>
+            <th {if $account.fieldRequired.emer_contact} class="glm-required"}{/if}>Emergency Contact</th>
+            <td {if $account.fieldFail.emer_contact}class="glm-form-bad-input" data-tabid="glm-emer-contact"{/if}>
+                <input type="text" name="emer_contact" value="{$account.fieldData.emer_contact}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.emer_contact}<p>{$account.fieldFail.emer_contact}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.emer_phone} class="glm-required"}{/if}>Emergency Phone</th>
+            <td {if $account.fieldFail.emer_phone}class="glm-form-bad-input" data-tabid="glm-emer-phone"{/if}>
+                <input type="text" name="emer_phone" value="{$account.fieldData.emer_phone}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.emer_phone}<p>{$account.fieldFail.emer_phone}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.med_history} class="glm-required"}{/if}>Medical History</th>
+            <td {if $account.fieldFail.med_history}class="glm-form-bad-input" data-tabid="glm-med-history"{/if}>
+                <input type="text" name="med_history" value="{$account.fieldData.med_history}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.med_history}<p>{$account.fieldFail.med_history}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.allergy_med} class="glm-required"}{/if}>Allergy Medication</th>
+            <td {if $account.fieldFail.allergy_med}class="glm-form-bad-input" data-tabid="glm-allergy-med"{/if}>
+                <input type="text" name="allergy_med" value="{$account.fieldData.allergy_med}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.allergy_med}<p>{$account.fieldFail.allergy_med}</p>{/if}<br>
+            </td>
+        </tr>
+
+        <tr>
+            <th {if $account.fieldRequired.notes} class="glm-required"}{/if}>Notes</th>
+            <td {if $account.fieldFail.notes}class="glm-form-bad-input" data-tabid="glm-notes"{/if}>
+            <textarea name="notes" class="glm-form-textarea">{$account.fieldData.notes}</textarea>
+            {if $account.fieldFail.notes}
+                <p>{$account.fieldFail.notes}</p>
+            {/if}<br>
+            </td>
+        </tr>
+
+        </table>
+
+        <input id="updateAccount" type="submit" value="{if $haveAccount}Update Account{else}Save New Account{/if}">
+
+    </form>
+    <script>
+        jQuery(document).ready(function($) {
+
+            // Delete Account dialog
+            $("#deleteAccountDialog").dialog({
+                autoOpen: false,
+                minWidth: 400,
+                dialogClass: "glm-dialog-no-close"
+            });
+            $('#deleteAccountButton').click( function() {
+                $('#deleteAccountDialog').dialog('open');
+            });
+            $('#deleteAccountCancel').click( function() {
+                $("#deleteAccountDialog").dialog("close");
+            });
+            $('#deleteAccountSubmit').click( function() {
+                window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=accounts&option=delete&account={$account.fieldData.id}");
+            });
+
+            $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
+        });
+
+    </script>
+
+{include file='admin/footer.html'}
diff --git a/views/admin/registrations/editAccount.html b/views/admin/registrations/editAccount.html
deleted file mode 100644 (file)
index 58f9a2d..0000000
+++ /dev/null
@@ -1,515 +0,0 @@
-{include file='admin/registrations/header.html'}
-
-    <a href="{$thisUrl}?page={$thisPage}&glm_action=accounts"
-       class="button button-secondary glm-button glm-right">Return to Account List</a>
-
-  {if $option == 'edit' || $option == 'update'}
-    <a id="deleteAccountButton" class="button button-secondary glm-button glm-right">Delete this Account</a>
-    <div id="deleteAccountDialog" class="glm-dialog-box" title="Delete Account">
-        <center>
-            <p><a id="deleteAccountCancel" class="button button-primary">Cancel</a></p>
-            <p><input id="deleteAccountSubmit" type="submit" value="Delete this contact"></p>
-        </center>
-        <div class="glm-item-container">
-            <p><center><span class="glm-error">WARNING:</span></center></p>
-            <p>
-                <span class="glm-warning">Clicking the "Delete this Account" button above will
-                delete all of the data and images associated with this contact.
-                </span>
-            </p>
-            <p>
-                <span class="glm-error">Once deleted, this information will no longer be available and cannot be retrieved!</span>
-            </p>
-        </div>
-    </div>
-    <h2>Edit Account
-  {else}
-    <h2>Add new Account
-  {/if}
-        &nbsp;&nbsp;&nbsp;
-        {if $accountUpdated}<span class="glm-notice glm-flash-updated">Account Updated</span>{/if}
-        {if $accountUpdateError}<span class="glm-error glm-flash-updated">Account Update Error</span>{/if}
-        {if $accountAdded}<span class="glm-notice glm-flash-updated">Account Added</span>{/if}
-        {if $accountAddError}<span class="glm-error glm-flash-updated">Account Add Error</span>{/if}
-    </h2>
-
-
-    <form action="{$thisUrl}?page={$thisPage}" method="post" id="searchForm">
-        <input type="hidden" name="glm_action" value="accounts">
-    {if $haveAccount}
-        <input type="hidden" name="option" value="update">
-        <input type="hidden" name="account" value="{$accountID}">
-    {else}
-        <input type="hidden" name="option" value="insert">
-    {/if}
-        <input type="hidden" name="contact_id" value="0">
-        <table id="glm-table-account" class="glm-admin-table glm-account-table">
-
-        <tr>
-            <th {if $account.fieldRequired.date_created} class="glm-required"}{/if}>Date Created</th>
-            <td {if $account.fieldFail.date_created}class="glm-form-bad-input" data-tabid="glm-date-created"{/if}>
-            {$account.fieldData.date_created.timestamp|date_format:"%D"}
-            <input type="hidden" name="date_created" value="{$account.fieldData.date_created.timestamp|date_format:"%D"}">
-            {if $account.fieldFail.date_created}<p>{$account.fieldFail.date_created}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.user_trace_info} class="glm-required"}{/if}>User Trace Info</th>
-            <td {if $account.fieldFail.user_trace_info}class="glm-form-bad-input" data-tabid="glm-user-trace-info"{/if}>
-            {$account.fieldData.user_trace_info}
-            {if $account.fieldFail.user_trace_info}<p>{$account.fieldFail.user_trace_info}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.member_id} class="glm-required"}{/if}>Member ID</th>
-            <td {if $account.fieldFail.member_id}class="glm-form-bad-input" data-tabid="glm-member-id"{/if}>
-                <input type="text" name="member_id" value="{$account.fieldData.member_id}" class="glm-form-text-input-short">
-            {if $account.fieldFail.member_id}<p>{$account.fieldFail.member_id}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.active} class="glm-required"}{/if}>Active</th>
-            <td {if $account.fieldFail.active}class="glm-form-bad-input" data-tabid="glm-active"{/if}>
-                <input type="checkbox" name="active" {if $account.fieldData.active.value} checked{/if}>
-            {if $account.fieldFail.active}<p>{$account.fieldFail.active}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr><th colspan="2"><h3>General Information</h3></th></tr>
-
-        <tr>
-            <th {if $account.fieldRequired.fname} class="glm-required"}{/if}>First Name</th>
-            <td {if $account.fieldFail.fname}class="glm-form-bad-input" data-tabid="glm-fname"{/if}>
-                <input type="text" name="fname" value="{$account.fieldData.fname}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.fname}<p>{$account.fieldFail.fname}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.lname} class="glm-required"}{/if}>Last Name</th>
-            <td {if $account.fieldFail.lname}class="glm-form-bad-input" data-tabid="glm-lname"{/if}>
-                <input type="text" name="lname" value="{$account.fieldData.lname}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.lname}<p>{$account.fieldFail.lname}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.org} class="glm-required"}{/if}>Organization</th>
-            <td {if $account.fieldFail.org}class="glm-form-bad-input" data-tabid="glm-org"{/if}>
-                <input type="text" name="org" value="{$account.fieldData.org}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.org}<p>{$account.fieldFail.org}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.title} class="glm-required"}{/if}>Title</th>
-            <td {if $account.fieldFail.title}class="glm-form-bad-input" data-tabid="glm-title"{/if}>
-                <input type="text" name="title" value="{$account.fieldData.title}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.title}<p>{$account.fieldFail.title}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.addr1} class="glm-required"}{/if}>Address 1</th>
-            <td {if $account.fieldFail.addr1}class="glm-form-bad-input" data-tabid="glm-addr1"{/if}>
-                <input type="text" name="addr1" value="{$account.fieldData.addr1}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.addr1}<p>{$account.fieldFail.addr1}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.addr2} class="glm-required"}{/if}>Address 2</th>
-            <td {if $account.fieldFail.addr2}class="glm-form-bad-input" data-tabid="glm-addr2"{/if}>
-                <input type="text" name="addr2" value="{$account.fieldData.addr2}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.addr2}<p>{$account.fieldFail.addr2}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.city} class="glm-required"}{/if}>City</th>
-            <td {if $account.fieldFail.city}class="glm-form-bad-input" data-tabid="glm-city"{/if}>
-                <input type="text" name="city" value="{$account.fieldData.city}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.city}<p>{$account.fieldFail.city}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.state} class="glm-required"}{/if}>State</th>
-            <td {if $account.fieldFail.state}class="glm-form-bad-input" data-tabid="glm-state"{/if}>
-                <input type="text" name="state" value="{$account.fieldData.state}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.state}<p>{$account.fieldFail.state}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.zip} class="glm-required"}{/if}>ZIP</th>
-            <td {if $account.fieldFail.zip}class="glm-form-bad-input" data-tabid="glm-zip"{/if}>
-                <input type="text" name="zip" value="{$account.fieldData.zip}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.zip}<p>{$account.fieldFail.zip}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.country} class="glm-required"}{/if}>Country</th>
-            <td {if $account.fieldFail.country}class="glm-form-bad-input" data-tabid="glm-country"{/if}>
-                <input type="text" name="country" value="{$account.fieldData.country}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.country}<p>{$account.fieldFail.country}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.phone} class="glm-required"}{/if}>Phone</th>
-            <td {if $account.fieldFail.phone}class="glm-form-bad-input" data-tabid="glm-phone"{/if}>
-                <input type="text" name="phone" value="{$account.fieldData.phone}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.phone}<p>{$account.fieldFail.phone}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.fax} class="glm-required"}{/if}>Fax</th>
-            <td {if $account.fieldFail.fax}class="glm-form-bad-input" data-tabid="glm-fax"{/if}>
-                <input type="text" name="fax" value="{$account.fieldData.fax}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.fax}<p>{$account.fieldFail.fax}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr><th colspan="2"><h3>Billing Information</h3></th></tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_fname} class="glm-required"}{/if}>First Name</th>
-            <td {if $account.fieldFail.bill_fname}class="glm-form-bad-input" data-tabid="glm-bill-fname"{/if}>
-                <input type="text" name="bill_fname" value="{$account.fieldData.bill_fname}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_fname}<p>{$account.fieldFail.bill_fname}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_lname} class="glm-required"}{/if}>Last Name</th>
-            <td {if $account.fieldFail.bill_lname}class="glm-form-bad-input" data-tabid="glm-bill-lname"{/if}>
-                <input type="text" name="bill_lname" value="{$account.fieldData.bill_lname}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_lname}<p>{$account.fieldFail.bill_lname}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_org} class="glm-required"}{/if}>Organization</th>
-            <td {if $account.fieldFail.bill_org}class="glm-form-bad-input" data-tabid="glm-bill-org"{/if}>
-                <input type="text" name="bill_org" value="{$account.fieldData.bill_org}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_org}<p>{$account.fieldFail.bill_org}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_title} class="glm-required"}{/if}>Title</th>
-            <td {if $account.fieldFail.bill_title}class="glm-form-bad-input" data-tabid="glm-bill-title"{/if}>
-                <input type="text" name="bill_title" value="{$account.fieldData.bill_title}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_title}<p>{$account.fieldFail.bill_title}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_addr1} class="glm-required"}{/if}>Address 1</th>
-            <td {if $account.fieldFail.bill_addr1}class="glm-form-bad-input" data-tabid="glm-bill-addr1"{/if}>
-                <input type="text" name="bill_addr1" value="{$account.fieldData.bill_addr1}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_addr1}<p>{$account.fieldFail.bill_addr1}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_addr2} class="glm-required"}{/if}>Address 2</th>
-            <td {if $account.fieldFail.bill_addr2}class="glm-form-bad-input" data-tabid="glm-bill-addr2"{/if}>
-                <input type="text" name="bill_addr2" value="{$account.fieldData.bill_addr2}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_addr2}<p>{$account.fieldFail.bill_addr2}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_city} class="glm-required"}{/if}>City</th>
-            <td {if $account.fieldFail.bill_city}class="glm-form-bad-input" data-tabid="glm-bill-city"{/if}>
-                <input type="text" name="bill_city" value="{$account.fieldData.bill_city}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_city}<p>{$account.fieldFail.bill_city}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_state} class="glm-required"}{/if}>State</th>
-            <td {if $account.fieldFail.bill_state}class="glm-form-bad-input" data-tabid="glm-bill-state"{/if}>
-                <input type="text" name="bill_state" value="{$account.fieldData.bill_state}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_state}<p>{$account.fieldFail.bill_state}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_zip} class="glm-required"}{/if}>ZIP</th>
-            <td {if $account.fieldFail.bill_zip}class="glm-form-bad-input" data-tabid="glm-bill-zip"{/if}>
-                <input type="text" name="bill_zip" value="{$account.fieldData.bill_zip}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_zip}<p>{$account.fieldFail.bill_zip}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_country} class="glm-required"}{/if}>Country</th>
-            <td {if $account.fieldFail.bill_country}class="glm-form-bad-input" data-tabid="glm-bill-country"{/if}>
-                <input type="text" name="bill_country" value="{$account.fieldData.bill_country}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_country}<p>{$account.fieldFail.bill_country}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_phone} class="glm-required"}{/if}>Phone</th>
-            <td {if $account.fieldFail.bill_phone}class="glm-form-bad-input" data-tabid="glm-bill-phone"{/if}>
-                <input type="text" name="bill_phone" value="{$account.fieldData.bill_phone}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_phone}<p>{$account.fieldFail.bill_phone}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.bill_fax} class="glm-required"}{/if}>Fax</th>
-            <td {if $account.fieldFail.bill_fax}class="glm-form-bad-input" data-tabid="glm-bill-fax"{/if}>
-                <input type="text" name="bill_fax" value="{$account.fieldData.bill_fax}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.bill_fax}<p>{$account.fieldFail.bill_fax}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.email} class="glm-required"}{/if}>Email</th>
-            <td {if $account.fieldFail.email}class="glm-form-bad-input" data-tabid="glm-email"{/if}>
-                <input type="text" name="email" value="{$account.fieldData.email}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.email}<p>{$account.fieldFail.email}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.password} class="glm-required"}{/if}>Login Password</th>
-            <td {if $account.fieldFail.password}class="glm-form-bad-input" data-tabid="glm-password"{/if}>
-                <input type="text" name="password" value="{$account.fieldData.password}" class="glm-form-text-input-medium" placeholder="{if $option=='create'}(no spaces permitted){else}(Password does not show, only enter to change password.){/if}">
-                {if $option == 'create'}
-                    <span class="glm-notice">Save this password.</span>
-                    <br>A randomly generated password has been supplied. You may change this as desired.
-                    There is no way to view a password once it's set. However, a user may recover a password using their
-                    Email address at the login page.
-                {else}
-                    <br>NOTE: Enter a password here <b><i>only</i></b> if you need to change it.
-                {/if}
-                    <br>The password must be at least 8 characters and include at least one number, one letter, and at least one
-                    special character. (# . - _ , $ % & !)</b>
-            {if $account.fieldFail.password}<p>{$account.fieldFail.password}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.email_ok} class="glm-required"}{/if}>Email OK?</th>
-            <td {if $account.fieldFail.email_ok}class="glm-form-bad-input" data-tabid="glm-email-ok"{/if}>
-                <input type="checkbox" name="email_ok" {if $account.fieldData.email_ok.value} checked{/if}>
-            {if $account.fieldFail.email_ok}<p>{$account.fieldFail.email_ok}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.is_member} class="glm-required"}{/if}>Is Member?</th>
-            <td {if $account.fieldFail.is_member}class="glm-form-bad-input" data-tabid="glm-is-member"{/if}>
-                <input type="checkbox" name="is_member" {if $account.fieldData.is_member.value} checked{/if}>
-            {if $account.fieldFail.is_member}<p>{$account.fieldFail.is_member}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr><th colspan="2"><h3>Contact Information</h3></th></tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_fname} class="glm-required"}{/if}>First Name</th>
-            <td {if $account.fieldFail.contact_fname}class="glm-form-bad-input" data-tabid="glm-contact-fname"{/if}>
-                <input type="text" name="contact_fname" value="{$account.fieldData.contact_fname}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_fname}<p>{$account.fieldFail.contact_fname}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_lname} class="glm-required"}{/if}>Last Name</th>
-            <td {if $account.fieldFail.contact_lname}class="glm-form-bad-input" data-tabid="glm-contact-lname"{/if}>
-                <input type="text" name="contact_lname" value="{$account.fieldData.contact_lname}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_lname}<p>{$account.fieldFail.contact_lname}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_org} class="glm-required"}{/if}>Organization</th>
-            <td {if $account.fieldFail.contact_org}class="glm-form-bad-input" data-tabid="glm-contact-org"{/if}>
-                <input type="text" name="contact_org" value="{$account.fieldData.contact_org}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_org}<p>{$account.fieldFail.contact_org}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_title} class="glm-required"}{/if}>Title</th>
-            <td {if $account.fieldFail.contact_title}class="glm-form-bad-input" data-tabid="glm-contact-title"{/if}>
-                <input type="text" name="contact_title" value="{$account.fieldData.contact_title}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_title}<p>{$account.fieldFail.contact_title}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_addr1} class="glm-required"}{/if}>Address 1</th>
-            <td {if $account.fieldFail.contact_addr1}class="glm-form-bad-input" data-tabid="glm-contact-addr1"{/if}>
-                <input type="text" name="contact_addr1" value="{$account.fieldData.contact_addr1}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_addr1}<p>{$account.fieldFail.contact_addr1}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_addr2} class="glm-required"}{/if}>Address 2</th>
-            <td {if $account.fieldFail.contact_addr2}class="glm-form-bad-input" data-tabid="glm-contact-addr2"{/if}>
-                <input type="text" name="contact_addr2" value="{$account.fieldData.contact_addr2}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_addr2}<p>{$account.fieldFail.contact_addr2}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_city} class="glm-required"}{/if}>City</th>
-            <td {if $account.fieldFail.contact_city}class="glm-form-bad-input" data-tabid="glm-contact-cite"{/if}>
-                <input type="text" name="contact_city" value="{$account.fieldData.contact_city}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_city}<p>{$account.fieldFail.contact_city}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_state} class="glm-required"}{/if}>State</th>
-            <td {if $account.fieldFail.contact_state}class="glm-form-bad-input" data-tabid="glm-contact-state"{/if}>
-                <input type="text" name="contact_state" value="{$account.fieldData.contact_state}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_state}<p>{$account.fieldFail.contact_state}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_zip} class="glm-required"}{/if}>ZIP</th>
-            <td {if $account.fieldFail.contact_zip}class="glm-form-bad-input" data-tabid="glm-contact-zip"{/if}>
-                <input type="text" name="contact_zip" value="{$account.fieldData.contact_zip}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_zip}<p>{$account.fieldFail.contact_zip}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_country} class="glm-required"}{/if}>Country</th>
-            <td {if $account.fieldFail.contact_country}class="glm-form-bad-input" data-tabid="glm-contact-country"{/if}>
-                <input type="text" name="contact_country" value="{$account.fieldData.contact_country}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_country}<p>{$account.fieldFail.contact_country}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_phone} class="glm-required"}{/if}>Contact Phone</th>
-            <td {if $account.fieldFail.contact_phone}class="glm-form-bad-input" data-tabid="glm-contact-phone"{/if}>
-                <input type="text" name="contact_phone" value="{$account.fieldData.contact_phone}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_phone}<p>{$account.fieldFail.contact_phone}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_fax} class="glm-required"}{/if}>Contact Fax</th>
-            <td {if $account.fieldFail.contact_fax}class="glm-form-bad-input" data-tabid="glm-contact-fax"{/if}>
-                <input type="text" name="contact_fax" value="{$account.fieldData.contact_fax}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_fax}<p>{$account.fieldFail.contact_fax}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_email} class="glm-required"}{/if}>Contact Email</th>
-            <td {if $account.fieldFail.contact_email}class="glm-form-bad-input" data-tabid="glm-contact-email"{/if}>
-                <input type="text" name="contact_email" value="{$account.fieldData.contact_email}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.contact_email}<p>{$account.fieldFail.contact_email}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.contact_email_ok} class="glm-required"}{/if}>Contact Email OK?</th>
-            <td {if $account.fieldFail.contact_email_ok}class="glm-form-bad-input" data-tabid="glm-contact-email-ok"{/if}>
-                <input type="checkbox" name="contact_email_ok" {if $account.fieldData.contact_email_ok.value} checked{/if}>
-            {if $account.fieldFail.contact_email_ok}<p>{$account.fieldFail.contact_email_ok}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.guardian} class="glm-required"}{/if}>Guardian</th>
-            <td {if $account.fieldFail.guardian}class="glm-form-bad-input" data-tabid="glm-guardian"{/if}>
-                <input type="text" name="guardian" value="{$account.fieldData.guardian}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.guardian}<p>{$account.fieldFail.guardian}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr><th colspan="2"><h3>Emergency Contact Information</h3></th></tr>
-
-
-        <tr>
-            <th {if $account.fieldRequired.emer_contact} class="glm-required"}{/if}>Emergency Contact</th>
-            <td {if $account.fieldFail.emer_contact}class="glm-form-bad-input" data-tabid="glm-emer-contact"{/if}>
-                <input type="text" name="emer_contact" value="{$account.fieldData.emer_contact}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.emer_contact}<p>{$account.fieldFail.emer_contact}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.emer_phone} class="glm-required"}{/if}>Emergency Phone</th>
-            <td {if $account.fieldFail.emer_phone}class="glm-form-bad-input" data-tabid="glm-emer-phone"{/if}>
-                <input type="text" name="emer_phone" value="{$account.fieldData.emer_phone}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.emer_phone}<p>{$account.fieldFail.emer_phone}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.med_history} class="glm-required"}{/if}>Medical History</th>
-            <td {if $account.fieldFail.med_history}class="glm-form-bad-input" data-tabid="glm-med-history"{/if}>
-                <input type="text" name="med_history" value="{$account.fieldData.med_history}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.med_history}<p>{$account.fieldFail.med_history}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.allergy_med} class="glm-required"}{/if}>Allergy Medication</th>
-            <td {if $account.fieldFail.allergy_med}class="glm-form-bad-input" data-tabid="glm-allergy-med"{/if}>
-                <input type="text" name="allergy_med" value="{$account.fieldData.allergy_med}" class="glm-form-text-input-medium">
-            {if $account.fieldFail.allergy_med}<p>{$account.fieldFail.allergy_med}</p>{/if}<br>
-            </td>
-        </tr>
-
-        <tr>
-            <th {if $account.fieldRequired.notes} class="glm-required"}{/if}>Notes</th>
-            <td {if $account.fieldFail.notes}class="glm-form-bad-input" data-tabid="glm-notes"{/if}>
-            <textarea name="notes" class="glm-form-textarea">{$account.fieldData.notes}</textarea>
-            {if $account.fieldFail.notes}
-                <p>{$account.fieldFail.notes}</p>
-            {/if}<br>
-            </td>
-        </tr>
-
-        </table>
-
-        <input id="updateAccount" type="submit" value="{if $haveAccount}Update Account{else}Save New Account{/if}">
-
-    </form>
-    <script>
-        jQuery(document).ready(function($) {
-
-            // Delete Account dialog
-            $("#deleteAccountDialog").dialog({
-                autoOpen: false,
-                minWidth: 400,
-                dialogClass: "glm-dialog-no-close"
-            });
-            $('#deleteAccountButton').click( function() {
-                $('#deleteAccountDialog').dialog('open');
-            });
-            $('#deleteAccountCancel').click( function() {
-                $("#deleteAccountDialog").dialog("close");
-            });
-            $('#deleteAccountSubmit').click( function() {
-                window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=accounts&option=delete&account={$account.fieldData.id}");
-            });
-
-            $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
-        });
-
-    </script>
-
-{include file='admin/footer.html'}
diff --git a/views/admin/registrations/editRequest.html b/views/admin/registrations/editRequest.html
deleted file mode 100644 (file)
index 3eeb609..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-
-{include file='admin/registrations/header.html'}
-
-    <div class="glm-right">
-        <p><a href="{$thisUrl}?page={$thisPage}&glm_action=requests&option=check&requestID={$cart.request.id}" class="button button-secondary glm-button">Check Reguest & Update Holds</a></p>
-    </div>
-
-  {if $option == 'edit' || $option == 'update'}
-*** Edit or Update ***<!--   
-    <a id="deleteAccountButton" class="button button-secondary glm-button glm-right">Delete this Account</a>
-    <div id="deleteAccountDialog" class="glm-dialog-box" title="Delete Account">
-        <center>
-            <p><a id="deleteAccountCancel" class="button button-primary">Cancel</a></p>
-            <p><input id="deleteAccountSubmit" type="submit" value="Delete this contact"></p>
-        </center>
-        <div class="glm-item-container">
-            <p><center><span class="glm-error">WARNING:</span></center></p>
-            <p>
-                <span class="glm-warning">Clicking the "Delete this Account" button above will
-                delete all of the data and images associated with this contact.
-                </span>
-            </p>
-            <p>
-                <span class="glm-error">Once deleted, this information will no longer be available and cannot be retrieved!</span>
-            </p>
-        </div>
-    </div>
-    <h2>Edit Account
--->    
-  {else}
-    {$req = $cart.request}
-  
-    <table class="glm-admin-table">
-        <tr>
-            <td>
-                <table class="glm-admin-table glm-account-table glm-admin-table-close-spaced">
-                    <tr><th>Request ID: </th><td>{$req.id}</td></tr>
-                    <tr><th>Date Submitted: </th><td>{$req.date_submitted.datetime}</td></tr>
-                    <tr><th>Status: </th><td>{$req.status.name}</td></tr>
-                </table>
-            </td>
-            <td>
-                <table id="glm-table-account" class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
-                    <tr><th><center>Billing Information</center></th></tr>
-                    <tr>
-                        <td>
-                            <table>
-                                <tr><th>Name: </th><td>{$req.bill_fname} {$req.bill_lname}{if $req.bill_title}, {$req.bill_title}{/if}</td></tr>
-                {if $req.bill_org}
-                                <tr><th>Organization: </th><td>{$req.bill_org}</td></tr>
-                {/if}
-                                <tr><th>Address: </th><td>{$req.bill_addr1}</td></tr>
-                {if $req.bill_addr2}
-                                <tr><th></th><td>{$req.bill_addr2}</td></tr>
-                {/if}
-                                <tr><th></th><td>{$req.bill_city}, {$req.bill_state} {$req.bill_zip} {$req.bill_country}</td></tr>
-                                <tr><th>Payment Method: </th><td>{$req.pay_method.name}</td></tr>
-                {if $req.status == 'CC_PAID'}
-                                <tr><th>Card Type: </th><td>{$req.cc_type.value}</td></tr>
-                                <tr><th>Card Number: </th><td>{$req.cc_numb}</td></tr>
-                                <tr><th>Confirmation: </th><td>{$req.cc_conf}</td></tr>
-                {/if}                    
-                            </table>
-                        </td>
-                    </tr>
-                </table>
-            </td>
-    {if $req.notes}
-            <td>
-                <table class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
-                    <tr><th><center>Notes</center></th></tr>
-                    <tr><td>{$req.notes}</td></tr>
-                </table>            
-            </td>
-    {/if}            
-        </tr>
-    <table class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
-        <tr><th><center>Registrations Selected</center></th></tr>
-        <tr>
-            <td>
-                <table>
-                    <tr><th>Event</th><th>Start Date/Time</th><th>Class</th><th>Rate</th><th>Credits<th>Registrants</th><th>Charge</th></tr>
-    {foreach $cart.events as $event}
-                    <tr>
-                        <td>{$event.event_name}</td><td>{$event.event_datetime.datetime}</td>
-                    </tr>
-        {foreach $event.classes as $class}
-                    <tr>
-                        <td colspan="2">&nbsp;</td><td>{$class.class_name}</td>
-                    </tr>
-            {foreach $class.rates as $rate}
-                    <tr>
-                        <td colspan="3">&nbsp;</td><td>{$rate.rate_name}</td><td>{$rate.registrant_credits}</td><td>&nbsp;</td><td align="right">{$rate.base_rate}</td>
-                    </tr>
-                {foreach $rate.registrants as $registrant}
-                    <tr>
-                        <td colspan="5">&nbsp;</td><td>{$registrant.fname} {$registrant.lname}</td><td align="right">{$rate.per_registrant}</td>
-                    </tr>
-                {/foreach}
-            {/foreach}
-        {/foreach}
-                    </tr>
-    {/foreach}                                
-                </table>
-            </td>
-        </tr>
-    </table>            
-    
-  {/if}
-
-{include file='admin/footer.html'}
diff --git a/views/admin/registrations/eventDashboard.html b/views/admin/registrations/eventDashboard.html
new file mode 100644 (file)
index 0000000..9a37798
--- /dev/null
@@ -0,0 +1,6 @@
+{include file='admin/registrations/header.html'}
+    
+<h3>Registrations Event Dashboard</h3>
+    
+{include file='admin/footer.html'}
+
diff --git a/views/admin/registrations/eventEdit.html b/views/admin/registrations/eventEdit.html
new file mode 100644 (file)
index 0000000..7bd2b66
--- /dev/null
@@ -0,0 +1,175 @@
+{include file='admin/registrations/header.html'}
+    
+       <h3>Registrations Event Edit</h3>
+
+
+{$x='event_name'}
+{$regEvent.fieldData.$x}
+
+
+{include 
+       'admin/registrations/text_input.html'
+       fieldName='event_name'
+       fieldPrompt='Event Name'
+       fieldValue=$regEvent.fieldData.event_name
+       fieldFail=$regEvent.fieldFail.event_name
+}
+
+
+{if $reason}
+       <p class="glm-error">{$reason}</p>
+{else}
+
+
+       <a href="{$thisUrl}?page={$thisPage}&glm_action=registrations&option=list"
+       class="button button-secondary glm-button glm-right">Return to Account List</a>
+       
+    <form action="{$thisUrl}?page={$thisPage}" method="post" id="regEventForm">
+           <input type="hidden" name="glm_action" value="registrations">
+           <input type="hidden" name="option" value="update">
+           <input type="hidden" name="regEvent" value="{$regEventId}">
+
+        <table id="glm-table-account" class="glm-admin-table">
+
+        <tr>
+            <th {if $regEvent.fieldRequired.event_name} class="glm-required"}{/if}>Event Name</th>
+            <td {if $regEvent.fieldFail.event_name}class="glm-form-bad-input" data-tabid="glm-event_name"{/if}>
+                <input type="text" name="event_name" value="{$regEvent.fieldData.event_name}" class="glm-form-text-input-medium">
+            {if $regEvent.fieldFail.event_name}<p>{$regEvent.fieldFail.event_name}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.event_code} class="glm-required"}{/if}>Event Registration Code</th>
+            <td {if $regEvent.fieldFail.event_code}class="glm-form-bad-input" data-tabid="glm-event_code"{/if}>
+                <input type="text" name="event_code" value="{$regEvent.fieldData.event_code}" class="glm-form-text-input-medium">
+            {if $regEvent.fieldFail.event_code}<p>{$regEvent.fieldFail.event_code}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.notify_email} class="glm-required"}{/if}>Notify E-Mail Address</th>
+            <td {if $regEvent.fieldFail.notify_email}class="glm-form-bad-input" data-tabid="glm-notify_email"{/if}>
+                <input type="text" name="notify_email" value="{$regEvent.fieldData.notify_email}" class="glm-form-text-input-medium">
+            {if $regEvent.fieldFail.notify_email}<p>{$regEvent.fieldFail.notify_email}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.admin_active} class="glm-required"}{/if}>Admin Active</th>
+            <td {if $regEvent.fieldFail.admin_active}class="glm-form-bad-input" data-tabid="glm-admin_active"{/if}>
+                <input type="checkbox" name="active" {if $regEvent.fieldData.admin_active.value} checked{/if}>
+            {if $regEvent.fieldFail.admin_active}<p>{$regEvent.fieldFail.admin_active}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.active} class="glm-required"}{/if}>Registrations Active</th>
+            <td {if $regEvent.fieldFail.active}class="glm-form-bad-input" data-tabid="glm-active"{/if}>
+                <input type="checkbox" name="active" {if $regEvent.fieldData.active.value} checked{/if}>
+            {if $regEvent.fieldFail.active}<p>{$regEvent.fieldFail.active}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.attendees} class="glm-required"}{/if}>Multiple Attendees per Submission</th>
+            <td {if $regEvent.fieldFail.attendees}class="glm-form-bad-input" data-tabid="glm-attendees"{/if}>
+                <input type="checkbox" name="active" {if $regEvent.fieldData.attendees.value} checked{/if}>
+            {if $regEvent.fieldFail.attendees}<p>{$regEvent.fieldFail.attendees}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.attendee_max} class="glm-required"}{/if}>Maximum # of Attendees</th>
+            <td {if $regEvent.fieldFail.attendee_max}class="glm-form-bad-input" data-tabid="glm-attendee_max"{/if}>
+                <input type="text" name="attendee_max" value="{$regEvent.fieldData.attendee_max}" class="glm-form-text-input-medium">
+            {if $regEvent.fieldFail.attendee_max}<p>{$regEvent.fieldFail.attendee_max}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.attendee_max_per_reg} class="glm-required"}{/if}>Maximum # of Attendees Per Submission</th>
+            <td {if $regEvent.fieldFail.attendee_max_per_reg}class="glm-form-bad-input" data-tabid="glm-attendee_max_per_reg"{/if}>
+                <input type="text" name="attendee_max_per_reg" value="{$regEvent.fieldData.attendee_max_per_reg}" class="glm-form-text-input-medium">
+            {if $regEvent.fieldFail.attendee_max_per_reg}<p>{$regEvent.fieldFail.attendee_max_per_reg}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.reg_hold_minutes} class="glm-required"}{/if}>Attendees in Cart Hold Time</th>
+            <td {if $regEvent.fieldFail.reg_hold_minutes}class="glm-form-bad-input" data-tabid="glm-reg_hold_minutes"{/if}>
+                <input type="text" name="reg_hold_minutes" value="{$regEvent.fieldData.reg_hold_minutes}" class="glm-form-text-input-medium">
+            {if $regEvent.fieldFail.reg_hold_minutes}<p>{$regEvent.fieldFail.reg_hold_minutes}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.cart_hold_days} class="glm-required"}{/if}>Cart Hold Days Without Checkout</th>
+            <td {if $regEvent.fieldFail.cart_hold_days}class="glm-form-bad-input" data-tabid="glm-cart_hold_days"{/if}>
+                <input type="text" name="cart_hold_days" value="{$regEvent.fieldData.cart_hold_days}" class="glm-form-text-input-medium">
+            {if $regEvent.fieldFail.cart_hold_days}<p>{$regEvent.fieldFail.cart_hold_days}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.registration_account_options} class="glm-required"}{/if}>Account Options</th>
+            <td {if $regEvent.fieldFail.registration_account_options}class="glm-form-bad-input" data-tabid="glm-registration_account_options"{/if}>
+    {foreach from=$regEvent.fieldData.registration_account_options.bitmap item=v}
+                    <input type="checkbox" name="cc_type[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
+    {/foreach}
+            {if $regEvent.fieldFail.registration_account_options}<p>{$regEvent.fieldFail.registration_account_options}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.payment_methods} class="glm-required"}{/if}>Payment Methods</th>
+            <td {if $regEvent.fieldFail.payment_methods}class="glm-form-bad-input" data-tabid="glm-payment_methods"{/if}>
+    {foreach from=$regEvent.fieldData.payment_methods.bitmap item=v}
+                    <input type="checkbox" name="cc_type[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
+    {/foreach}
+            {if $regEvent.fieldFail.payment_methods}<p>{$regEvent.fieldFail.payment_methods}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.resitricted_payment_methods} class="glm-required"}{/if}>Restricted Payment Methods (Admin use only)</th>
+            <td {if $regEvent.fieldFail.resitricted_payment_methods}class="glm-form-bad-input" data-tabid="glm-resitricted_payment_methods"{/if}>
+    {foreach from=$regEvent.fieldData.resitricted_payment_methods.bitmap item=v}
+                    <input type="checkbox" name="cc_type[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
+    {/foreach}
+            {if $regEvent.fieldFail.resitricted_payment_methods}<p>{$regEvent.fieldFail.resitricted_payment_methods}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.terms} class="glm-required"}{/if}>Terms and Conditions for Registration</th>
+            <td {if $regEvent.fieldFail.terms}class="glm-form-bad-input" data-tabid="glm-terms"{/if}>
+                   <textarea name="terms" class="glm-form-textarea">{$regEvent.fieldData.terms}</textarea>
+            {if $regEvent.fieldFail.terms}
+                <p>{$regEvent.fieldFail.terms}</p>
+            {/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.reg_file}class="glm-required"{/if}>File</th>
+            <td {if $regEvent.fieldFail.reg_file}class="glm-form-bad-input"{/if}>
+    {if $regEvent.fieldData.reg_file}
+                <span class="glm-right">Replace this file:</b> <input type="file" name="reg_file_new"></span>
+                <a href="{$glmPluginMediaUrl}/files/{$regEvent.fieldData.reg_file}" target="event_file">{$regEvent.fieldData.reg_file}</a>&nbsp;&nbsp;&nbsp;
+                <input type="checkbox" name="reg_file_delete"> Delete File<br>
+    {else}
+                New file:</b> <input type="file" name="reg_file_new">
+    {/if}
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.reg_file_title} class="glm-required"}{/if}>File Title</th>
+            <td {if $regEvent.fieldFail.reg_file_title}class="glm-form-bad-input" data-tabid="glm-reg_file_title"{/if}>
+                <input type="text" name="reg_file_title" value="{$regEvent.fieldData.reg_file_title}" class="glm-form-text-input-medium">
+            {if $regEvent.fieldFail.reg_file_title}<p>{$regEvent.fieldFail.reg_file_title}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $regEvent.fieldRequired.notes} class="glm-required"}{/if}>Notes</th>
+            <td {if $regEvent.fieldFail.notes}class="glm-form-bad-input" data-tabid="glm-notes"{/if}>
+                   <textarea name="notes" class="glm-form-textarea">{$regEvent.fieldData.notes}</textarea>
+            {if $regEvent.fieldFail.notes}
+                <p>{$regEvent.fieldFail.notes}</p>
+            {/if}<br>
+            </td>
+        </tr>
+        </table>
+    </form>
+    
+
+{/if} <!-- no problem reasons -->
+    
+{include file='admin/footer.html'}
+
diff --git a/views/admin/registrations/eventList.html b/views/admin/registrations/eventList.html
new file mode 100644 (file)
index 0000000..45c42e7
--- /dev/null
@@ -0,0 +1,6 @@
+{include file='admin/registrations/header.html'}
+    
+<h3>Registrations Event List</h3>
+    
+{include file='admin/footer.html'}
+
diff --git a/views/admin/registrations/events.html b/views/admin/registrations/events.html
deleted file mode 100644 (file)
index f32dffd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-{include file='admin/registrations/header.html'}
-    
-<h3>Registrations Events List</h3>
-    
-{include file='admin/footer.html'}
-
diff --git a/views/admin/registrations/requestEdit.html b/views/admin/registrations/requestEdit.html
new file mode 100644 (file)
index 0000000..3eeb609
--- /dev/null
@@ -0,0 +1,111 @@
+
+{include file='admin/registrations/header.html'}
+
+    <div class="glm-right">
+        <p><a href="{$thisUrl}?page={$thisPage}&glm_action=requests&option=check&requestID={$cart.request.id}" class="button button-secondary glm-button">Check Reguest & Update Holds</a></p>
+    </div>
+
+  {if $option == 'edit' || $option == 'update'}
+*** Edit or Update ***<!--   
+    <a id="deleteAccountButton" class="button button-secondary glm-button glm-right">Delete this Account</a>
+    <div id="deleteAccountDialog" class="glm-dialog-box" title="Delete Account">
+        <center>
+            <p><a id="deleteAccountCancel" class="button button-primary">Cancel</a></p>
+            <p><input id="deleteAccountSubmit" type="submit" value="Delete this contact"></p>
+        </center>
+        <div class="glm-item-container">
+            <p><center><span class="glm-error">WARNING:</span></center></p>
+            <p>
+                <span class="glm-warning">Clicking the "Delete this Account" button above will
+                delete all of the data and images associated with this contact.
+                </span>
+            </p>
+            <p>
+                <span class="glm-error">Once deleted, this information will no longer be available and cannot be retrieved!</span>
+            </p>
+        </div>
+    </div>
+    <h2>Edit Account
+-->    
+  {else}
+    {$req = $cart.request}
+  
+    <table class="glm-admin-table">
+        <tr>
+            <td>
+                <table class="glm-admin-table glm-account-table glm-admin-table-close-spaced">
+                    <tr><th>Request ID: </th><td>{$req.id}</td></tr>
+                    <tr><th>Date Submitted: </th><td>{$req.date_submitted.datetime}</td></tr>
+                    <tr><th>Status: </th><td>{$req.status.name}</td></tr>
+                </table>
+            </td>
+            <td>
+                <table id="glm-table-account" class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
+                    <tr><th><center>Billing Information</center></th></tr>
+                    <tr>
+                        <td>
+                            <table>
+                                <tr><th>Name: </th><td>{$req.bill_fname} {$req.bill_lname}{if $req.bill_title}, {$req.bill_title}{/if}</td></tr>
+                {if $req.bill_org}
+                                <tr><th>Organization: </th><td>{$req.bill_org}</td></tr>
+                {/if}
+                                <tr><th>Address: </th><td>{$req.bill_addr1}</td></tr>
+                {if $req.bill_addr2}
+                                <tr><th></th><td>{$req.bill_addr2}</td></tr>
+                {/if}
+                                <tr><th></th><td>{$req.bill_city}, {$req.bill_state} {$req.bill_zip} {$req.bill_country}</td></tr>
+                                <tr><th>Payment Method: </th><td>{$req.pay_method.name}</td></tr>
+                {if $req.status == 'CC_PAID'}
+                                <tr><th>Card Type: </th><td>{$req.cc_type.value}</td></tr>
+                                <tr><th>Card Number: </th><td>{$req.cc_numb}</td></tr>
+                                <tr><th>Confirmation: </th><td>{$req.cc_conf}</td></tr>
+                {/if}                    
+                            </table>
+                        </td>
+                    </tr>
+                </table>
+            </td>
+    {if $req.notes}
+            <td>
+                <table class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
+                    <tr><th><center>Notes</center></th></tr>
+                    <tr><td>{$req.notes}</td></tr>
+                </table>            
+            </td>
+    {/if}            
+        </tr>
+    <table class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
+        <tr><th><center>Registrations Selected</center></th></tr>
+        <tr>
+            <td>
+                <table>
+                    <tr><th>Event</th><th>Start Date/Time</th><th>Class</th><th>Rate</th><th>Credits<th>Registrants</th><th>Charge</th></tr>
+    {foreach $cart.events as $event}
+                    <tr>
+                        <td>{$event.event_name}</td><td>{$event.event_datetime.datetime}</td>
+                    </tr>
+        {foreach $event.classes as $class}
+                    <tr>
+                        <td colspan="2">&nbsp;</td><td>{$class.class_name}</td>
+                    </tr>
+            {foreach $class.rates as $rate}
+                    <tr>
+                        <td colspan="3">&nbsp;</td><td>{$rate.rate_name}</td><td>{$rate.registrant_credits}</td><td>&nbsp;</td><td align="right">{$rate.base_rate}</td>
+                    </tr>
+                {foreach $rate.registrants as $registrant}
+                    <tr>
+                        <td colspan="5">&nbsp;</td><td>{$registrant.fname} {$registrant.lname}</td><td align="right">{$rate.per_registrant}</td>
+                    </tr>
+                {/foreach}
+            {/foreach}
+        {/foreach}
+                    </tr>
+    {/foreach}                                
+                </table>
+            </td>
+        </tr>
+    </table>            
+    
+  {/if}
+
+{include file='admin/footer.html'}
diff --git a/views/admin/registrations/text_input.html b/views/admin/registrations/text_input.html
new file mode 100644 (file)
index 0000000..814d6fd
--- /dev/null
@@ -0,0 +1,8 @@
+
+
+
+<p>title = {$fieldPrompt}</p>
+<p>name = {$fieldName}</p>
+<p>value = {$fieldValue}</p>
+<p>fail = {$fieldFail}</p>
+
diff --git a/views/front/registrations/account.html b/views/front/registrations/account.html
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/views/front/registrations/cart.html b/views/front/registrations/cart.html
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/views/front/registrations/checkout.html b/views/front/registrations/checkout.html
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/views/front/registrations/list.html b/views/front/registrations/list.html
new file mode 100644 (file)
index 0000000..8eee247
--- /dev/null
@@ -0,0 +1 @@
+This is a list
\ No newline at end of file
diff --git a/views/front/registrations/login.html b/views/front/registrations/login.html
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/views/front/registrations/registrationAccountSummary.html b/views/front/registrations/registrationAccountSummary.html
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/views/front/registrations/registrationCart.html b/views/front/registrations/registrationCart.html
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/views/front/registrations/registrationCheckout.html b/views/front/registrations/registrationCheckout.html
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/views/front/registrations/registrationSelect.html b/views/front/registrations/registrationSelect.html
deleted file mode 100644 (file)
index 1f1f640..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<div class="glm-reg-event-list">
-    {foreach $events as $event}
-    <div class="glm-reg-event-item clearfix">
-        <h2>{$event.title}</h2>
-        <div class="glm-reg-compcode-entry">
-            <input type="text" placeholder="Enter Comp Code Here" />
-        </div>
-        <p>{$event.short_desc}</p>
-        <div class="glm-reg-entryforms clearfix">
-            <div class="glm-reg-dates">
-                <h4>Pick your registration dates</h4>
-                <input type="date" placeholder="Enter Date" />
-                <input type="text" placeholder="Enter Time" />
-            </div>
-            {foreach $event.levels as $level}
-            <div class="glm-reg-level">
-                <h3>{$level.title}</h3>
-                <span class="glm-reg-level-add-registrant">+</span>
-                {foreach $level.registrants as $reg}
-                <div class="glm-reg-level-registrant clearfix"><span class="glm-reg-level-registrant-name">{$reg.fname} {$reg.lname}</span> <span class="glm-reg-level-registrant-email">{$reg.email}</span></div>
-                {/foreach}
-            </div>
-            {/foreach}
-            <div class="glm-reg-submit">
-                <input type="submit" value="Continue to Cart" />
-            </div>
-        </div>
-    </div>
-    {/foreach}
-
-</div>
diff --git a/views/front/registrations/registrationSummary.html b/views/front/registrations/registrationSummary.html
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/views/front/registrations/select.html b/views/front/registrations/select.html
new file mode 100644 (file)
index 0000000..1f1f640
--- /dev/null
@@ -0,0 +1,31 @@
+<div class="glm-reg-event-list">
+    {foreach $events as $event}
+    <div class="glm-reg-event-item clearfix">
+        <h2>{$event.title}</h2>
+        <div class="glm-reg-compcode-entry">
+            <input type="text" placeholder="Enter Comp Code Here" />
+        </div>
+        <p>{$event.short_desc}</p>
+        <div class="glm-reg-entryforms clearfix">
+            <div class="glm-reg-dates">
+                <h4>Pick your registration dates</h4>
+                <input type="date" placeholder="Enter Date" />
+                <input type="text" placeholder="Enter Time" />
+            </div>
+            {foreach $event.levels as $level}
+            <div class="glm-reg-level">
+                <h3>{$level.title}</h3>
+                <span class="glm-reg-level-add-registrant">+</span>
+                {foreach $level.registrants as $reg}
+                <div class="glm-reg-level-registrant clearfix"><span class="glm-reg-level-registrant-name">{$reg.fname} {$reg.lname}</span> <span class="glm-reg-level-registrant-email">{$reg.email}</span></div>
+                {/foreach}
+            </div>
+            {/foreach}
+            <div class="glm-reg-submit">
+                <input type="submit" value="Continue to Cart" />
+            </div>
+        </div>
+    </div>
+    {/foreach}
+
+</div>
diff --git a/views/front/registrations/summary.html b/views/front/registrations/summary.html
new file mode 100644 (file)
index 0000000..e69de29