<?php
    $quReq="SELECT * FROM order_req WHERE Status='PENDING'";
	$reReq=mysqli_query($con,$quReq);
	$countReq=mysqli_num_rows($reReq);
	
	$quReqSettle="SELECT * FROM order_req WHERE S_Status='PENDING' AND Status!='PENDING'";
	$reReqSettle=mysqli_query($con,$quReqSettle);
	$countReqSettle=mysqli_num_rows($reReqSettle);
	
	$quComplain="SELECT * FROM complain WHERE Status='SUBMIT'";
	$reComplain=mysqli_query($con,$quComplain);
	$countComplain=mysqli_num_rows($reComplain);
	/*
	$quMsg="SELECT * FROM contactus WHERE Active!=1";
	$reMsg=mysqli_query($con,$quMsg);
	$countMsg=mysqli_num_rows($reMsg);
	*/
	//$Pdate = date("Y-m-d H:i:s");
    $Ptime = strtotime($time);
    $Ptime = $Ptime - (2 * 60);
    $Ptime = date("h:i:s A", $Ptime);
    
	$quPending="SELECT * FROM recharge WHERE Status='PENDING' AND Time<='$Ptime'";
	$rePending=mysqli_query($con,$quPending);
	$countPending=mysqli_num_rows($rePending);
	/*
	$quGetDupRef="SELECT Paynrechid, COUNT(Paynrechid) FROM wallet WHERE Transactiontype='Recharge_Refund' AND ActiveRefund='0' GROUP BY Paynrechid HAVING COUNT(Paynrechid)>1;";
	$reGetDupRef=mysqli_query($con,$quGetDupRef);
	$DupRef=mysqli_num_rows($reGetDupRef);
	*/
	$quUturn="SELECT * FROM wallet, recharge WHERE TxnType='Recharge_Refund' AND wallet.TxnId=recharge.Id AND recharge.Status = 'SUCCESS'";
	$reUturn=mysqli_query($con,$quUturn);
	$countUturn=mysqli_num_rows($reUturn);

	$quGetMinusDiff="SELECT * FROM recharge WHERE Diff<-10 AND Minus='0'";
	$reGetMinusDiff=mysqli_query($con,$quGetMinusDiff);
	$MinusDiff=mysqli_num_rows($reGetMinusDiff);

	
				echo "<a href='topup_reports.php' target='_blank'><div class='notifDiv'>
					    <i class='fa fa-shopping-cart'></i>";
					    if($countReq>0)
					    {
					        echo "<div class='nodi'>".$countReq."</div>";
					    }
				echo "</div></a>
				
				<a href='Payment_Settle_List.php' target='_blank'><div class='notifDiv'>
					<i class='fa fa-inr'></i>";
					    if($countReqSettle>0)
					    {
					        echo "<div class='nodi'>".$countReqSettle."</div>";
					    }
				echo "</div></a>
				
				<a href='complain_list.php' target='_blank'><div class='notifDiv'>
					<i class='fa fa-gavel'></i>";
					    if($countComplain>0)
					    {
					        echo "<div class='nodi'>".$countComplain."</div>";
					    }
				echo "</div></a>
				
				<a href='contact_us.php' target='_blank'><div class='notifDiv'>
					<i class='fa fa-envelope'></i>";
					    if($countMsg>0)
					    {
					        echo "<div class='nodi'>".$countMsg."</div>";
					    }
				echo "</div></a>
				
				<a href='Pending_Recharge.php' target='_blank'><div class='notifDiv'>
					<i class='fa fa-plane'></i>";
					    if($countPending>0)
					    {
					        echo "<div class='nodi'>".$countPending."</div>";
					    }
				echo "</div></a>
				
				<a href='#'><div class='notifDiv'>
					<i class='fa fa-clone'></i>";
					    if($DupRef>0)
					    {
					        echo "<div class='nodi'>".$DupRef."</div>";
					    }
				echo "</div></a>
				
				<a href='uTurnRecharge.php'><div class='notifDiv'>
					<i class='fa fa-exchange'></i>";
					    if($countUturn>0)
					    {
					        echo "<div class='nodi'>".$countUturn."</div>";
					    }
				echo "</div></a>
				
				<a href='minus_amount.php' target='_blank'><div class='notifDiv'>
					<i class='fa fa-angle-double-down'></i>";
					    if($MinusDiff>0)
					    {
					        echo "<div class='nodi'>".$MinusDiff."</div>";
					    }
				echo "</div></a>";
?>