<?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);

echo $amount   = $_GET['amount'];
$id       = $_GET['id'];
$user_id  =$_GET['user_id'];

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

echo $user->approveLoan($user_id,$id,$amount);

// echo $user->createTransaction($amount,$user_id,$reference,'nill',$c,$status,'Credit');

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



?>