<?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(); 
     	
    if(!isset($_SESSION['userId']))
    { 
         header("Location: ../");
         die;
    }        
    
  
    if(isset($_REQUEST['UPI']))
    {
          
            $STRPOS  = strpos($_REQUEST['UPI'],"pa=");
          
            if($STRPOS>0)
            {
            
                $exp0 = explode("pa=",$_REQUEST['UPI']);      
                $exp1 = explode("&", $exp0[1]);
                 
                $exp2 = explode("pn=",$_REQUEST['UPI']);      
                $exp3 = explode("&", $exp2[1]);   
                $ary['status'] = "success"; 
                $MyUpiName =  str_replace("%20"," ",$exp3[0]);
                $MyUpi =  $exp1[0]; 
                
            } else 
            {
                
                $stmt=$conn->prepare("select  nm,cuurentId from UI__Rgst    where UPI=:UPI     ");   
                $stmt->bindValue(':UPI', trim($_REQUEST['UPI']) , PDO::PARAM_INT);  
                $stmt->execute(); 
                
                //
                
                if($stmt->rowCount()>0)   
                {
                    $UPIN = $stmt->fetch(PDO::FETCH_OBJ); 
                    $MyUpiName = '('.$UPIN->cuurentId.') ,'.str_replace("%20"," ",$UPIN->nm); 
                    $MyUpi = $_REQUEST['UPI'];
                }else
                    $MyUpiName =  str_replace("%20"," ",$exp3[0]);  
                    $MyUpi =   trim($_REQUEST['pa']);
                    
                $MyUpi = $_REQUEST['UPI'];                    
                    
            } 
             
    }   
     
            $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/CustomQr.php");
?>