<?php
	include_once('../config.php');    
    include_once(ABS_PATH.'/custom_function/default.php');       
        
       
            $stmt=$conn->prepare("select eml,nm,phm from UI__Rgst    where cuurentId=:cuurentId     ");   
            $stmt->bindValue(':cuurentId',  $_SESSION['userId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__Rgst = $stmt->fetch(PDO::FETCH_OBJ);            
            $Email  = $UI__Rgst->eml;
            
            
            
            $stmt=$conn->prepare("select nm  from UI__Rgst    where cuurentId=:cuurentId     ");   
            $stmt->bindValue(':cuurentId',  $_SESSION['userId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__nm = $stmt->fetch(PDO::FETCH_OBJ);     
            $BY = $UI__nm->nm;
            
            $PAYWAllet = GetBalance(); 



        $stmt=$conn->prepare("select utilities from UI__Rgst    where cuurentId =:sId    ");   
        $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
        $stmt->execute(); 
        $user = $stmt->fetch(PDO::FETCH_OBJ);   
 
         
        if($user->utilities=="")
            $UpiA = 0;
        else{
            $expln =  explode(",",$user->utilities); 
            $UpiA = $expln[0];
        }   
            
            
     
    
    	
    if( (!isset($_SESSION['userId'])) || ($UpiA!=1) )
    { 
         header("Location: ../");
         die;
    } 
    
    
     
      
      
      
 
 
    $_REQUEST['UPI'] = "upi://pay?pa=paytmqr5748cw@paytm"; 
    if(isset($_REQUEST['UPI']))
        include_once("Payput_upi.php");           
     else 
     {
            $stmt = $conn->prepare("SELECT upi,id,name FROM  UI__UPIVefy     where ById=:ById");   
            $stmt->bindValue(':ById',  $_SESSION['userId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__upi = $stmt->fetchAll(PDO::FETCH_OBJ);       
                
            $stmt=$conn->prepare("select  charges from  UI__Deduction"); 
            $stmt->execute();
            $UI__Deduction = $stmt->fetch(PDO::FETCH_OBJ);  
            
  
      
            

    include_once("../view/dashboard/Payout.php");
    } 
?>