prepare($sql); $stmt->bindParam(':id', $id); $stmt->bindParam(':appName', $appName); $stmt->bindParam(':platform', $platform); $stmt->execute(); $data = $stmt->fetchAll(PDO::FETCH_ASSOC); $count = $stmt->rowCount(); // تجهيز الرد header('Content-Type: application/json'); if ($count > 0) { foreach ($data as &$row) { // فك تشفير الحقول الحساسة $row['phone'] = $encryptionHelper->decryptData($row['phone']); $row['email'] = $encryptionHelper->decryptData($row['email']); $row['gender'] = $encryptionHelper->decryptData($row['gender']); $row['birthdate'] = $encryptionHelper->decryptData($row['birthdate']); $row['site'] = $encryptionHelper->decryptData($row['site']); $row['first_name'] = $encryptionHelper->decryptData($row['first_name']); $row['last_name'] = $encryptionHelper->decryptData($row['last_name']); $row['sosPhone'] = $encryptionHelper->decryptData($row['sosPhone']); $row['education'] = $encryptionHelper->decryptData($row['education']); $row['employmentType'] = $encryptionHelper->decryptData($row['employmentType']); $row['maritalStatus'] = $encryptionHelper->decryptData($row['maritalStatus']); // فك تشفير توكن FCM إذا وجد if (!empty($row['fcm_token'])) { $row['fcm_token'] = $encryptionHelper->decryptData($row['fcm_token']); } } echo json_encode([ "status" => "success", "count" => $count, "data" => $data ]); } else { error_log("User does not exist: " . $email); echo json_encode([ "status" => "Failure", "data" => "User does not exist." ]); } // تنظيف الموارد $stmt = null; $con = null; exit();