<?php
	include_once('../config.php');   
     
          
    	
    if(!isset($_SESSION['userId']))
    { 
         header("Location: ../");
         die;
    }   
    
       
                    $stmt=$conn->prepare("select UPI,nm,phm,UPI3,marchant,UPI4 from  UI__Rgst  where  cuurentId=:userid   ");   
                    $stmt->bindValue(':userid',    $_SESSION['userId'] , PDO::PARAM_STR);  
                    $stmt->execute(); 
                    $UI__Rgst = $stmt->fetch(PDO::FETCH_OBJ); 
                    
                    if($UI__Rgst->marchant==1)
                        $UPI  = '{ "name" : "'.$UI__Rgst->nm.'", "vpa": "'.$UI__Rgst->UPI3.'" }'; 
                    else      
                        $UPI  = '{ "name" : "'.$UI__Rgst->nm.'", "vpa": "'.$UI__Rgst->UPI.'" }'; 
                     
                     
                     /*
                    $ch = curl_init();
                    curl_setopt($ch, CURLOPT_URL, 'https://upiqr.in/api/qr');
                    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
                    curl_setopt($ch, CURLOPT_POSTFIELDS, $UPI);
                    curl_setopt($ch, CURLOPT_POST, 1);
                    $headers = array();
                    $headers[] = "Accept: application/json";
                    //$headers[] = "Token: $jwt";
                    //$headers[] = "Authorisedkey: YTc0ZGI3ZjA1YzMxMjgwZTVjOTc0Y2E0OGQ3OTI0OTI=";
                    $headers[] = "Content-Type: application/json";
                    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
                    $result = curl_exec($ch); 
                    */
                    
include_once("../view/dashboard/Qr.php");
?>