<?php
session_start();
include_once '../includes/autoloader.php';
include_once '../includes/function.php';
 $objvalidate = new bank;
 header('Content-Type: application/json');
 if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $data = $_POST; 
 
$inputId = purify($data["id"]) ;
$inputSender = purify($data["sender"]) ;
$inputRecipient = purify($data["recipient"]);
$inputTransferAmount = purify($data["transferAmount"]);
$inputTransProDate = purify($data["transProDate"]);
$inputTransferFee = purify($data["transferFee"]);
$inputPercentage = purify($data["percentage"]);
$inputTransfeeStatus = purify($data["transfeeStatus"]);
$inputMaturityDate = purify($data["maturityDate"]);
$inputMaturityDateStatus = purify($data["maturityDateStatus"]);
$inputCountry = purify($data["Country"]);

 
$progDetails = $objvalidate->fetchProgress($inputId);
if ($progDetails) {
$id = $inputId ?: $progDetails['id'] ;
$sender = $inputSender ?: $progDetails['sender'] ;
$recipient = $inputRecipient ?: $progDetails['reciepient'] ;
$transferAmount = $inputTransferAmount ?: $progDetails['Transferamount'] ;
$transProDate = $inputTransProDate ?: $progDetails['transProDate'] ;
$transferFee = $inputTransferFee ?: $progDetails['TransferFee'] ;
$percentage = $inputPercentage ?: $progDetails['percentage'] ;
$transfeeStatus = $inputTransfeeStatus ?: $progDetails['transfeeStatus'] ;
$maturityDate = $inputMaturityDate ?: $progDetails['maturityDate'] ;
$maturityDateStatus = $inputMaturityDateStatus ?: $progDetails['maturityDateStatus'] ;
$Country = $inputCountry ?: $progDetails['Country'] ;

 

if ($sender) {
    // $sha = password_hash($password, PASSWORD_DEFAULT);
$objvalidate->setSender($sender);
$objvalidate->setRecipient($recipient);
$objvalidate->setTransferAmount($transferAmount);
$objvalidate->setTransProDate($transProDate);
$objvalidate->setTransferFee($transferFee);
$objvalidate->setPercentage($percentage);
$objvalidate->setTransfeeStatus($transfeeStatus);
$objvalidate->setMaturityDate($maturityDate);
$objvalidate->setMaturityDateStatus($maturityDateStatus);
$objvalidate->setcountry($Country);
$save = $objvalidate->updateProgress($inputId);
if ($save) {
 echo 'true';
  }
}
}
}