application/controllers/Common.php
/* Function for add and update Basic serarch criteria */
Function for add and update Basic serarch criteria
Function for add and update Basic serarch criteria
public function save_search_criteria_post(){
    	$post_data = $this->post();
    	$userId = $post_data['userId'];
		$this->form_validation->set_data($post_data);
		$this->form_validation->set_error_delimiters('', '');
		$this->form_validation->set_rules('userId','User Id','required');		
		if ($this->form_validation->run() === false) {
    			$this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => validation_errors(),'Result'=>''), 400);    		
		}else{
			$save_search_criteria = $this->Common_model->save_search_criteria($post_data);
			if($save_search_criteria){
            		$this->response(array('ResponseCode' => 1, 'ResponseMessage' => 'SUCCESS', 'Comments' => $_POST['message'], 'Result' =>array('searchId'=> $save_search_criteria)), 200);	            
			}else{
				$this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => 'We are experiencing some technical difficulties, please try again.', 'Result' => $save_search_criteria), 400);
			}
		}
    }
public function save_search_criteria_post ( ) { $ post_data = $ this -> post ( ) ; $ userId = $ post_data [ 'userId' ] ; $ this -> form_validation -> set_data ( $ post_data ) ; $ this -> form_validation -> set_error_delimiters ( '' , '' ) ; $ this -> form_validation -> set_rules ( 'userId' , 'User Id' , 'required' ) ; if ( $ this -> form_validation -> run ( ) === false ) { $ this -> response ( array ( 'ResponseCode' => 0 , 'ResponseMessage' => 'FAILURE' , 'Comments' => validation_errors ( ) , 'Result' => '' ) , 400 ) ; } else { $ save_search_criteria = $ this -> Common_model -> save_search_criteria ( $ post_data ) ; if ( $ save_search_criteria ) { $ this -> response ( array ( 'ResponseCode' => 1 , 'ResponseMessage' => 'SUCCESS' , 'Comments' => $ _POST [ 'message' ] , 'Result' => array ( 'searchId' => $ save_search_criteria ) ) , 200 ) ; } else { $ this -> response ( array ( 'ResponseCode' => 0 , 'ResponseMessage' => 'FAILURE' , 'Comments' => 'We are experiencing some technical difficulties, please try again.' , 'Result' => $ save_search_criteria ) , 400 ) ; } } }
Function for add and update Basic serarch criteria
Function for add and update Basic serarch criteria
/* Comment for fast response on 7/9/2017 */ //$data = $this->search_criteria_detail_post($userId,$save_search_criteria);