Пример #1
0
 function editFamilyMember()
 {
     if (isset($_POST["UserId"]) && isset($_POST["UserName"]) && isset($_POST["UserInfoFirstName"]) && isset($_POST["UserInfoLastName"]) && isset($_POST["UserInfoTel"])) {
         //TODO: Verif si email déjà en utilisation, si oui alors modification annulé
         Users::updateFirstLastName($_POST["UserId"], $_POST["UserInfoFirstName"], $_POST["UserInfoLastName"]);
         Users::updateTel($_POST["UserId"], $_POST["UserInfoTel"]);
         Users::updateUserName($_POST["UserId"], $_POST["UserName"]);
         $user = Users::getUser($_POST["UserId"]);
         $phoneNumber = $user["UserInfoTel"];
         $phoneNumber = Registration::normalizePhoneNumber($phoneNumber);
         $user["UserInfoTel"] = $phoneNumber[0] . " (" . mb_substr($phoneNumber, 1, 3) . ") " . mb_substr($phoneNumber, 4, 3) . "-" . mb_substr($phoneNumber, 7, 4);
         echo json_encode($user);
     }
 }