Initial commit with updated Auth and media ignored
This commit is contained in:
35
ride/profile/get.php
Normal file
35
ride/profile/get.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$id = filterRequest("id");
|
||||
|
||||
$sql = "SELECT * FROM `passengers` WHERE `id` = :id";
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':id', $id, PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($result) {
|
||||
unset($result['password']); // إخفاء الباسورد
|
||||
|
||||
// فك تشفير الحقول الحساسة
|
||||
$fieldsToDecrypt = [
|
||||
'phone', 'email', 'gender', 'birthdate', 'site',
|
||||
'first_name', 'last_name', 'sosPhone',
|
||||
'education', 'employmentType', 'maritalStatus'
|
||||
];
|
||||
|
||||
foreach ($fieldsToDecrypt as $field) {
|
||||
if (isset($result[$field])) {
|
||||
$result[$field] = $encryptionHelper->decryptData($result[$field]);
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
"status" => "success",
|
||||
"data" => $result
|
||||
]);
|
||||
} else {
|
||||
jsonError("Failed to retrieve passenger data");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user