diff options
| author | Debulois <quentin@debulois.fr> | 2022-03-31 14:56:45 +0200 |
|---|---|---|
| committer | Debulois <quentin@debulois.fr> | 2022-03-31 14:56:45 +0200 |
| commit | b637d625216e50602d0bde8a544c281ca00af5fa (patch) | |
| tree | 5e44ad1048f8a3583cc854fe3bc21086ede4d88a /Core/Functions/func_info.php | |
| parent | c9d4c87b21f1050a780f5296961d24bd17c9cdc8 (diff) | |
Grosse maj encore avec ajout de fonctionnalités dans l'admin principalement et grosse remise en page / rennomage et preparation pour retravailler le CSS
Diffstat (limited to 'Core/Functions/func_info.php')
| -rw-r--r-- | Core/Functions/func_info.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Core/Functions/func_info.php b/Core/Functions/func_info.php new file mode 100644 index 0000000..8464fe1 --- /dev/null +++ b/Core/Functions/func_info.php @@ -0,0 +1,41 @@ +<?php + +// ############################################################################ +// # # +// # Description: Fonction de modifications des informations de l'utilisateur # +// # par ID # +// # # +// ############################################################################ + +function info_update_user_infos($userInfos, $userId, $userStatus) { + $dbuser = new DbUser; + $dbsearch = new DbSearch; + + switch ($userStatus) { + case 1: + $isPro = true; + break; + default: + $isPro = false; + break; + } + + if ($isPro) { + $userJobs = $dbsearch->get_pro_job_by_proid($userId); + $userJobsId = []; + for ($i = 0; $i < count($userJobs); $i++) { + array_push($userJobsId, $userJobs[$i]["jobCategoryId"]); + } + $dbuser->update_user_infos($userInfos, $userId, $isPro, $userJobsId); + } else { + $dbuser->update_user_infos($userInfos, $userId, $isPro); + } + + // Redirection vers message avec l'index du message à afficher. + $message = ["infosUpdate", "success"]; + $_SESSION["message"] = $message; + header("Location: /Templates/message.php"); + die(); +} + +?>
\ No newline at end of file |
