<?php
	include_once('../config.php');    
    include_once(ABS_PATH.'/custom_function/default.php');       
          
        
        
            
            
            $stmt=$conn->prepare("select eml,nm,phm,utilities 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;
            $BY = $UI__Rgst->nm; 
             
            $PAYWAllet = GetBalance(); 

          

         
        if($UI__Rgst->utilities=="")
            $IdToId = 0;
        else{
            $expln =  explode(",",$UI__Rgst->utilities); 
            $IdToId = $expln[2];
        }   
    
    	
     if( (!isset($_SESSION['userId'])) || ($IdToId!=1) )
    { 
         header("Location: ../");
         die;
    }   
    
     
      
      
    
    if(isset($_REQUEST['UPI']))
    {
             
           
    }
      
  
    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'];                    
                    
            } 
    }  
     
include_once("../view/dashboard/idToIdTra.php");
?>