<?php
class Replies_Model extends CI_Model {
	function __construct(){

	}

	
	public function getReplies(){
		
                
                    $this->db->select('replies.id,replies.comment,inquiries.listing_id,replies.inquiry_id,replies.user_id,replies.view_status,replies.dt_created,replies.dt_modified');
                    $this->db->from('replies');
                    $this->db->join('inquiries', 'inquiries.id = replies.inquiry_id');
                    $this->db->where('inquiries.user_id',$this->session->userdata('user_id'));
               
                $this->db->order_by('replies.dt_created','desc');
		$query=$this->db->get();
		return $query->result();
	}
        public function getDetails($id){
            $this->db->select('*');
            $this->db->from('replies');
            $this->db->where('id',$id);
            $query=$this->db->get();
            return $query->row();
        }
	
} 
?>
