<?php
class Message{
	
	public function __construct() {
		require_once("connectdb.php");
		$con = new DbConnect;
		$this->con = $con->connect();
		
	}
	
	public function getSenderName($sender_id){
		$sql = mysqli_query($this->con, "SELECT * FROM users WHERE user_id = $sender_id");
		$row = mysqli_fetch_array($sql);
		$fullname = $row['firstname'] . ' ' . $row['lastname'];
		return $fullname;
	}
	
	public function getPhone($sender_id){
		$sql = mysqli_query($this->con, "SELECT * FROM users WHERE user_id = $sender_id");
		$row = mysqli_fetch_array($sql);
		$phone = $row['phone'] ;
		return $phone;
	}
	
	public function getemailAddress($sender_id){
		$sql = mysqli_query($this->con, "SELECT * FROM users WHERE user_id = $sender_id");
		$row = mysqli_fetch_array($sql);
		$email = $row['email'];
		return $email;
	}
	
	
}


?>