<?php 

class load extends baseController{

	  function CountTable($set)
	  {
           $table = $set;        
           $query = $this->db->prepare("select * from ".$table."");
           $query->execute();
           return $query->rowCount();
	  }
	  
	  function GetApplistAll(){
		 $query = $this->db->prepare("select * from applist order by id desc");
         $query->execute();
		 $val = $query->fetchAll();
		 return $val;
	 }
	  function GetUserAll(){
		 $query = $this->db->prepare("select * from users order by id desc limit 10");
         $query->execute();
		 $val = $query->fetchAll();
		 return $val;
	 }
	  function GetUserByid($id){
		 $query = $this->db->prepare("select * from users where id = '$id'");
         $query->execute();
		 $val = $query->fetchAll();
		return $val[0]['name'];
	 }
	 function GetAdminSetting(){
		 $query = $this->db->prepare("select * from admin where id =1");
         $query->execute();
		 $val = $query->fetchAll();
		 return $val;
	 }
	 function GetSetting(){
		 $query = $this->db->prepare("select * from tbl_setting where id =1");
         $query->execute();
		 $val = $query->fetchAll();
		 return $val;
	 }
	  function isLogin()
	  {
	  	  if(isset($_SESSION['loggs'])) : 
               return true;
               else : 
               	 return false;
	  	  	endif;
	  }
}

?>
