// Check if the name already exists
$sql = "
SELECT id
- FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."cateogries
+ FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."categories
WHERE name = '$parent'
;";
$parentCategory = $this->wpdb->get_row($sql, ARRAY_A);
return $current;
}
+
+ /**
+ * Clear all categories for a specific member info record
+ *
+ * @param integer $memberInfoID Member Information Record ID
+ *
+ * @return null
+ *
+ * @access public
+ */
+
+ public function clearMemberInfoCategories($memberInfoID) {
+
+ $sql = "
+ DELETE FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."category_member_info
+ WHERE member_info = $memberInfoID
+ ;";
+ $this->wpdb->query($sql);
+
+
+ }
}
?>
\ No newline at end of file
ADMIN AREA
-* Member Info Add/Edit
- - When editing a member info record, if the user specifies a new main category more than once with the "Add a new Category" button, the category is created multiple times.
-
* Consider paginating certain lists
* On all admin lists - add sort order links to headers
FRONT-END
-* Add amenities to member lists and maps, and member detail pages
-
DATA ABSTRACT
-* Add option to build alpha lists
-
* Add pagenation, option to return total number of entries and number returned for display for getList()
$sql = "
UPDATE ".GLM_MEMBERS_PLUGIN_DB_PREFIX."member_info
SET status = ".$this->config['status_numb']['Inactive']."
- WHERE status = ".$this->config['status_numb']['Active']."
+ WHERE member = $memberID
+ AND status = ".$this->config['status_numb']['Active']."
;";
$this->wpdb->query($sql);
} // For each category being submitted
- } // If there's any categories selected
+ // Otherwise there's no categories submitted, so make sure there's none stored
+ } else {
+ $CategoryMemberInfo->clearMemberInfoCategories($memberInfoID);
+ }
// Now get the (possibly updated) category list for this member info record
$categoryMemberInfo = $CategoryMemberInfo->getListWithParents($memberInfoID);