// require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/memberDataByLatLon.php';
// $MapItems = new GlmMembersFront_members_memberDataByLatLon($this->wpdb, $this->config);
+ // echo '<pre>$where: ' . print_r( $where, true ) . '</pre>';
+
/*
* Get a current list of members - unless this is a blank start
*/
if (!$blankStart) {
// If there's a full text search, handle separately
- if ( $fullTextSearch ) {
+ if ( $fullTextSearch || $citySearchSelected ) {
// Get stats for the current selection
- $membersFound = $this->getStats(str_replace('T.', '', $where));
+ // $membersFound = $this->getStats(str_replace('T.', '', $where));
// Get stats for number of members found matching current selection criteria (includes alpha selection)
- $filteredMembersFound = $this->getStats(str_replace('T.', '', $where.$alphaWhere));
+ // $filteredMembersFound = $this->getStats(str_replace('T.', '', $where.$alphaWhere));
// echo '<pre>$fullTextSearch: ' . print_r( $fullTextSearch, true ) . '</pre>';
if ( $appendSelect ) {
$order = " member_name ASC ";
}
// echo '<pre>$order: ' . print_r( $order, true ) . '</pre>';
- ${$resultParam} = $this->getList(
- $where.$alphaWhere, // where
- $order, // order
- true, // fieldVals
- 'id', // idField
- $start, // start
- $limit, // limit
- '', // prohibitListOptions
- $appendSelect
- );
- } elseif ( $citySearchSelected ) {
+ // ${$resultParam} = $this->getList(
+ // $where.$alphaWhere, // where
+ // $order, // order
+ // true, // fieldVals
+ // 'id', // idField
+ // $start, // start
+ // $limit, // limit
+ // '', // prohibitListOptions
+ // $appendSelect
+ // );
+ // } elseif ( $citySearchSelected ) {
// Setup city search for distance
- $cityCoordinates = $this->getCityCoordinates( $citySearchSelected );
- if ( $cityCoordinates ) {
- $cityName = $cityCoordinates['name'];
- // Distance query
- $distanceQuery = $this->getDistanceQuery( $cityCoordinates['lat'], $cityCoordinates['lon'] );
- if ( !isset( $whereSep ) || $whereSep == '' ) {
+ if ( $citySearchSelected ) {
+ $cityCoordinates = $this->getCityCoordinates( $citySearchSelected );
+ if ( $cityCoordinates ) {
+ $cityName = $cityCoordinates['name'];
+ // Distance query
+ $distanceQuery = $this->getDistanceQuery( $cityCoordinates['lat'], $cityCoordinates['lon'] );
+ if ( !isset( $whereSep ) || $whereSep == '' ) {
+ $whereSep = ' AND ';
+ }
+ $where .= $whereSep." ( $distanceQuery < 40 )";
$whereSep = ' AND ';
+ $appendSelect = "
+ CASE
+ WHEN T.city = {$citySearchSelected} THEN 0
+ ELSE " . $distanceQuery . "
+ END AS distance";
+
+ $order = " distance ASC, city ASC, member_name ASC ";
+ // echo '<pre>$order: ' . print_r( $order, true ) . '</pre>';
+ // echo '<pre>$cityName: ' . print_r( $cityName, true ) . '</pre>';
+ // echo '<pre>$distanceQuery: ' . print_r( $distanceQuery, true ) . '</pre>';
+ } else {
+ $appendSelect = "";
+ $order = " member_name ASC ";
}
- $where .= $whereSep." ( $distanceQuery < 40 )";
- $whereSep = ' AND ';
- $appendSelect = "
- CASE
- WHEN T.city = {$citySearchSelected} THEN 0
- ELSE " . $distanceQuery . "
- END AS distance";
-
- $order = " distance ASC, city ASC, member_name ASC ";
- // echo '<pre>$order: ' . print_r( $order, true ) . '</pre>';
- // echo '<pre>$cityName: ' . print_r( $cityName, true ) . '</pre>';
- // echo '<pre>$distanceQuery: ' . print_r( $distanceQuery, true ) . '</pre>';
- } else {
- $appendSelect = "";
- $order = " member_name ASC ";
}
// Get stats for the current selection
$ajaxRequest .= "&categorySearch=$categorySearch";
}
if ( isset( $citySearch ) && $citySearch ) {
- $ajaxRequest .= "&citySearch=$citySearch";
+ // $ajaxRequest .= "&citySearch=$citySearch";
}
if ( isset( $ajaxRequest ) && $ajaxRequest ) {
$ajaxRequest .= "&ajaxRequest=$ajaxRequest";