fixes
This commit is contained in:
parent
af6f6238ae
commit
4e243976db
@ -95,21 +95,16 @@ form .error {
|
|||||||
grid-template-columns: auto !important;
|
grid-template-columns: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fix radio buttons registration */
|
|
||||||
.radio {
|
.radio {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
|
||||||
max-width: 290px;
|
max-width: 290px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
gap: 24px;
|
||||||
|
|
||||||
.radio {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.radio input {
|
.radio input {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
|
height: var(--h-sm);
|
||||||
|
width: var(--h-sm);
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
/*Font-Weight*/
|
/*Font-Weight*/
|
||||||
--font-weight-semibold: 600;
|
--font-weight-semibold: 600;
|
||||||
|
|
||||||
|
--h-sm: 24px;
|
||||||
--h-md: 48px;
|
--h-md: 48px;
|
||||||
--border-primary: 1px solid #998E82;
|
--border-primary: 1px solid #998E82;
|
||||||
|
|
||||||
|
@ -157,17 +157,33 @@ class UserModel extends Database
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getMyCourses() {
|
public function getMyCourses() {
|
||||||
$sql = "SELECT k.id, k.name, k.preis, k.dauer, k.rabatt, k.kategorie, k.beschreibung, k.ort_id, o.stadt, o.strasse, o.plz, b.note, b.kommentar
|
$personId = $_SESSION["user_id"];
|
||||||
FROM kurs AS k
|
$isKursleiter = $_SESSION["user_role"] === "leiter";
|
||||||
JOIN ort AS o ON o.id = k.ort_id
|
|
||||||
LEFT JOIN bewertungen AS b ON b.kurs_id = k.id
|
|
||||||
ORDER BY k.name;";
|
|
||||||
|
|
||||||
$pdo = $this->linkDB();
|
$pdo = $this->linkDB();
|
||||||
|
|
||||||
|
if ($isKursleiter) {
|
||||||
|
$sql = "SELECT k.id, k.name, k.preis, k.dauer, k.rabatt, k.kategorie, k.beschreibung, k.ort_id,
|
||||||
|
o.stadt, o.strasse, o.plz, b.note, b.kommentar
|
||||||
|
FROM kurs AS k
|
||||||
|
JOIN ort AS o ON o.id = k.ort_id
|
||||||
|
LEFT JOIN bewertungen AS b ON b.kurs_id = k.id
|
||||||
|
WHERE k.kursleiter = :personId
|
||||||
|
ORDER BY k.name";
|
||||||
|
} else {
|
||||||
|
$sql = "SELECT k.id, k.name, k.preis, k.dauer, k.rabatt, k.kategorie, k.beschreibung, k.ort_id,
|
||||||
|
o.stadt, o.strasse, o.plz, b.note, b.kommentar
|
||||||
|
FROM kurs_user AS ku
|
||||||
|
JOIN kurs AS k ON k.id = ku.kurs_id
|
||||||
|
JOIN ort AS o ON o.id = k.ort_id
|
||||||
|
LEFT JOIN bewertungen AS b ON b.kurs_id = k.id
|
||||||
|
WHERE ku.user_id = :personId
|
||||||
|
ORDER BY k.name";
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$sth = $pdo->prepare($sql);
|
$sth = $pdo->prepare($sql);
|
||||||
$sth->execute();
|
$sth->execute([':personId' => $personId]);
|
||||||
return $sth->fetchAll(\PDO::FETCH_ASSOC);
|
return $sth->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
new \Blog\Library\ErrorMsg("Fehler beim Lesen der Daten.", $e);
|
new \Blog\Library\ErrorMsg("Fehler beim Lesen der Daten.", $e);
|
||||||
@ -175,6 +191,7 @@ class UserModel extends Database
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function updateCourse($course) {
|
public function updateCourse($course) {
|
||||||
$pdo = $this->linkDB();
|
$pdo = $this->linkDB();
|
||||||
|
|
||||||
|
@ -6,11 +6,9 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h1>Registration</h1>
|
<h1>Registration</h1>
|
||||||
|
|
||||||
<form method="post" class="form-grid">
|
<form method="post" class="form-grid">
|
||||||
|
|
||||||
<?php foreach ($labels as $key => $label): ?>
|
<?php foreach ($labels as $key => $label): ?>
|
||||||
<div class="input">
|
<div class="input <?= $key === 'role' ? "radio" : "" ?>">
|
||||||
<label for="reg_<?= $key ?>"><?= $label ?></label>
|
<label for="reg_<?= $key ?>"><?= $label ?></label>
|
||||||
<?php if ($key === 'password'): ?>
|
<?php if ($key === 'password'): ?>
|
||||||
<input type="password" name="<?= $key ?>" id="reg_<?= $key ?>" required>
|
<input type="password" name="<?= $key ?>" id="reg_<?= $key ?>" required>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user