Initial work on registrar deposit payments

This commit is contained in:
Pinga 2023-11-17 02:16:26 +02:00
parent 97818e59e0
commit 2236e77d18
2 changed files with 128 additions and 1 deletions

View file

@ -26,7 +26,28 @@ class FinancialsController extends Controller
public function deposit(Request $request, Response $response)
{
if ($_SESSION["auth_roles"] != 0) {
return $response->withHeader('Location', '/dashboard')->withStatus(302);
if ($request->getMethod() === 'POST') {
// Retrieve POST data
$data = $request->getParsedBody();
$db = $this->container->get('db');
$balance = $db->selectRow('SELECT name, email, accountBalance, creditLimit FROM registrar WHERE id = ?',
[ $_SESSION["auth_registrar_id"] ]
);
echo "Payment here";
return view($response,'admin/financials/deposit-registrar.twig', [
'balance' => $balance
]);
}
$db = $this->container->get('db');
$balance = $db->selectRow('SELECT name, accountBalance, creditLimit FROM registrar WHERE id = ?',
[ $_SESSION["auth_registrar_id"] ]
);
return view($response,'admin/financials/deposit-registrar.twig', [
'balance' => $balance
]);
}
if ($request->getMethod() === 'POST') {