application/controllers/Common.php
/* Function for get list of shortlisted property */
Function for get list of shortlisted property
Function for get list of shortlisted property
public function shortlisted_property_list_post(){		
    	$post_data = $this->post();
    	$userId = $post_data['userId'];
    	$loginUserId = $post_data['loginUserId']; 
    	$searchId = $post_data['searchId'];
		$this->form_validation->set_data($post_data);
		$this->form_validation->set_error_delimiters('', '');
		$this->form_validation->set_rules('userId','User Id','required|numeric|callback_user_check');	
		if($userId != $loginUserId){
			$this->form_validation->set_rules('loginUserId','User Id','required|numeric|callback_user_in_tribe_check['.$post_data['searchId'].']');	
		}
		$this->form_validation->set_rules('searchId','Search criteria id','required|numeric|callback_search_criteria_check');	
		if ($this->form_validation->run() === false) {
    			$this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => validation_errors(),'Result'=>''), 400);    		
		}else{
			$data['count'] = $this->Common_model->count_shortlisted_property_list($post_data);    
	    	if($data['count']){
				$data['list'] = $this->Common_model->shortlisted_property_list($post_data);
				if ($data) {
					$this->response(array('ResponseCode' => 1, 'ResponseMessage' => 'SUCCESS', 'Comments' => 'Shortlisted properties fetched successfully','Result'=>$data), 200);
				}else{
					$this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => 'Refresh search results by clicking on "..." symbol and "Edit search criteria"','Result'=>'refresh search results by clicking on "..." symbol and "Edit search criteria"'), 400);
				}
			}else{
				$this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => 'Refresh search results by clicking on "..." symbol and "Edit search criteria"','Result'=>'refresh search results by clicking on "..." symbol and "Edit search criteria"'), 400);
			}	
		}
    }
public function shortlisted_property_list_post ( ) { $ post_data = $ this -> post ( ) ; $ userId = $ post_data [ 'userId' ] ; $ loginUserId = $ post_data [ 'loginUserId' ] ; $ searchId = $ post_data [ 'searchId' ] ; $ this -> form_validation -> set_data ( $ post_data ) ; $ this -> form_validation -> set_error_delimiters ( '' , '' ) ; $ this -> form_validation -> set_rules ( 'userId' , 'User Id' , 'required|numeric|callback_user_check' ) ; if ( $ userId != $ loginUserId ) { $ this -> form_validation -> set_rules ( 'loginUserId' , 'User Id' , 'required|numeric|callback_user_in_tribe_check[' . $ post_data [ 'searchId' ] . ']' ) ; } $ this -> form_validation -> set_rules ( 'searchId' , 'Search criteria id' , 'required|numeric|callback_search_criteria_check' ) ; if ( $ this -> form_validation -> run ( ) === false ) { $ this -> response ( array ( 'ResponseCode' => 0 , 'ResponseMessage' => 'FAILURE' , 'Comments' => validation_errors ( ) , 'Result' => '' ) , 400 ) ; } else { $ data [ 'count' ] = $ this -> Common_model -> count_shortlisted_property_list ( $ post_data ) ; if ( $ data [ 'count' ] ) { $ data [ 'list' ] = $ this -> Common_model -> shortlisted_property_list ( $ post_data ) ; if ( $ data ) { $ this -> response ( array ( 'ResponseCode' => 1 , 'ResponseMessage' => 'SUCCESS' , 'Comments' => 'Shortlisted properties fetched successfully' , 'Result' => $ data ) , 200 ) ; } else { $ this -> response ( array ( 'ResponseCode' => 0 , 'ResponseMessage' => 'FAILURE' , 'Comments' => 'Refresh search results by clicking on "..." symbol and "Edit search criteria"' , 'Result' => 'refresh search results by clicking on "..." symbol and "Edit search criteria"' ) , 400 ) ; } } else { $ this -> response ( array ( 'ResponseCode' => 0 , 'ResponseMessage' => 'FAILURE' , 'Comments' => 'Refresh search results by clicking on "..." symbol and "Edit search criteria"' , 'Result' => 'refresh search results by clicking on "..." symbol and "Edit search criteria"' ) , 400 ) ; } } }
Function for get list of shortlisted property
Function for get list of shortlisted property
//print_r($data['count'])	;exit();