application/controllers/Common.php
/* Fetch the comments with room type and maintain unread comments count */
Fetch the comments with room type and maintain unread comments count
Fetch the comments with room type and maintain unread comments count
public function comments_roomType_list_post(){
		$post_data = $this->post();
		$this->form_validation->set_data($post_data);
		$this->form_validation->set_error_delimiters('', '');			
		$this->form_validation->set_rules('loginUserId','User Id','required|numeric|callback_user_check');
		$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');
		$this->form_validation->set_rules('shortlistedId','Shortlisted property id','required|numeric|callback_shortlisted_property_check');
		if ($this->form_validation->run() === false) {
    			$this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => validation_errors(),'Result'=>''), 400);    		
		}else{
			$result = array();
			$data = $this->Common_model->comments_roomType_list($post_data);
			if($data){
				$coomentsRoomTypeAll = $this->Common_model->comments_roomType_all($post_data);
				$result = array_merge($data,$coomentsRoomTypeAll);
				$this->response(array('ResponseCode' => 1, 'ResponseMessage' => 'SUCCESS', 'Comments' => 'comments fetch successfully','Result'=>$result), 200);
			}else{
				$this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => 'No data found.','Result'=>false), 400);
			}
		}
	}
public function comments_roomType_list_post ( ) { $ post_data = $ this -> post ( ) ; $ this -> form_validation -> set_data ( $ post_data ) ; $ this -> form_validation -> set_error_delimiters ( '' , '' ) ; $ this -> form_validation -> set_rules ( 'loginUserId' , 'User Id' , 'required|numeric|callback_user_check' ) ; $ 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' ) ; $ this -> form_validation -> set_rules ( 'shortlistedId' , 'Shortlisted property id' , 'required|numeric|callback_shortlisted_property_check' ) ; if ( $ this -> form_validation -> run ( ) === false ) { $ this -> response ( array ( 'ResponseCode' => 0 , 'ResponseMessage' => 'FAILURE' , 'Comments' => validation_errors ( ) , 'Result' => '' ) , 400 ) ; } else { $ result = array ( ) ; $ data = $ this -> Common_model -> comments_roomType_list ( $ post_data ) ; if ( $ data ) { $ coomentsRoomTypeAll = $ this -> Common_model -> comments_roomType_all ( $ post_data ) ; $ result = array_merge ( $ data , $ coomentsRoomTypeAll ) ; $ this -> response ( array ( 'ResponseCode' => 1 , 'ResponseMessage' => 'SUCCESS' , 'Comments' => 'comments fetch successfully' , 'Result' => $ result ) , 200 ) ; } else { $ this -> response ( array ( 'ResponseCode' => 0 , 'ResponseMessage' => 'FAILURE' , 'Comments' => 'No data found.' , 'Result' => false ) , 400 ) ; } } }
Fetch the comments with room type and maintain unread comments count
Fetch the comments with room type and maintain unread comments count
/*Get the unread count and total count for roomType all */