Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #50 from noten-app/#49-School-year-null-on-login
Browse files Browse the repository at this point in the history
🐛 Fix School year null on login #49
  • Loading branch information
CuzImBisonratte authored Dec 1, 2023
2 parents c307069 + 9d80965 commit 10fcd42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions settings/school_years.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function loadYear(yearID) {
school_year: yearID
},
success: function (data) {
console.log(data);
location.reload();
}
});
Expand Down
9 changes: 5 additions & 4 deletions settings/school_years.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
// Set school year
$_SESSION["setting_years"] = $_POST["school_year"];
if ($stmt = $con->prepare("UPDATE " . $config["db"]["tables"]["accounts"] . " SET school_year = ? WHERE id = ?")) {
$stmt->bind_param("ss", $_SESSION["school_year"], $_SESSION["user_id"]);
$stmt->bind_param("ss", $_POST["school_year"], $_SESSION["user_id"]);
$stmt->execute();
}

// Redirect
header("Location: /settings");
// Redirect
// header("Location: /settings");
echo "UPDATE" . $config["db"]["tables"]["accounts"] . " SET school_year = " . $_SESSION["school_year"] . " WHERE id = " . $_SESSION["user_id"];
}

0 comments on commit 10fcd42

Please sign in to comment.