Registration info is outputting very rudimentary
authorLaury GvR <laury@gaslightmedia.com>
Wed, 17 May 2017 16:07:26 +0000 (12:07 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 17 May 2017 16:07:26 +0000 (12:07 -0400)
classes/data/dataRegEvent.php
models/admin/registrations/events.php
views/admin/registrations/events.html

index 03f05b6..5b9446f 100644 (file)
@@ -276,6 +276,24 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
         );
 
     }
+    /*
+     * Get packages list with member information not included option
+     *
+     * @param string $where Where for query
+     * @param string $orderBy How to order results
+     * @param boolean $noMemberWithPackage Don't include member info if true
+     *
+     * @access public
+     */
+    public function getRegistrationList($where = 'true', $orderBy = false, $noMemberWithPackage = false)
+    {
+
+
+        $registrations = $this->getList($where, $orderBy);
+
+        return $registrations;
+
+    }
 
 }
 
index 3e8c90f..97f0e3e 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,16 +81,117 @@ 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)
     {
+//        $registrations = $this->getList();
+
+//        // Load registrations support class
+//        require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/registrationsSupport.php';
+//        $regSupport = new GlmRegistrationsSupport($this->wpdb, $this->config);
+
+
+        /* Test data */
+
+        /* Uncomment to create one complete sample registration registration each time this action is called */
+//          $regSupport->addTestData();
+
+
+        /////////////////////////////////////
+
+        $haveRegistrations   = false;
+        $registrations       = false;
+        $haveRegistration    = false;
+        $registrationId      = false;
+        $registrationCart    = false;
+        $option         = 'list';
+        $errorMsg       = false;
+
+        // Load registrations support class
+        require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/registrationsSupport.php';
+        $regSupport = new GlmRegistrationsSupport($this->wpdb, $this->config);
+
+
+        /* Test data */
+
+        /* Uncomment to create one complete sample registration registration each time this action is called */
+        //  $regSupport->addTestData();
+
+        /* Uncomment to remove all registration data - *** WARNING - REMOVES ALL REQUEST DATA - NOT JUST TEST DATA *** */
+        //  $regSupport->removeRegistrationRegistrationData();
+
+        // Check for option submitted
+        if (isset($_REQUEST['option']) && $_REQUEST['option'] != '') {
+            $option = $_REQUEST['option'];
+        }
+
+        // Check for registration registration ID submitted
+        if (isset($_REQUEST['registrationID']) && $_REQUEST['registrationID'] != '') {
+            $registrationId = ($_REQUEST['registrationID'] - 0);
+        }
+
+        // Perform selected option
+        switch ($option) {
+
+            // Check registration and update holds
+            case 'check':
+
+//                $registrationCart = $regSupport->checkRegistrationRegistration($registrationId);
+
+            // Display/Edit a registration registration
+            case 'edit':
+
+                // If a registration ID has been supplied
+//                if ($registrationId) {
+
+                    // Try to get the complete cart for this registration
+//                    $registrationCart = $regSupport->getRegistrationCart($registrationId);
+//
+//                    // If a valid cart was returned
+//                    if ($registrationCart && $registrationCart['status']) {
+//                        $haveRegistration = true;
+//                    } else {
+//                        $errorMsg = $registrationCart['errorMsg'];
+//                    }
+//
+//                    $view = 'editRegistration.html';
+//
+//                    break;
+//
+//                } else {
+//                    $errorMsg = 'Invalid Registration Registration ID supplied. Unable to view/edit selected registration.';
+//                }
+
+                // Fall through to list if no registrationID submitted
+
+            // Default is to list registrations
+            default:
+
+        // Get list of registrations
+                $registrations = $this->getList();
+                if ($registrations) {
+                    $haveRegistrations = true;
+                }
+
+                break;
+
+        }
+//        echo "<pre>". print_r($registrations, true) . "</pre>";
+
 
         // Compile template data
         $templateData = array(
+            'haveRegistrations' => $haveRegistrations,
+            'registrations'     => $registrations,
+            'haveRegistration'  => $haveRegistration,
+            'errorMsg'          => $errorMsg,
+            'option'            => $option
         );
+
+        /////////////////////////////////////
              // Return status, any suggested view, and any data to controller
         return array(
             'status'        => true,
index f32dffd..6665962 100644 (file)
@@ -1,6 +1,35 @@
 {include file='admin/registrations/header.html'}
-    
+
 <h3>Registrations Events List</h3>
-    
+
+{foreach $registrations as $registration}
+<!--    -->
+    <pre>
+        {$registration.id}
+        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
+        reg_file
+        reg_file_title
+        form_revision
+        notes
+
+    </pre>
+{/foreach}
+
+<input type="submit" value="addTest">
+
 {include file='admin/footer.html'}