system: Linux mars.sprixweb.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
cmd: 

Direktori : /home/pfhr/public_html/admin/classes/Model/
Upload File :
Current File : /home/pfhr/public_html/admin/classes/Model/MAdminHome.php

<?PHP
class Model_MAdminHome
{

	function logoutStatus()
	{
		session_destroy();
		session_unset();
		$_SESSION = array();

		$getLogin = new Bin_Query();
		$sql = "SELECT * FROM admin_log_table ORDER BY `admin_log_id` DESC";
		if($getLogin->executeQuery($sql))
			$lastLogin = $getLogin->records[0]['admin_log_time'];

		$date = new DateTime($lastLogin);
		$lastdate = $date->format('l, F d, Y');
		$lasttime = $date->format('h:i A');
		
		$date = new DateTime(date('Y-m-d h:i:s'));
		$currentdate = $date->format('l, F d, Y');
		$currenttime = $date->format('h:i A');
		
		$detail = array(1=>$lastdate,2=>$lasttime,3=>$currentdate,4=>$currenttime);		
		//return "You Have been Succefully Logged out";
		return $detail;
		
		//header('location:?do=adminlogin');
		//exit;
	}   
	
	
	function totalUsers()
	{
		
		$sql="SELECT count(*) as totaluser FROM  members_table";
		$qry = new Bin_Query();
		$qry->executeQuery($sql);
		
	    return $qry->records[0]['totaluser'];
	}  
	
	
		function todayUsers()
	{
		
		$jointoday="select count(*) as todayusers from members_table where TO_DAYS((members_doj))-TO_DAYS(NOW())=0"; 
		$qry = new Bin_Query();
		$qry->executeQuery($jointoday);
		
	    return $qry->records[0]['todayusers'];
	}
	
		function activeUsers()
	{
		
		$sql="SELECT count(*) as activeusers FROM  members_table where members_status='1' and members_verified='1'";
		$qry = new Bin_Query();
		$qry->executeQuery($sql);
		
	    return $qry->records[0]['activeusers'];
	}
	
		function suspendedUsers()
	{
		
		$sql="SELECT count(*) as suspendedusers FROM  members_table where members_status='0' and members_verified='1'";
		$qry = new Bin_Query();
		$qry->executeQuery($sql);
		
	    return $qry->records[0]['suspendedusers'];
	}
	
		function unverifiedUsers()
	{
		
		$sql="SELECT count(*) as unverifiedusers FROM  members_table where members_status='0' and members_verified='0'";
		$qry = new Bin_Query();
		$qry->executeQuery($sql);
		
	    return $qry->records[0]['unverifiedusers'];
	}
	
		function showFaq()
	{
		
		    $sql="SELECT * FROM  faq_table ORDER by faq_id desc LIMIT 0,8";
			$qry = new Bin_Query();
			$qry->executeQuery($sql);
		
			return Display_DAdminHome::showFaq($qry->records);
	}
	
		function transactionLog()
	{
		
		   	$sql="SELECT a.*,b.paymentsettings_name,c.members_username FROM paymenthistory_table a,paymentsettings_table b,members_table c WHERE a.paymenthistory_mode=b.paymentsettings_id  and a.paymenthistory_member_id=c.members_id ORDER by paymenthistory_id desc LIMIT 0,10";
			$qry = new Bin_Query();
			$qry->executeQuery($sql);
		 
			return Display_DAdminHome::transactionLog($qry->records);
	}
	
		function latestNews()
	{
		
		    $sql="SELECT * FROM  news_table ORDER by news_id desc LIMIT 0,10";
			$qry = new Bin_Query();
			$qry->executeQuery($sql);
		
			return Display_DAdminHome::latestNews($qry->records);
	}
	
		function latestMembers()
	{
		
		    $sql="SELECT * FROM   members_table ORDER by members_username desc LIMIT 0,10";
			$qry = new Bin_Query();
			$qry->executeQuery($sql);
		
			return Display_DAdminHome::latestMembers($qry->records);
	}
	


	function getName($mid)
	{
		$earningQuery = new Bin_Query();
		$name_query="select * from members_table where members_id='".$mid."'";
		$earningQuery->executeQuery($name_query);			
		$name=$earningQuery->records[0]['members_username'];
		return $name;
	}
	
}