From 10816d259acd464ab8ba9683138d422d4e8f52fe Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Wed, 17 May 2017 12:07:26 -0400 Subject: [PATCH] Registration info is outputting very rudimentary --- classes/data/dataRegEvent.php | 18 +++++ models/admin/registrations/events.php | 107 +++++++++++++++++++++++++- views/admin/registrations/events.html | 33 +++++++- 3 files changed, 153 insertions(+), 5 deletions(-) diff --git a/classes/data/dataRegEvent.php b/classes/data/dataRegEvent.php index 03f05b6..5b9446f 100644 --- a/classes/data/dataRegEvent.php +++ b/classes/data/dataRegEvent.php @@ -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; + + } } diff --git a/models/admin/registrations/events.php b/models/admin/registrations/events.php index 3e8c90f..97f0e3e 100644 --- a/models/admin/registrations/events.php +++ b/models/admin/registrations/events.php @@ -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 "
". print_r($registrations, true) . "
"; + // 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, diff --git a/views/admin/registrations/events.html b/views/admin/registrations/events.html index f32dffd..6665962 100644 --- a/views/admin/registrations/events.html +++ b/views/admin/registrations/events.html @@ -1,6 +1,35 @@ {include file='admin/registrations/header.html'} - +

Registrations Events List

- + +{foreach $registrations as $registration} + +
+        {$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
+
+    
+{/foreach} + + + {include file='admin/footer.html'} -- 2.17.1