예제 #1
0
     $res = AdminService::modifyAccount($username, $name, $sex, $birthday, $hobby, $declaration);
     if ($res) {
         header("Location: http://localhost/healthyone/view/Setting.php?success=1");
         exit;
     } else {
         header("Location: http://localhost/healthyone/view/Setting.php?errno=1");
         exit;
     }
 } else {
     if ($_GET['operation'] == 1) {
         $oldPassword = $_POST['oldPassword'];
         $newPassword = $_POST['newPassword'];
         session_start();
         $username = $_SESSION["username"];
         $type = $_SESSION["type"];
         $res = AdminService::modifyPassword($username, $oldPassword, $newPassword);
         if ($res) {
             if ($type == 2) {
                 header("Location: http://localhost/healthyone/view/specialPasswordSetting.php?success=1");
             } elseif ($type == 3) {
                 header("Location: http://localhost/healthyone/view/adminPasswordSetting.php?success=1");
             } else {
                 header("Location: http://localhost/healthyone/view/passwordSetting.php?success=1");
             }
         } else {
             if ($type == 2) {
                 header("Location: http://localhost/healthyone/view/specialPasswordSetting.php?errno=0");
             } elseif ($type == 3) {
                 header("Location: http://localhost/healthyone/view/adminPasswordSetting.php?errno=0");
             } else {
                 header("Location: http://localhost/healthyone/view/passwordSetting.php?errno=0");