52 lines
2.4 KiB
PHP
52 lines
2.4 KiB
PHP
<?php include('includes/header.php');
|
|
|
|
$studentAssignments = getStudentAssignments($studentInfos['data']['id']);
|
|
|
|
if ($studentAssignments) {
|
|
foreach ($studentAssignments as $assignment) {
|
|
$courseData = getById('tbl_courses',$assignment['course_id']);
|
|
$category_id = $courseData['data']['category_id'];
|
|
$categoryData = getById('tbl_categories',$category_id);
|
|
|
|
if (($courseData['data']['name']) && ($assignment['status'] != 'Abgelehnt')) {
|
|
if((($assignment['status'] == "Angemeldet") && ($categoryData['data']['confirmation'] == "yes"))
|
|
|| (($assignment['status'] == "Angemeldet") && ($categoryData['data']['confirmation'] == "custom") && ($courseData['data']['confirmation'] == "yes"))
|
|
) {
|
|
$statusText = "Angemeldet, warte auf Genehmigung...";
|
|
$statusColour = "secondary";
|
|
} else {
|
|
$statusText = "Angemeldet";
|
|
$statusColour = "success";
|
|
}
|
|
echo '<div class="card border border-light">';
|
|
echo '<h6 class="card-header text-white" style="background-color:#034f84;">' . $courseData['data']['name'] . ' - ' . $categoryData['data']['name'] . '</h6>';
|
|
echo '<div class="card-body p-3">';
|
|
echo '<p class="card-text"><span style="font-size:0.8em;" class="badge rounded-pill text-bg-' . $statusColour . '">' . $statusText . '</span></p>';
|
|
$courseID = $courseData['data']['id'];
|
|
$courseDeadline = getCourseDeadline($courseID);
|
|
|
|
// Überprüfen, ob die Deadline überschritten ist
|
|
if (strtotime($courseDeadline) >= strtotime('today')) {
|
|
|
|
echo '<a href="register.php?id=' . $category_id . '" class="btn btn-sm btn-outline-info mx-1"> <i class="ti ti-pencil"></i> Auswahl ändern</a>';
|
|
|
|
}
|
|
echo '<a href="course.php?id=' . $courseID . '" class="btn btn-sm btn-info mx-1"> <i class="ti ti-info-circle"></i> Kursinformationen</a>';
|
|
|
|
echo '</div>';
|
|
echo '</div>';
|
|
}
|
|
}
|
|
} else {
|
|
echo '
|
|
<div class="container">
|
|
<a href="./myregistrations.php" class="text-nowrap logo-img text-center d-block py-3 w-100">
|
|
<img src="../assets/images/backgrounds/i-dont-know.png" width="180" alt="">
|
|
</a>
|
|
<p class="text-center">Oh oh! Du hast noch keine Anmeldungen...</p>
|
|
</div>
|
|
';
|
|
}
|
|
?>
|
|
|
|
<?php include('includes/footer.php'); ?>
|