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

$con = $data->connect();

$user = new User($con);

 
$data = new Database;

$con = $data->connect();

$post = filter_var_array($_POST,FILTER_SANITIZE_FULL_SPECIAL_CHARS);

$reason        = $post['reason'];
$facility      = $post['facility'];
$amount        = $post['amount'];
$tenure        = $post['tenure'];
$status = 'pending';

$_SESSION['t_error_c']  = 'loan application successful';

echo $user->loan($amount,$facility,$tenure .' months',$reason,$status);

echo $data->redirect('../account/../index?loan=loan');

?>