<?php 
	include_once('../config.php');  
          
    if(!isset($_SESSION['userId']))
    { 
         header("Location: ../");
         die;
    }
       
         
              
                
                $stmt=$conn->prepare("SELECT  is_active  FROM  UI__PoolPlan100k  where   custId=:custId ");   
                $stmt->bindValue(':custId',  $_REQUEST['poolId'] , PDO::PARAM_INT);  
                $stmt->execute(); 
                $Result = $stmt->fetch(PDO::FETCH_OBJ);   
                
               
               $poolPro = 0;    
               
               if($Result->is_active==1)
                $poolPro = 100000;
                
                
                
                 $stmt=$conn->prepare("SELECT  id  FROM  UI__PoolCoupon100k  where   custId=:custId ");   
                $stmt->bindValue(':custId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                $stmt->execute(); 
                $ResultAll = $stmt->fetch(PDO::FETCH_OBJ);   
               
                
                        
                foreach($ResultAll as $mpp)
                    $poolPro +=100000;
                    
                  
         
        
        $stmt=$conn->prepare("SELECT  *   FROM  UI__Tpm  where   TopUpId=:custId and poolSpoat=2 ");   
        $stmt->bindValue(':custId', $_SESSION['userId'] , PDO::PARAM_INT);  
        $stmt->execute(); 
        $Result = $stmt->fetchAll(PDO::FETCH_OBJ); 
        
        foreach($Result as $mpp)
            $userId +=$mpp->Amt;
        
        
        $UsedBal +=($userId+$poolPro);
        
                
include_once("../view/dashboard/pooldia100k.php");
?>