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

$con = $data->connect();

$user = new User($con);

$post = filter_var_array($_POST,FILTER_SANITIZE_FULL_SPECIAL_CHARS);

$amount = $post['amount'];
$user_name = $post['name'];
$id = $post['id'];
$d = 'DT';

$reference = uniqid();
$date = new DateTime();
$c = $date->format('d M y, h:i a'); // 21 Dec 22, 08:39 pm
$status = 'complete';
$type = "Debit";


echo $user->reUserId('balance',$id,$amount);

// echo $user->createTransaction($amount,$id,$reference,'nill',$c,$status,$type);
echo $user->createTransaction($amount,$id,$reference,'nill',$c,$status,$type,$user_name.'/'.$d.'_'.$reference.'>'.$amount);


$_SESSION['t_error_c']  = 'Transaction complete sucessfully';
echo $data->redirect('../account/../index?single='.$id);



?>