<?php
	include_once('../config.php');   
    
  
          
    if(!isset($_SESSION['userId']))
    { 
         header("Location: ../");
         die;
    }        
      
      
      
                
                
        
            $payMent_Done = 0;         
            $Exp = explode("_",$_REQUEST['id']);
            
            if(count($Exp)>1)
            {
                $_REQUEST['id'] = $Exp[0];
                $payMent_Done = 1; 
            }
            
            
            $stmt=$conn->prepare("select  *   from  UI__Receipt where cdId =:cdId ");   
            $stmt->bindValue(':cdId', $_REQUEST['id'] , PDO::PARAM_STR);  
            $stmt->execute(); 
            $FResult = $stmt->fetch(PDO::FETCH_OBJ); 
            
             
            
           
            
            $stmt=$conn->prepare("select  *   from   UI__Rgst  where cuurentId =:custId ");   
            $stmt->bindValue(':custId', $_SESSION['userId'] , PDO::PARAM_STR);  
            $stmt->execute(); 
            $UI__Rgst = $stmt->fetch(PDO::FETCH_OBJ); 
             
             
            
            $stmt=$conn->prepare("select   custId from   UI__DebitCredit  where id =:custId ");   
            $stmt->bindValue(':custId', $_REQUEST['id'] , PDO::PARAM_STR);  
            $stmt->execute(); 
            $custId = $stmt->fetch(PDO::FETCH_OBJ);       
            
            
            
            $stmt=$conn->prepare("select *  from UI__AddAccount    where id =:sId   ");   
            $stmt->bindValue(':sId',  $_REQUEST['AccountList'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $acceptStats = $stmt->fetch(PDO::FETCH_OBJ);    
              
            
            $stmt=$conn->prepare("select pay2second  from UI__Rgst  where  cuurentId=:custId    ");   
            $stmt->bindValue(':custId',  $_SESSION['userId'] , PDO::PARAM_STR);  
            $stmt->execute(); 
            $dailyMonthly = $stmt->fetch(PDO::FETCH_OBJ); 
            
            $accountSet = 0;  
            if($dailyMonthly->pay2second==1)
                $accountSet = 1; 
         
         
            if($accountSet==1)
            {
                $stmt=$conn->prepare("select  UTR from     UI__TxnFailUsers  where cdId =:cdId ");   
                $stmt->bindValue(':cdId', $_REQUEST['id'] , PDO::PARAM_STR);  
                $stmt->execute(); 
                $UTR = $stmt->fetch(PDO::FETCH_OBJ);   
            }else
            { 
                $stmt=$conn->prepare("select  UTR from     UI__TxnFailUsersPay2  where cdId =:cdId ");   
                $stmt->bindValue(':cdId', $_REQUEST['id'] , PDO::PARAM_STR);  
                $stmt->execute(); 
                $UTR = $stmt->fetch(PDO::FETCH_OBJ);   
            }    
            
         
         
            $stmt=$conn->prepare("select  name from    UI__UPIVefy  where upi =:upi ");   
            $stmt->bindValue(':upi', $FResult->Topay , PDO::PARAM_STR);  
            $stmt->execute(); 
            $UI__UPIVefy = $stmt->fetch(PDO::FETCH_OBJ); 
            
       
                
                 
            unset($_SESSION['LastIntId']);  
include_once("../view/dashboard/mt2.php");
?>