<?php
include '../config/index.php';
include '../module/index.php';
 
$data = new Database;

$con  = $data->connect();

$user = new User($con);

 if(isset($_GET['amount'])){
   $amount   = $_GET['amount'];
   $id       = $_GET['id'];
   $user_id  = $_GET['user_id'];

   $type = 'Credit';

  $reference = uniqid();
  $date = new DateTime();
  $c = $date->format('d M y, h:i a'); // 21 Dec 22, 08:39 pm
  $status = 'revasal';
  $remark= "REVERSAL".rand(00000,99999);


echo $user->creditTransfer($amount,$user_id);
echo $user->delete_transfer_request($id);
echo $user->createTransaction($amount,$user_id,$reference,'nill',$c,$status,$type,$remark);
echo $data->redirect('../account/../index?req=req');

 }else{
   echo $data->redirect('../account/../index?req=req');
 }




?>