app settings

This commit is contained in:
Thanakorn S
2026-04-27 10:50:31 +07:00
parent 76b9b2a2cb
commit d8c55d278a
3128 changed files with 630683 additions and 138 deletions
@@ -0,0 +1,33 @@
<?php
session_start();
require '../../../assets/utils/db_auth.php';
try {
$sth = $pdo1->prepare(
"SELECT user_id, username, name, surname,
email, phone, country, address, profile_picture
FROM user
WHERE user_id = :user_id
LIMIT 1"
);
$sth->execute([':user_id' => $user_id]);
db_check($sth, $answer);
$user = $sth->fetch(PDO::FETCH_ASSOC);
if (!$user) {
$answer['message'] = 'User not found.';
http_response_code(404);
exit(json_encode($answer));
}
$answer['success'] = 1;
$answer['output'] = $user;
} catch (Exception $e) {
$answer['message'] = 'Failed to load profile.';
http_response_code(500);
}
exit(json_encode($answer));