Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 1 | <?php |
| 2 | require '../php/utils.php'; |
Andreu | 09b8b05 | 2019-09-21 21:47:20 +0200 | [diff] [blame] | 3 | $user = get_users($_POST['id']); |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 4 | |
Andreu | 20cbd1d | 2019-09-22 00:00:57 +0200 | [diff] [blame^] | 5 | $text_columns = ["nomcomplet", "md5password"]; |
| 6 | |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 7 | echo '{ '; |
| 8 | $first = true; |
| 9 | foreach ($user as $prop => $value) { |
| 10 | if (!$first) echo ', '; |
| 11 | else $first = false; |
Andreu | 20cbd1d | 2019-09-22 00:00:57 +0200 | [diff] [blame^] | 12 | if (in_array($prop, $text_columns)) echo '"'.$prop.'": "'.$value.'"'; |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 13 | else echo '"'.$prop.'": '.$value; |
| 14 | } |
| 15 | echo ' }'; |
| 16 | ?> |