<?php
	include_once('../config.php');   
    
  
          
    if(!isset($_SESSION['userId']))
    { 
         header("Location: ../");
         die;
    }
       
                
                 
                
                
                 
                
                
                
                if(isset($_REQUEST['accPtId']))
                { 
                    
                    $stmt=$conn->prepare("update  UI__P2Prequest set AccRej=1   where id=:id ");     
                    $stmt->bindValue(':id',  $_REQUEST['accPtId'] , PDO::PARAM_INT);  
                    $stmt->execute();  
                    header("Location: p2pRequest.php");
                    die;   
                }
                if(isset($_REQUEST['rejectPtId']))
                { 
                   
                    $stmt=$conn->prepare("update  UI__P2Prequest set AccRej=2,status=1   where id=:id ");     
                    $stmt->bindValue(':id',  $_REQUEST['rejectPtId'] , PDO::PARAM_INT);  
                    $stmt->execute();  
                    header("Location: p2pRequest.php");
                    die;   
                }
                
             
                $stmt=$conn->prepare("select *   from  UI__P2Prequest  where custId=:custId    order by id desc");   
                $stmt->bindValue(':custId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                $stmt->execute(); 
                $Result = $stmt->fetchAll(PDO::FETCH_OBJ);   
               
 
                
include_once("../view/dashboard/p2pRequestList.php");
?>