refactoring

This commit is contained in:
2025-04-13 15:57:16 -06:00
parent 27bfe8e7b3
commit 8f2c241c3d
29 changed files with 867 additions and 841 deletions
+18 -9
View File
@@ -1,9 +1,12 @@
<?php
require_once 'functions/init.php';
require_once 'functions/functions.php';
include_once 'functions/account_functions.php';
// UI Components
foreach (glob('components/user/*.php') as $file)
require_once $file;
$msg = '';
if (isset($_POST['form_id'])) {
@@ -86,13 +89,19 @@ if (isset($_POST['form_id'])) {
include_once 'components/head.php';
if ($_GET['action'] == 'login')
echo login_form(($msg ? $msg : ''));
else if ($_GET['action'] == 'signup')
echo signup_form(($msg ? $msg : ''));
else if ($_GET['action'] == 'logout')
logout();
else if ($_GET['action'] == 'view' && isset($_GET['user_id']))
echo user_view($_GET['user_id']);
switch ($_GET['view']) {
case 'login':
echo login_form(($msg ? $msg : ''));
break;
case 'signup':
echo signup_form(($msg ? $msg : ''));
break;
case 'logout':
logout();
break;
case 'display':
echo (isset($_GET['user_id']) ? user_view($_GET['user_id']) : header('Location: .'));
break;
}
include_once 'components/foot.php';