<?php
	include_once('../config.php');   
    
  
          
    if(!isset($_SESSION['userId']))
    { 
         header("Location: ../");
         die;
    }
       
        
                   
                        
                         
                        $stmt=$conn->prepare("SELECT * FROM `moneytransfer`  where bankTrnfer= 1 and   cust_id=:cust_id");   
                        $stmt->bindValue(':cust_id',  $_SESSION['userId'] , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        $IMPS = $stmt->fetchAll(PDO::FETCH_OBJ); 
                        
                        foreach($IMPS as $imp)
                            $IMPSTOTAL +=$imp->amount;
                        
                        
                            
                        $stmt=$conn->prepare("SELECT * FROM `moneytransfer`  where bankTrnfer= 0 and   cust_id=:cust_id");   
                        $stmt->bindValue(':cust_id',  $_SESSION['userId'] , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        $NEFT = $stmt->fetchAll(PDO::FETCH_OBJ); 

                        foreach($NEFT as $imp)
                            $NEFTTOTAL +=$imp->amount;
                        



                        $stmt=$conn->prepare("SELECT * FROM `UI__WithDraw`  where payout=1  and  userid=:userid ");   
                        $stmt->bindValue(':userid',  $_SESSION['userId'] , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        $UPI = $stmt->fetchAll(PDO::FETCH_OBJ); 
                        
                        foreach($UPI as $imp)
                            $UPISTOTAL +=$imp->amt;
                            
                        
                        $stmt=$conn->prepare("SELECT * FROM `UI__DChstr`  where byId=:byId ");   
                        $stmt->bindValue(':byId',  $_SESSION['userId'] , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        $byId = $stmt->fetchAll(PDO::FETCH_OBJ); 
                        
                        foreach($byId as $imp)
                            $TOPUPTOTAL +=$imp->amt;
                            
                    
                    $stmt=$conn->prepare("SELECT * FROM `UI__WithDraw`  where TWhm!='' and userid=:userid    ");   
                    $stmt->bindValue(':userid',  $_SESSION['userId'] , PDO::PARAM_STR);   
                    $stmt->execute(); 
                    $UserId = $stmt->fetchAll(PDO::FETCH_OBJ);   
                    
                    foreach($UserId as $imp)
                            $IDTOTOTAL +=$imp->amt;
                            
                            
                                
include_once("../view/dashboard/DebitData.php");
?>