<?php
class Home extends Database{

	function __construct(){
		$this->connect();
	}
	
	function getAllmember(){
		if ($this->select('profile','avatar,username',$where = null,'0,6')){
			return $this->getQueryResult();
		}
	}
	
	function getAllpost(){
		$where='post.user = profile.username';
		if ($this->select('profile,post','profile.avatar,post.status,profile.nama,post.date,profile.username,post.toUser',$where, $limit = null, 'date desc')){
			return $this->getQueryResult();
		}
	}
	
	function getAllcomm(){
		if ($this->select('community','photo,id,type,name')){
			return $this->getQueryResult();
		}
	}
	
	function getNotiffriend(){
		$where = "friend.user2='".$_SESSION['username']."' AND friend.status=0 AND friend.user1=profile.username";
		if ($this->select('friend,profile','friend.id,profile.nama,profile.username',$where)){
			return $this->getQueryResult();
		}
	}
}
?>