*/
-#dateTimeLink, #location, #cost, #admin{
+#dateTimeLink, #location, #cost, #admin, #eventAdmin{
background: grey;
color: lawngreen;
display: block;
}
- #locationDetails, #costDetails, #adminDetails{
+ #locationDetails, #costDetails, #adminDetails, #eventAdminDetails{
display: none;
}
#startTime, #startDate,#endDate, #endTime{
*/
jQuery(document).ready( function () {
jQuery("#startDate, #endDate").datepicker();
- jQuery('#dateTimeLink, #location, #cost, #admin').click(function(e) {
+ jQuery('#dateTimeLink, #location, #cost, #admin, #eventAdmin').click(function(e) {
e.preventDefault();
return false;
});
jQuery("#adminDetails").slideUp(600) ;
}
});
+ jQuery("#eventAdmin").click( function (){
+ if(jQuery("#eventAdminDetails").css("display") == "none"){
+ jQuery("#eventAdminDetails").slideDown(600) ;
+ } else {
+ jQuery("#eventAdminDetails").slideUp(600) ;
+ }
+ });
});
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Member User Profile
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link http://dev.gaslightmedia.com/
+ */
+
+// Load Contacts data abstract
+require_once(GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH.'/data/dataEvents.php');
+
+class GlmMembersAdmin_member_add extends GlmDataEvents
+{
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Contact Info
+ *
+ * @var $contactInfo
+ * @access public
+ */
+ public $contactInfo = false;
+ /**
+ * Member ID
+ *
+ * @var $memberID
+ * @access public
+ */
+ public $memberID = false;
+ /**
+ * Contact ID
+ *
+ * @var $contactID
+ * @access public
+ */
+ public $contactID = false;
+
+
+ /*
+ * 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 the Contacts data class
+ *
+ * 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);
+
+
+ }
+
+ public function modelAction($actionData = false)
+ {
+
+ $displayData = 'This is the Events "Members" "Events" model talking to you from inside WordPress.';
+
+ // Get the Member ID
+ $memberID = 0;
+ if (isset($_REQUEST['member']) && ($_REQUEST['member']-0) > 0) {
+ $memberID = $_REQUEST['member'] - 0;
+ }
+ if ($memberID == 0) {
+ // There should have been a member ID - So failure
+ return array(
+ 'status' => false,
+ 'menuItemRedirect' => 'error',
+ 'modelRedirect' => 'index',
+ 'view' => 'admin/error/index.html',
+ 'data' => false
+ );
+
+ }
+ $option = $_REQUEST['option'];
+
+ $eventFields = array_filter($_REQUEST, function($k) {
+ return preg_match('/^events_/',$k);
+ }, ARRAY_FILTER_USE_KEY);
+
+// echo "<hr />EventsArray:<table>";
+ foreach($eventFields as $key=>$value) {
+// echo("<tr><td>$key</td><td>$value</td></tr>");
+ $formFields[] = $value;
+ }
+// echo "</table><hr />";
+
+ // Get field names for each column
+ $dbFields = "
+ SELECT column_name
+ FROM information_schema.columns
+ WHERE table_name = '" .GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "events'
+ AND table_schema = 'worddb'
+ ;";
+ $alldbFields = $this->wpdb->get_results($dbFields, ARRAY_A);
+
+ // Store field names in an array for later use
+ foreach($alldbFields as $key=>$value){
+ $field[] = $value['column_name'];
+ }
+ if($option == 'submit'){
+ if (isset($_REQUEST['events_name'])) {
+ $title = trim(filter_var($_REQUEST['events_name'],FILTER_SANITIZE_STRING));
+ }
+
+ // sql query
+ $sql = "
+ INSERT INTO ". GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "events
+ (id,name)
+ VALUES (" . "'$memberID '". "," . "'$title '". ")
+ ;";
+ $this->wpdb->query($sql);
+ }
+ $templateData = array(
+ 'displayData' => $displayData,
+ 'haveMember' => $haveMember,
+ 'memberID' => $memberID,
+ 'option' => $option
+ );
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'admin/member/add.html',
+ 'data' => $templateData
+ );
+
+ }
+
+
+}
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Member User Profile
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link http://dev.gaslightmedia.com/
+ */
+
+// Load Contacts data abstract
+require_once(GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH.'/data/dataEvents.php');
+
+class GlmMembersAdmin_member_categories extends GlmDataEvents
+{
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Contact Info
+ *
+ * @var $contactInfo
+ * @access public
+ */
+ public $contactInfo = false;
+ /**
+ * Member ID
+ *
+ * @var $memberID
+ * @access public
+ */
+ public $memberID = false;
+ /**
+ * Contact ID
+ *
+ * @var $contactID
+ * @access public
+ */
+ public $contactID = false;
+
+
+ /*
+ * 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 the Contacts data class
+ *
+ * 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);
+
+
+ }
+
+ public function modelAction($actionData = false)
+ {
+
+ $displayData = 'This is the Events "Members" "Events" model talking to you from inside WordPress.';
+
+ // Get the Member ID
+ $memberID = 0;
+ if (isset($_REQUEST['member']) && ($_REQUEST['member']-0) > 0) {
+ $memberID = $_REQUEST['member'] - 0;
+ }
+ if ($memberID == 0) {
+ // There should have been a member ID - So failure
+ return array(
+ 'status' => false,
+ 'menuItemRedirect' => 'error',
+ 'modelRedirect' => 'index',
+ 'view' => 'admin/error/index.html',
+ 'data' => false
+ );
+
+ }
+ $option = $_REQUEST['option'];
+ echo $memberID;
+ echo "<hr />Request:<table>";
+ foreach($_REQUEST as $key=>$value) {
+ echo("<tr><td>$key</td><td>$value</td></tr>");
+ }
+ echo "</table>";
+ $socialarray = array_filter($_REQUEST, function($k) {
+ return preg_match('/^events_/',$k);
+ }, ARRAY_FILTER_USE_KEY);
+ echo "<hr />EventsArray:<table>";
+ echo "<pre>";print_r($socialarray,true);echo "</pre>";
+ foreach($socialarray as $key=>$value) {
+ echo("<tr><td>$key</td><td>$value</td></tr>");
+ }
+ echo "</table><hr />";
+ if($option == 'submit'){
+ if (isset($_REQUEST['title'])) {
+ $title = trim(filter_var($_REQUEST['title'],FILTER_SANITIZE_STRING));
+ }
+// $sql = "
+// INSERT INTO ".GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "events
+// (id,name)
+// VALUES ('3', '" . $title . "')
+// ;";query($sql);
+//
+// $this->wpdb->query($sql);
+ }
+ $templateData = array(
+ 'displayData' => $displayData,
+ 'haveMember' => $haveMember,
+ 'memberID' => $memberID,
+ 'option' => $option
+ );
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'admin/member/categories.html',
+ 'data' => $templateData
+ );
+
+ }
+
+
+}
*/
// Load Contacts data abstract
-//require_once(GLM_MEMBERS_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php');
+require_once(GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH.'/data/dataEvents.php');
-class GlmMembersAdmin_member_events // extends GlmDataContacts
+class GlmMembersAdmin_member_events extends GlmDataEvents
{
/**
* WordPress Database Object
$displayData = 'This is the Events "Members" "Events" model talking to you from inside WordPress.';
- // Compile template data
+ // Get the Member ID
+ $memberID = 0;
+ if (isset($_REQUEST['member']) && ($_REQUEST['member']-0) > 0) {
+ $memberID = $_REQUEST['member'] - 0;
+ }
+ if ($memberID == 0) {
+ // There should have been a member ID - So failure
+ return array(
+ 'status' => false,
+ 'menuItemRedirect' => 'error',
+ 'modelRedirect' => 'index',
+ 'view' => 'admin/error/index.html',
+ 'data' => false
+ );
+
+ }
+
+ $option = $_REQUEST['option'];
+ echo $memberID;
+ echo "<hr />Request:<table>";
+ foreach($_REQUEST as $key=>$value) {
+ echo("<tr><td>$key</td><td>$value</td></tr>");
+ }
+ echo "</table>";
+ $socialarray = array_filter($_REQUEST, function($k) {
+ return preg_match('/^events_/',$k);
+ }, ARRAY_FILTER_USE_KEY);
+ echo "<hr />EventsArray:<table>";
+ echo "<pre>";print_r($socialarray,true);echo "</pre>";
+ foreach($socialarray as $key=>$value) {
+ echo("<tr><td>$key</td><td>$value</td></tr>");
+ }
+ echo "</table><hr />";
+ if($option == 'submit'){
+ if (isset($_REQUEST['title'])) {
+ $title = trim(filter_var($_REQUEST['title'],FILTER_SANITIZE_STRING));
+ }
+// $sql = "
+// INSERT INTO ".GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "events
+// (id,name)
+// VALUES ('3', '" . $title . "')
+// ;";
+
+ $this->wpdb->query($sql);
+ }
$templateData = array(
- 'displayData' => $displayData
+ 'displayData' => $displayData,
+ 'haveMember' => $haveMember,
+ 'memberID' => $memberID,
+ 'option' => $option
);
-
// Return status, any suggested view, and any data to controller
return array(
'status' => true,
'view' => 'admin/member/events.html',
'data' => $templateData
);
+
}
'event'=> GLM_MEMBERS_EVENTS_PLUGIN_SLUG,
'member' => array(
'events' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG,
+ 'add' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG,
+ 'categories' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG,
),
'events' => array(
'index' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG,
--- /dev/null
+<!DOCTYPE html>
+<!--
+To change this license header, choose License Headers in Project Properties.
+To change this template file, choose Tools | Templates
+and open the template in the editor.
+-->
+<html>
+ <head>
+ <title>TODO supply a title</title>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ </head>
+ <body>
+ <div>TODO write content</div>
+ </body>
+</html>
{include file='admin/events/header.html'}
-
- <a id="dateTimeLink" href="#"> Date and Time </a>
+<div> {$memberID} </div>
+ <a id="dateTimeLink" href="#"> Event Details </a>
<div id="dateTime">
- <form id="dateTimeForm">
- <input type="checkbox"> All Day<br>
- <input type="checkbox"> No End Time <br>
- <span> Start Date</span>
- <input id="startDate" type="text">
- <span> Start Time </span>
- <input id="startTime" type="text">
- <span> End Date</span>
- <input id="endDate" type="text">
- <span> End Time</span>
- <input id="endTime" type="text">
- <input type="checkbox"> Repeating<br>
- <input type="checkbox"> Exclude <br>
- <span> Time Zone</span>
- <select id="timeZone"> </select>
- </form>
+ <form action="{$thisURL}?page={$thisPage}&glm_action=add" method="post" enctype="multipart/form-data">
+ <p> Event Name </p>
+ <input name="events_name" type="text" id="eventName">
+ <select name="events_category" id="category">
+ <option> Category</option></select>
+ <p> All Day</p>
+ <input name="events_allDay" type="checkbox">
+ <p> Active?</p>
+ <input name="events_active" type="checkbox">
+ <select name="events_category" id="category">
+ <option> Partner </option></select>
+ <p> Start Date</p>
+ <input name="events_startDate" id="startDate" type="text">
+ <p> End Date</p>
+ <input name="events_endDate" id="endDate" type="text">
+ <p> Start Time </p>
+ <input name="events_startTime" id="startTime" type="text">
+ <p> End Time</p>
+ <input name="events_endtime" id="endTime" type="text">
+ <p> Recurring </p>
+ <input name="events_recurring" type="checkbox">
+
</div>
<a id="location" href="#"> Location Details </a>
<div id="locationDetails">
- <form id="locationDetailsForm">
- <span> Venue Name</span>
- <input id="VenueName" type="text">
- <span> Address </span>
- <input id="address" type="text">
+
+ <p> Hide Event Address </p>
+ <input name="events_hide" type="checkbox">
+ <p> Place </p>
+ <input type="text" name="events_place" id="place">
+ <p> Address </p>
+ <input type="text" name="events_address" id="address">
+ <p> City </p>
+ <input type="text" name="events_city" id="city">
+ <p> State</p>
+ <input type="text" name="events_state" id="state">
+ <p> ZIP Code </p>
+ <input type="text" name="events_zip" id="zip">
- </form>
+
</div>
<a id="cost" href="#"> Cost and tickets </a>
<div id="costDetails">
- <form id="costDetailsForm">
- <span> Cost</span>
- <input id="costInput" type="text">
- <input type="checkbox"> Free event<br>
- <span> Url </span>
- <input id="website" type="text">
- </form>
+
+ <p> Cost</p>
+ <input name="events_cost" id="costInput" type="text">
+ <p> Free Event </p>
+ <input id="freeEvent" name="events_freeEvent" type="checkbox">
+ <p> Website </p>
+ <input name="events_website" id="website" type="text">
+
</div>
- <a id="admin" href="#"> Admin Contact Info </a>
+ <a id="admin" href="#"> Event Contact Information </a>
<div id="adminDetails">
- <form id="adminDetailsForm">
- <span> Contact Name</span>
+
+ <p> Contact Name</p>
+ <input name="events_adminName" id="contactName" type="text">
+ <p> Contact Phone</p>
+ <input name="events_adminPhone" id="contactPhone" type="text">
+ <p> Contact Email</p>
+ <input name="events_adminEmail" id="contactEmail" type="text">
+
+ </div>
+ <a id="eventAdmin" href="#"> Event Admin Information </a>
+ <div id="eventAdminDetails">
+
+ <p> Contact Name Submitting Event</p>
<input id="contactName" type="text">
- <span> Contact Phone</span>
- <input id="contactPhone" type="text">
- <span> Contact Email</span>
- <input id="contactEmail" type="text">
- <span> Contact Website</span>
- <input id="contactURL" type="text">
- </form>
+ <p> Organization Name Submitting Event</p>
+ <input name="events_contactName" id="contactName" type="text">
+ <p> Contact Phone</p>
+ <input name="events_contactName" id="contactPhone" type="text">
+ <p> Contact Email</p>
+ <input name="events_contactEmail" id="contactEmail" type="text">
+ <p> Notes </p>
+ <textarea name="events_notes" id="notes"> </textarea>
+
+
</div>
+ <input type="submit" class="button glm-button submit" value="submit">
+ <input type="hidden" name="option" value="submit">
+ </form>
</body>
-<div class="wrap">
- <h2>All Members</h2>
+
<h2 class="nav-tab-wrapper">
- <a href="{$thisURL}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index} nav-tab-active{/if}">All Events</a>
-<!-- <a href="{$thisURL}?page={$thisPage}&glm_action=add" class="nav-tab{if $thisAction==list} nav-tab-active{/if}">Add Event</a>-->
-{foreach $addOnTabs as $a}
- <a href="{$thisURL}?page=glm-members-admin-menu-members-{$a.menu}&glm_action={$a.action}" class="nav-tab{if $thisAction==$a.action} nav-tab-active{/if}">{$a.text}</a>
-{/foreach}
+ <a href="{$thisURL}?page={$thisPage}&glm_action=events&member={$memberID}" class="nav-tab{if $thisAction==events} nav-tab-active{/if}">Events</a>
+
</h2>
<div id="glm-admin-content-container">
+
\ No newline at end of file
--- /dev/null
+
+
+{include file='admin/events/header.html'}
+
+ <a id="dateTimeLink" href="#"> Event Details </a>
+ <div id="dateTime">
+ <form action="{$thisURL}?page={$thisPage}&glm_action=add&member={$memberID}" method="post" enctype="multipart/form-data">
+ <p> Event Name </p>
+ <input name="events_name" type="text" id="eventName">
+ <select name="events_category" id="category">
+ <option> Category</option></select>
+ <p> All Day</p>
+ <input name="events_allDay" type="checkbox">
+ <p> Active?</p>
+ <input name="events_active" type="checkbox">
+ <select name="events_category" id="category">
+ <option> Partner </option></select>
+ <p> Start Date</p>
+ <input name="events_startDate" id="startDate" type="text">
+ <p> End Date</p>
+ <input name="events_endDate" id="endDate" type="text">
+ <p> Start Time </p>
+ <input name="events_startTime" id="startTime" type="text">
+ <p> End Time</p>
+ <input name="events_endtime" id="endTime" type="text">
+ <p> Recurring </p>
+ <input name="events_recurring" type="checkbox">
+
+ </div>
+ <a id="location" href="#"> Location Details </a>
+ <div id="locationDetails">
+
+ <p> Hide Event Address </p>
+ <input name="events_hide" type="checkbox">
+ <p> Place </p>
+ <input type="text" name="events_place" id="place">
+ <p> Address </p>
+ <input type="text" name="events_address" id="address">
+ <p> City </p>
+ <input type="text" name="events_city" id="city">
+ <p> State</p>
+ <input type="text" name="events_state" id="state">
+ <p> ZIP Code </p>
+ <input type="text" name="events_zip" id="zip">
+
+
+ </div>
+ <a id="cost" href="#"> Cost and tickets </a>
+ <div id="costDetails">
+
+ <p> Cost</p>
+ <input name="events_cost" id="costInput" type="text">
+ <p> Free Event </p>
+ <input id="freeEvent" name="events_freeEvent" type="checkbox">
+ <p> Website </p>
+ <input name="events_website" id="website" type="text">
+
+ </div>
+ <a id="admin" href="#"> Event Contact Information </a>
+ <div id="adminDetails">
+
+ <p> Contact Name</p>
+ <input name="events_adminName" id="contactName" type="text">
+ <p> Contact Phone</p>
+ <input name="events_adminPhone" id="contactPhone" type="text">
+ <p> Contact Email</p>
+ <input name="events_adminEmail" id="contactEmail" type="text">
+
+ </div>
+ <a id="eventAdmin" href="#"> Event Admin Information </a>
+ <div id="eventAdminDetails">
+
+ <p> Contact Name Submitting Event</p>
+ <input id="contactName" type="text">
+ <p> Organization Name Submitting Event</p>
+ <input name="events_contactName" id="contactName" type="text">
+ <p> Contact Phone</p>
+ <input name="events_contactName" id="contactPhone" type="text">
+ <p> Contact Email</p>
+ <input name="events_contactEmail" id="contactEmail" type="text">
+ <p> Notes </p>
+ <textarea name="events_notes" id="notes"> </textarea>
+
+
+ </div>
+ <input type="submit" class="button glm-button submit" value="submit">
+ <input type="hidden" name="option" value="submit">
+ </form>
+ </body>
+
+
--- /dev/null
+{include file='admin/events/header.html'}
+
+
+
+
+
+ <div>TODO write content</div>
+
-<!DOCTYPE html>
-<!--
-To change this license header, choose License Headers in Project Properties.
-To change this template file, choose Tools | Templates
-and open the template in the editor.
--->
-<html>
- <head>
- <title>TODO supply a title</title>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- </head>
- <body>
- <div>TODO write content</div>
- <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
- <input type='text' name='title'>
- <input type="submit" class="button glm-button submit" value="submit">
- <input type="hidden" name="option" value="submit">
- <div class="button glm-button right">Update</div> </form>
- </body>
-</html>
+{include file='admin/members/header.html'}
+
+ <h2 class="nav-tab-wrapper">
+ <a href="{$thisURL}?page={$thisPage}&glm_action=add&member={$memberID}" class="nav-tab{if $thisAction==add} nav-tab-active{/if}">Add Event</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=categories&member={$memberID}" class="nav-tab{if $thisAction==categories} nav-tab-active{/if}">Event Categories</a>
+
+ </h2>
+<h2> Events </h2>
+ <table class="wp-list-table striped glm-admin-table">
+ <thead>
+ <tr>
+ <th>Event Title</th>
+ <th>Category</th>
+ <th>Times</th>
+ <th>Days</th>
+ <th>Start Date</th>
+ <th>End Date</th>
+ <th> </th>
+ </tr>
+ </thead>
+
+
+
+