application/controllers/Common.php
/* Search criteria detail for sending back the details when create basic search criteria */
Search criteria detail for sending back the details when create basic search criteria
Search criteria detail for sending back the details when create basic search criteria
public function search_criteria_detail_post($userId,$searchId){  	
		$data['pref'] = $this->Common_model->get_preference_detail($userId,$searchId);
			if($data['pref']){
				$data['userId'] = 	$data['pref']['userId'];
				$data['searchId'] = 	$data['pref']['searchId'];
				$data['searchName'] = 	$data['pref']['searchName'];
				$data['idealMovingDate'] = 	$data['pref']['idealMovingDate'];
				$data['houseType'] = 	$data['pref']['houseType'];
				$data['minPrice'] = 	$data['pref']['minPrice'];
				$data['maxPrice'] = 	$data['pref']['maxPrice'];
				$data['minBedroom'] = 	$data['pref']['minBedroom'];
				$data['maxBedroom'] = 	$data['pref']['maxBedroom'];
				if($data['pref']['keywords']){
					$data['keywords'] = 	explode(",",$data['pref']['keywords']);
				}else{
					$data['keywords'] =  [];
				}
				$data['travelApiData'] = 	$data['pref']['travelApiData'];
				if($data['pref']['area']){
					$data['advanceSearch']['postcode'] = $data['pref']['area'];
				}else{
					$data['advanceSearch']['postcode'] = '';
				}
				$proximity = $data['pref']['proximity'];
				if($proximity){
					$data['advanceSearch']['location_preferences'] = explode(",",$proximity);
				}else{
					$data['advanceSearch']['location_preferences'] = [];
				}
				if($data['pref']['avoid_area']){
					$data['advanceSearch']['avoid_location'] = $data['pref']['avoid_area'];
				}else{
					$data['advanceSearch']['avoid_location'] = '';
				}
				$avoid_proximity = $data['pref']['avoid_proximity'];
				if($avoid_proximity){
					$data['advanceSearch']['avoid_location_preferences'] = explode(",",$avoid_proximity);
				}else{
					$data['advanceSearch']['avoid_location_preferences'] = [];
				}
				$data['topSearch']['criteria1'] = $data['pref']['criteria1'];
				$data['topSearch']['criteria2'] = $data['pref']['criteria2'];
				$data['topSearch']['criteria3'] = $data['pref']['criteria3'];
				unset($data['pref']);
			}
			$data['commute'] = $this->Common_model->get_commute_detail($userId,$searchId);
			if ($data) {
				$this->response(array('ResponseCode' => 1, 'ResponseMessage' => 'SUCCESS', 'Comments' => $_POST['message'],'Result'=>$data), 200);
			}else{
				$this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => 'We are experiencing some technical difficulties, please try again.','Result'=>false), 400);
			}
    }
public function search_criteria_detail_post ( $ userId , $ searchId ) { $ data [ 'pref' ] = $ this -> Common_model -> get_preference_detail ( $ userId , $ searchId ) ; if ( $ data [ 'pref' ] ) { $ data [ 'userId' ] = $ data [ 'pref' ] [ 'userId' ] ; $ data [ 'searchId' ] = $ data [ 'pref' ] [ 'searchId' ] ; $ data [ 'searchName' ] = $ data [ 'pref' ] [ 'searchName' ] ; $ data [ 'idealMovingDate' ] = $ data [ 'pref' ] [ 'idealMovingDate' ] ; $ data [ 'houseType' ] = $ data [ 'pref' ] [ 'houseType' ] ; $ data [ 'minPrice' ] = $ data [ 'pref' ] [ 'minPrice' ] ; $ data [ 'maxPrice' ] = $ data [ 'pref' ] [ 'maxPrice' ] ; $ data [ 'minBedroom' ] = $ data [ 'pref' ] [ 'minBedroom' ] ; $ data [ 'maxBedroom' ] = $ data [ 'pref' ] [ 'maxBedroom' ] ; if ( $ data [ 'pref' ] [ 'keywords' ] ) { $ data [ 'keywords' ] = explode ( " , " , $ data [ 'pref' ] [ 'keywords' ] ) ; } else { $ data [ 'keywords' ] = [ ] ; } $ data [ 'travelApiData' ] = $ data [ 'pref' ] [ 'travelApiData' ] ; if ( $ data [ 'pref' ] [ 'area' ] ) { $ data [ 'advanceSearch' ] [ 'postcode' ] = $ data [ 'pref' ] [ 'area' ] ; } else { $ data [ 'advanceSearch' ] [ 'postcode' ] = '' ; } $ proximity = $ data [ 'pref' ] [ 'proximity' ] ; if ( $ proximity ) { $ data [ 'advanceSearch' ] [ 'location_preferences' ] = explode ( " , " , $ proximity ) ; } else { $ data [ 'advanceSearch' ] [ 'location_preferences' ] = [ ] ; } if ( $ data [ 'pref' ] [ 'avoid_area' ] ) { $ data [ 'advanceSearch' ] [ 'avoid_location' ] = $ data [ 'pref' ] [ 'avoid_area' ] ; } else { $ data [ 'advanceSearch' ] [ 'avoid_location' ] = '' ; } $ avoid_proximity = $ data [ 'pref' ] [ 'avoid_proximity' ] ; if ( $ avoid_proximity ) { $ data [ 'advanceSearch' ] [ 'avoid_location_preferences' ] = explode ( " , " , $ avoid_proximity ) ; } else { $ data [ 'advanceSearch' ] [ 'avoid_location_preferences' ] = [ ] ; } $ data [ 'topSearch' ] [ 'criteria1' ] = $ data [ 'pref' ] [ 'criteria1' ] ; $ data [ 'topSearch' ] [ 'criteria2' ] = $ data [ 'pref' ] [ 'criteria2' ] ; $ data [ 'topSearch' ] [ 'criteria3' ] = $ data [ 'pref' ] [ 'criteria3' ] ; unset ( $ data [ 'pref' ] ) ; } $ data [ 'commute' ] = $ this -> Common_model -> get_commute_detail ( $ userId , $ searchId ) ; if ( $ data ) { $ this -> response ( array ( 'ResponseCode' => 1 , 'ResponseMessage' => 'SUCCESS' , 'Comments' => $ _POST [ 'message' ] , 'Result' => $ data ) , 200 ) ; } else { $ this -> response ( array ( 'ResponseCode' => 0 , 'ResponseMessage' => 'FAILURE' , 'Comments' => 'We are experiencing some technical difficulties, please try again.' , 'Result' => false ) , 400 ) ; } }
Search criteria detail for sending back the details when create basic search criteria
Search criteria detail for sending back the details when create basic search criteria
//print_r($data['pref']);exit(); /* preference object */ // $proximity = $data['pref']['proximity']; // $data['preferences']['proximity'] = explode(",",$proximity); // $avoid_proximity = $data['pref']['avoid_proximity']; // $data['preferences']['avoid_proximity'] = explode(",",$avoid_proximity); /* advanceSearch object */ //$data['advanceSearch']['postcode'] = $data['pref']['area']; //$keywords = $data['pref']['keywords']; //$data['advanceSearch']['keywords'] = explode(",",$keywords); //$data['advanceSearch']['avoid_location'] = $data['pref']['avoid_area']; //$avoid_keywords = $data['pref']['avoid_keywords']; //$data['advanceSearch']['avoid_keywords'] = explode(",",$avoid_keywords); //print_r($data);exit();