function getMoreUserInfo($user_id, $user_info) { $type = getUserTypeById($user_id); if ($type === "Student") { return array_merge($user_info, getStudentInfoById($user_id)); } else { if ($type === "Tutor") { return array_merge($user_info, getTutorInfoById($user_id)); } } return null; }
<div id="content"> <div id="main-content"> <?php $user_id = $_SESSION["user_id"]; if (isset($_POST["current_password"])) { if (isset($_POST["first_name"], $_POST["last_name"], $_POST["email"], $_POST["current_password"], $_POST["phone_number"], $_POST["address"], $_POST["password"], $_POST["confirm_password"])) { $update = updateProfile($user_id, $_POST); $update === true ? $update = UPDATE_PROFILE_SUCCESS : ($update = $update); # $update = ($update === true) ? UPDATE_PROFILE_SUCCESS : $update; $_SESSION["notice"] = $update; displayNotice(); } } $u = getFullUserById($user_id); $type = getUserTypeById($user_id); ?> <h4> Profile Information </h4> <form action="profile" id="profile-form" class="form-horizontal" method="post"> <div class="form-group"> <label class="control-label col-sm-3">Account Type: </label> <div class="col-sm-4" style="margin-top: 9px;"> <?php if ($type === "Student") { echo "Student"; } else { if ($type === "Tutor") { echo "Tutor"; } else { redirectOut(); }