--- /dev/null
+<?php
+$eventData = 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',
+ ),
+ ),
+ ),
+ ),
+ )
+);
<?php
-
+
/*
- * This class determines which registration page to run
+ * This class determines which registration page to run
* then calls it and returns the result back to the controller.
*
- */
+ */
class GlmMembersFront_registrations_index
{
/**
* @access public
*/
public $config;
-
+
/*
* Constructor
*
- * This contructor sets up this model. At this time that only includes
+ * This contractor 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;
-
+
}
/*
// Check for valid page - if not valid default to "list"
$page = $actionData['request']['page'];
+ if ( isset( $_REQUEST['page'] ) && $request = filter_var( $_REQUEST['page'], FILTER_SANITIZE_STRING ) ) {
+ $page = $request;
+ }
+
// Make sure the specified page is valid or default to "list"
- if (!in_array($page, array('list', 'select', 'cart', 'checkout', 'summary', 'login', 'account'))) {
+ if (!in_array($page, array('list', 'registration', '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);
$regResult = $regModel->modelAction($actionData);
return $regResult;
-
+
}
}
* @access public
*/
public $config;
+
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ }
+
/**
* Constructor
*
*
* 'status'
*
- * True if successfull and false if there was a fatal failure.
+ * True if successful and false if there was a fatal failure.
*
* 'view'
*
- * A suggested view name that the contoller should use instead of the
+ * 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.
*
}
+ // including test data for now
+ include GLM_MEMBERS_REGISTRATIONS_PLUGIN_PATH . '/data/events.php';
+
// Compile template data
$templateData = array(
-
+ 'events' => $eventData,
);
// Return status, any suggested view, and any data to controller
return array(
--- /dev/null
+<?php
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+
+ class GlmMembersFront_registrations_registration 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)
+ {
+ $regEvent = 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;
+ }
+ }
+
+ // Get account ID if supplied
+ if (isset($_REQUEST['eventRegId'])) {
+
+ // Make sure it's numeric
+ $eventRegID = ($_REQUEST['eventRegId'] - 0);
+
+ if ($eventRegID <= 0) {
+ $eventRegID = false;
+ }
+ }
+ $view = 'registration';
+
+ switch ( $option ) {
+
+ }
+
+ // including test data for now
+ include GLM_MEMBERS_REGISTRATIONS_PLUGIN_PATH . '/data/events.php';
+
+ if ( isset( $eventData[$eventRegID] ) ) {
+ $regEvent[] = $eventData[$eventRegID];
+ } else {
+ $regEvent = array();
+ }
+ //echo '<pre>$events: ' . print_r( $events, true ) . '</pre>';
+
+ // Compile template data
+ $templateData = array(
+ 'events' => $regEvent,
+ );
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'front/registrations/' . $view . '.html',
+ 'data' => $templateData
+ );
+
+ }
+ }
+++ /dev/null
-<?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
- );
-
- }
- }
-This is a list
\ No newline at end of file
+<div class="glm-reg-event-list">
+ {foreach $events as $event}
+ <div class="glm-reg-event-item clearfix">
+ <h2><a href="{$thisUrl}?page=registration&eventRegId={$event.id}">{$event.title}</a></h2>
+ <p>{$event.short_desc}</p>
+
+ </div>
+ {/foreach}
+
+</div>
--- /dev/null
+<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>
+++ /dev/null
-<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>