<?php

include '../../connection.php'; 

session_start(); // Start the session

// Check if the user is logged in
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
    header("Location: ../index.php"); // Redirect to login page if not logged in
    exit();
}

 

$sql = "SELECT COUNT(*) AS TopUpRqst FROM mobile_topup WHERE status = 'Pending'";
$stmt = $con->prepare($sql);
$stmt->execute();
$stmt->bind_result($TopUpRqst);
$stmt->fetch();
$stmt->close();

// Set a default value if there are no pending records
$TopUpRqst = $TopUpRqst ?? 0; 




$sql = "SELECT COUNT(*) AS addBalAuto FROM balance_history WHERE status = 'Pending'";
$stmt = $con->prepare($sql);
$stmt->execute();
$stmt->bind_result($addBalAuto);
$stmt->fetch();
$stmt->close();

// Set a default value if there are no pending records
$addBalAuto = $addBalAuto ?? 0; 


$sql = "SELECT COUNT(*) AS addBalMan FROM manual_add_money WHERE status = 'Pending'";
$stmt = $con->prepare($sql);
$stmt->execute();
$stmt->bind_result($addBalMan);
$stmt->fetch();
$stmt->close();

// Set a default value if there are no pending records
$addBalMan = $addBalMan ?? 0; 



$sql = "SELECT COUNT(*) AS MobileBank FROM mobile_banking WHERE status = 'Pending'";
$stmt = $con->prepare($sql);
$stmt->execute();
$stmt->bind_result($MobileBank);
$stmt->fetch();
$stmt->close();

// Set a default value if there are no pending records
$MobileBank = $MobileBank ?? 0; 



$sql = "SELECT COUNT(*) AS Bank FROM banking WHERE status = 'Pending'";
$stmt = $con->prepare($sql);
$stmt->execute();
$stmt->bind_result($Bank);
$stmt->fetch();
$stmt->close();

// Set a default value if there are no pending records
$Bank = $Bank ?? 0; 



$sql = "SELECT COUNT(*) AS billPay FROM bill_pay WHERE status = 'Pending'";
$stmt = $con->prepare($sql);
$stmt->execute();
$stmt->bind_result($billPay);
$stmt->fetch();
$stmt->close();

// Set a default value if there are no pending records
$billPay = $billPay ?? 0; 



$sql = "SELECT COUNT(*) AS BuyPack FROM drive_package_rqst WHERE status = 'Pending'";
$stmt = $con->prepare($sql);
$stmt->execute();
$stmt->bind_result($BuyPack);
$stmt->fetch();
$stmt->close();

// Set a default value if there are no pending records
$BuyPack = $BuyPack ?? 0; 



?>


<!DOCTYPE html>
<html lang="en">

<head>

	<title>Easy Money Transfer</title>
	
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="description"
		content="Dasho Bootstrap admin template made using Bootstrap 5 and it has huge amount of ready made feature, UI components, pages which completely fulfills any dashboard needs." />
	<meta name="keywords"
		content="admin templates, bootstrap admin templates, bootstrap 5, dashboard, dashboard templets, sass admin templets, html admin templates, responsive, bootstrap admin templates free download,premium bootstrap admin templates, Dasho, Dasho bootstrap admin template">
	<meta name="author" content="Phoenixcoded" />

	<!-- Favicon icon -->
	<link rel="icon" href="assets/images/favicon.svg" type="image/x-icon">
	<!-- fontawesome icon -->
	<link rel="stylesheet" href="assets/fonts/fontawesome/css/fontawesome-all.min.css">
	<!-- animation css -->
	<link rel="stylesheet" href="assets/plugins/animation/css/animate.min.css">
	
	<!-- notification css -->
	<link rel="stylesheet" href="assets/plugins/notification/css/notification.min.css">
	
	 <!-- data tables css -->
    <link rel="stylesheet" href="assets/plugins/data-tables/css/datatables.min.css">

	<!-- vendor css -->
	<link rel="stylesheet" href="assets/css/style.css">

</head>

<body class="">
	<!-- [ Pre-loader ] start -->
	<div class="loader-bg">
		<div class="loader-track">
			<div class="loader-fill"></div>
		</div>
	</div>