$_REQUEST[$locID.'_event'] = $this->eventID;
// Check for new cities in this location and if so use the new city real ID
- if (isset($_REQEUST[$locID.'_city']) && $_REQUEST[$locID.'_city'][0] == 'n') {
+ if (isset($_REQUEST[$locID.'_city']) && $_REQUEST[$locID.'_city'][0] == 'n') {
$_REQUEST[$locID.'_city'] = $newCityID[$_REQUEST[$locID.'_city']];
}
if (isset($_REQUEST['locID'])) {
// For each location
- while (list($id, $locID) = each($_REQUEST['locID'])) {
+ foreach ( $_REQUEST['locID'] as $id => $locID ) {
// Check for new cities in this location and if so use the new city real ID
- if (isset($_REQEUST[$locID.'_city']) && $_REQUEST[$locID.'_city'][0] == 'n') {
+ if (isset($_REQUEST[$locID.'_city']) && $_REQUEST[$locID.'_city'][0] == 'n') {
$_REQUEST[$locID.'_city'] = $newCityID[$_REQUEST[$locID.'_city']];
}
case 'list':
default:
-
$where = 'true';
// If we have a back request then go through the PHP_SESSION
// Add "selected" element default false;
reset($categories);
- while (list($k, $v) = each($categories)) {
+ foreach ( $categories as $k => $v ) {
$categories[$k]['selected'] = false;
}
// since we're doing paging, we have to break out just the events data
$events = $eventsResult['list'];
- if (count($events)>0) {
+ if ( is_array( $events ) && !empty( $events ) && count($events) > 0 ) {
$haveEvents = true;
}
unset($eventsResult);
}
- // If there's selected categories
- if (count($selectedCategories) > 0) {
-
- // Update the selected categories for this event record, returns new list
- $EventCategories->setEventCategories($this->eventID, $selectedCategories);
-
- }
-
// If there's been a new category
if ($newCategory) {
// Get the full category list again
- $this->categories = $Categories->getListSortedParentChild();
+ // $this->categories = $Categories->getListSortedParentChild();
}
} // For each category being submitted
+ // If there's selected categories
+ if (count($selectedCategories) > 0) {
+
+ // Update the selected categories for this event record, returns new list
+ $EventCategories->setEventCategories($this->eventID, $selectedCategories);
+
+ }
+
+
// Otherwise if this is a submission and there's no categories submitted, so make sure there's none stored
} elseif ( isset($_REQUEST['option']) && ( $_REQUEST['option'] === 'submit' || $_REQUEST['option'] === 'update' ) ) {
$EventCategories->clearEventCategories($this->eventID);
$Cities = new GlmDataCities($this->wpdb, $this->config);
// For each new city submitted
- while (list($k, $v) = each($_REQUEST['newCity'])) {
+ foreach ( $_REQUEST['newCity'] as $k => $v ) {
$cName = trim(filter_var($_REQUEST['newCity'][$k]));