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

🐛 Fix non-year-specific loading of subjects #45

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions homework/add/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

// Get all subjects
$subjectlist = array();
if ($stmt = $con->prepare("SELECT name, color, id, last_used, average FROM " . $config["db"]["tables"]["subjects"] . " WHERE user_id = ?")) {
$stmt->bind_param("s", $_SESSION["user_id"]);
if ($stmt = $con->prepare("SELECT name, color, id, last_used, average FROM " . $config["db"]["tables"]["subjects"] . " WHERE user_id = ? AND year = ?")) {
$stmt->bind_param("ss", $_SESSION["user_id"], $_SESSION["setting_years"]);
$stmt->execute();
$stmt->bind_result($subject_name, $subject_color, $subject_id, $subject_last_used, $subject_grade_average);
while ($stmt->fetch()) {
Expand Down
2 changes: 1 addition & 1 deletion homework/edit/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
<script src="https://assets.noten-app.de/js/jquery/jquery-3.6.1.min.js"></script>
<script src="https://assets.noten-app.de/js/themes/themes.js"></script>
<script src="./type-switch.js"></script>
<script src="./edit-subject.js"></script>
<script src="./edit-homework.js"></script>
<?php if ($config["tracking"]["matomo"]["on"]) echo ($config["tracking"]["matomo"]["code"]); ?>
</body>

Expand Down