Skip to main content

Posts

Showing posts from 2018

Near by data on Map

public function getMapData($requestData){ $radius = 50 ; $query = Community::query(); $query->withCount( 'feedbacks' ); if ((isset($requestData->search_data[ 'location' ]) && !empty($requestData->search_data[ 'location' ])) || ($requestData->search_data[ 'location' ]!= NULL )){ $query->where(DB::raw( "( 6371 * acos( cos( radians (" .$requestData->search_data[ 'location' ][ 'lat' ]. ") ) * cos( radians( communities.lat ) ) * cos( radians( communities.lang ) - radians(" .$requestData->search_data[ 'location' ][ 'lan' ]. ") ) + sin( radians(" .$requestData->search_data[ 'location' ][ 'lat' ]. ") ) * sin( radians( communities.lat ) ) ) ) " ), '<' ,$radius); } else { $query->where(DB::raw( "( 6371 * acos( cos( radians(3.119008) ) * cos( radians( communities.l

Hide Email or Phone with star symbol / mark / *

public function cf_hideEmailPhone ( $country_code , $phone , $email ){ $strLength = strlen ( $phone ); if ( $strLength == 10 ){ $repeat = str_repeat ( "*" , $strLength - 3 ); $last_dif = substr ( $phone , 7 , 9 ); $dispPhone = $country_code . $repeat . $last_dif ; } else if ( $strLength == 9 ){ $repeat = str_repeat ( "*" , $strLength - 3 ); $last_dif = substr ( $phone , 6 , 8 ); $dispPhone = $country_code . $repeat . $last_dif ; //$dispPhone = $user->country_code.str_repeat("*",$strLength-2); } $email_str = explode ( "@" , $email ); $dispEmail = substr ( $email_str [ 0 ], 0 , 3 ). str_repeat ( "*" , strlen ( $email_str [ 0 ])- 3 ). "@" . $email_str [ 1 ]; $returnData [ 'dispPhone' ]= $dispPhone ; $returnData [ 'dispEmail'