require_once GLM_MEMBERS_PLUGIN_PATH.'/models/admin/ajax/imageUpload.php';
require_once GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH.'/data/dataRecurrences.php';
require_once GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH.'/data/dataManagement.php';
+require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataCities.php';
/**
* GLmMembersFront_event_fontAdd
wp_enqueue_script('glm-members-front-maskedinput');
// Set initial values for variables.
- $fromDate = '';
- $permalink = '';
- $title = '';
- $errorMsg = '';
- $days =
- $lastDayOfMonth =
- $startTime =
- $endTime = 0;
- $status = false;
- $memberOnly = false;
- $memberContact = false;
- $memberManager = false;
- $members = false;
- $venues = false;
- $eventAmenities = array();
- $venues = false;
- $startTimeOnly = 0;
+ $fromDate = '';
+ $permalink = '';
+ $title = '';
+ $errorMsg = '';
+ $days =
+ $lastDayOfMonth =
+ $startTime =
+ $endTime = 0;
+ $status = false;
+ $memberOnly = false;
+ $memberContact = false;
+ $memberManager = false;
+ $members = false;
+ $venues = false;
+ $eventAmenities = array();
+ $venues = false;
+ $startTimeOnly = 0;
$eventCategories = [];
+ $cities = array();
if ( isset( $actionData['request']['member_only'] )
&& $memberOnly = filter_var( $actionData['request']['member_only'], FILTER_VALIDATE_BOOLEAN ) ) {
// wp_enqueue_script('front-js', GLM_MEMBERS_EVENTS_PLUGIN_PATH . '/js/front.js');
}
$view = 'frontAdd';
+ // populate cities dropdown
+ $cityData = new GlmDataCities( $this->wpdb, $this->config );
+ $cityVals = $cityData->getList();
+ foreach ( $cityVals as $city ) {
+ $cities[$city['id']] = $city['name'];
+ }
// populate category dropdown
$categories = new GlmDataEventsCategories( $this->wpdb, $this->config );
//$emailInfo = new GlmDataEventsManagement( $this->wpdb, $this->config );
$admin_name = $this->filterInput( $_REQUEST['admin_name'] );
$admin_org = $this->filterInput( $_REQUEST['admin_org'] );
$adminPhone = $this->filterInput( $_REQUEST['admin_phone'] );
- $userEmail = $this->filterInput( $_REQUEST['admin_email'] );
+ $userEmail = $this->filterInput( $_REQUEST['admin_email'] );
$contactFirst = $this->filterInput( $_REQUEST['contact_fname'] );
$contactLast = $this->filterInput( $_REQUEST['contact_lname'] );
$place = $this->filterInput( $_REQUEST['place'] );
$fileDescr = $this->filterInput( $_REQUEST['fileDescription'] );
// get lat lon
- $latLon = $this->getGeoLocation( array($address, $city, $state) );
+ $latLon = $this->getGeoLocation( array($address, $cities[$city], $state) );
if ($latLon) {
$lat = $latLon[0];
$lon = $latLon[1];
}
}
- $city = $this->getCityId($city);
+ // $city = $this->getCityId($city);
// image upload settings
$image = $_FILES['image_new'];
$imageName = $image['name'];
'from_email' => $fromEmail,
'notification' => $emailNotification,
'confirmation_page' => $redirect_url,
- 'mainImgUrl' => GLM_MEMBERS_PLUGIN_MEDIA_URL . '/images/large/'
+ 'mainImgUrl' => GLM_MEMBERS_PLUGIN_MEDIA_URL . '/images/large/',
+ 'cities' => $cities,
);
//error_reporting(E_ALL ^ E_NOTICE);
'modelRedirect' => false,
'view' => 'front/events/'.$view.'.html',
'data' => $templateData,
- //'settings' => $settings
+ //'settings' => $settings
);
}
}
</div>
</div>
<div class="glm-add-event-form-item" id="glm-front-event-image">
-
+
<div class="glm-add-event-form-label{if $event.fieldRequired.image} glm-required{/if}"><label>Image:</label></div>
<div class="glm-add-event-form-data{if $event.fieldFail.image} glm-form-bad-input{/if}">
-
+
<table class="glm-admin-image-edit-table">
{if $event.fieldData.image}
<div>
<input type="checkbox" name="image_delete"> Delete Image<br>
{$event.fieldData.image}<br>
</div>
-
+
</div>
{/if}
<div><div colspan="2"><b>New image:</b> <input type="file" name="image_new" class="glm-event-front-end-image"></div></div>
</table>
<p class="glm-front-event-image-text">Best image size to provide is between 800 and 1000 pixels wide and stored as a JPG or JPEG file. Also try to supply images that have a reasonable aspect ratio (not too tall, not too wide). Files provided like this should have a file size of 100 to 250 KB. Images will be automatically resized for use in the Web site. Images that are too large will be rejected</p>
</div>
-
+
</div>
{if $memberOnly}
<div class="glm-add-event-form-item">
<label style="color: red;">City</label>
</div>
<div class="glm-add-event-form-data">
- <input name="city" maxlength="100" type="text" class="glm-required" pattern=".*\S+.*" title="This field is required" required>
+ <select name="city" class="glm-required" required>
+ <option value="">Choose City</option>
+ {foreach $cities as $city_id => $city_name}
+ <option value="{$city_id}">{$city_name}</option>
+ {/foreach}
+ </select>
</div>
</div>
<div class="glm-add-event-form-item">
$('#' + msgArea).html('Characters remaining: ' + rem);
}
}
-
+
// check image upload type
$(".glm-event-front-end-image").change(function () {
var ext = this.value.match(/\.(.+)$/)[1];