<?php
	include_once('../config.php');   
    
  
          
    if(!isset($_SESSION['userId']))
    { 
         header("Location: ../");
         die;
    }
    
                    if(isset($_POST['submit']))
                    {    
                 
                             
                            if($_POST['limit']>0) {
                            $stmt=$conn->prepare("update  UI__Rgst   set p2pLimit=:p2pLimit where cuurentId=:cuurentId ");    
                            $stmt->bindValue(':p2pLimit', $_POST['limit'] , PDO::PARAM_STR); 
                            $stmt->bindValue(':cuurentId', $_SESSION['userId'] , PDO::PARAM_STR); 
                            $stmt->execute();     
                            }
                            $_SESSION['Regis'] = "Limit Updated";
                            header("Location: p2plimit.php");  
                            die;
                    }         
             
            $stmt=$conn->prepare("select   p2pLimit  from  UI__Rgst where custId =:custId ");   
            $stmt->bindValue(':custId', $_SESSION['userCustId'] , PDO::PARAM_STR);  
            $stmt->execute(); 
            $FResult = $stmt->fetch(PDO::FETCH_OBJ); 
       
               
include_once("../view/dashboard/p2plimit.php");
?>