From: Anthony Talarico $eventslug: ' . print_r($eventslug, true) . '
';
- $sql = "
- SELECT id
- FROM ".GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX. "events
- WHERE name_slug = '$eventslug'";
- $eventId = $this->wpdb->get_var($sql);
- }
- $categories = $this->getCategories();
-
- switch ($action) {
- case 'event-detail':
- $event = $this->getModelEventData($eventId);
- //echo '$event: ' . print_r($event, true) . '
';
- $view = 'detail.html';
- break;
- default:
- // for the dashboard need to get list of event categories and
- // filter out the events
- $events = $this->getModelEventsData();
- $view = 'agenda.html';
- $categoryEvents = array();
- break;
+
+ $eventData = array(
+ 'status' => '20',
+ 'created' => $date,
+ 'updated' => $date,
+ 'name' => $name,
+ 'intro' => $intro,
+ 'descr' => $descr,
+ 'image' => $event['img'],
+ 'cost' => $cost,
+ 'url' => $url,
+ 'admin_name' => $admin_name,
+ 'admin_org' => $admin_org
+ );
+ $this->wpdb->insert(
+ GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'events',
+ $eventData,
+ array(
+ '%d',
+ '%s',
+ '%s',
+ '%s',
+ '%s',
+ '%s',
+ '%s',
+ '%d',
+ '%s',
+ '%s',
+ '%s',
+ )
+ );
+ $lastID = $this->wpdb->insert_id;
+ $timeData = array(
+ 'event' => $lastID,
+ 'start_time' => $mysqlStart,
+ 'end_time' => $mysqlEnd,
+ );
+ $this->wpdb->insert(
+ GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'times',
+ $timeData,
+ array(
+ '%d',
+ '%s',
+ '%s'
+ )
+ );
+ $locationData = array(
+ 'event' => $lastID,
+ 'name' => $place,
+ 'address' => $address,
+ 'city' => $city,
+ 'state' => $state,
+ 'zip' => $zip,
+ 'phone' => $contactPhone,
+ 'email' => $contactEmail
+
+ );
+ $this->wpdb->insert(
+ GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'locations',
+ $locationData,
+ array(
+ '%d',
+ '%s',
+ '%s',
+ '%d',
+ '%s',
+ '%s',
+ '%s',
+ '%s'
+ )
+ );
}
-
+
// Compile template data
$templateData = array(
'siteBaseUrl' => GLM_MEMBERS_EVENTS_SITE_BASE_URL,
'currentUrl' => $_SERVER['HTTP_REFERER'],
'categories' => $categories,
'fromDate' => $fromDate,
- 'event' => $event,
+ 'event' => $newEvent,
'permalink' => $permalink,
'title' => $title,
'mainImgUrl' => GLM_MEMBERS_PLUGIN_MEDIA_URL . '/images/large/'
diff --git a/views/admin/events/edit.html b/views/admin/events/edit.html
index 0f527b1..2fbfa87 100644
--- a/views/admin/events/edit.html
+++ b/views/admin/events/edit.html
@@ -109,7 +109,12 @@