<?php
define("root", $_SERVER['DOCUMENT_ROOT']);
session_start();
require(root."/___simple_config.php");
require(root."/".adminFolder."/_common.php");
require(root."/".adminFolder."/_lib/db.php");
require(root."/".adminFolder."/_lib/main.php");
require(root."/".adminFolder."/_lib/mail.php");
global $mainHttpHost;
$pageUrl = "/".adminFolder."/alerts";
$a=cekpost(cleanQuery($_REQUEST["a"]), "");
if ($a=="notifonce") {
	if ($b=="nobar") {
		if (isset($_SESSION["notifnobar"]) && $_SESSION["notifnobar"]!="") {
			echo 0;
		} else {
			echo 1;
			$_SESSION["notifnobar"] = 1;
		}
	}
}
if ($a=="check") {
	$b=cekpost(cleanQuery($_REQUEST["b"]), "");
	$lempar = '';
	if ($b=="all") {
		$rs=array();$q="SELECT COUNT(kddeposit) AS jdepo FROM deposits WHERE isactive=1 AND ispending=1 AND tanggal!=''";
		callRS($rs, $q);
		
		$lempar .= "deposit";
		$lempar .= "$";
		$lempar .= $rs[0]["jdepo"];
		$lempar .= "$$";
		
		$rs=array();$q="SELECT COUNT(kdwithdraw) AS jwd FROM withdraws WHERE isactive=1 AND ispending=1 AND tanggal!=''";
		callRS($rs, $q);
		
		$lempar .= "withdraw";
		$lempar .= "$";
		$lempar .= $rs[0]["jwd"];
		$lempar .= "$$";
		
		$rs=array();$q="SELECT COUNT(kdmember) AS jmem FROM members WHERE isactive=1 AND kdaccount=0 AND isdeleted=0";
		callRS($rs, $q);
		
		$lempar .= "member";
		$lempar .= "$";
		$lempar .= $rs[0]["jmem"];
		#$lempar .= "$$";
		#$lempar .= "x";
	}
	echo $lempar;
}
?>