This repository has been archived by the owner on Feb 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
project-detail.php
57 lines (50 loc) · 1.91 KB
/
project-detail.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
declare(strict_types=1);
require_once './inc/util.php';
?>
<!DOCTYPE html>
<link rel="stylesheet" href="./assets/style/main.css">
<script src="./assets/js/project.js" type="module" defer></script>
<section class="project-detail" style="width:400px;margin:auto">
<?php
$project = new \NeueMedien\project();
if ($project->thaw((int)$_GET['pid'])) : ?>
<h1><?= $project->Name ?></h1>
<input type="hidden" id="pid" value="<?= $project->ID ?>">
<label for="project-nr">Projektnummer</label><input type="text" id="project-nr" value="<?= $project->Number ?>" readonly>
<label for="project-type">Projekttyp</label>
<select id="project-type">
<?php foreach (\NeueMedien\projecttype::findAll() as $typeID => $type) { ?>
<option value='<?= $typeID ?>' <?= $typeID === $project->TypeID ? 'selected' : '' ?>><?= $type->Name ?></option>
<?php } ?>
</select>
<label for="coach">Coach</label>
<select id="coach">
<?php foreach (\NeueMedien\teacher::findAll() as $coachID => $coach) { ?>
<option value='<?= $coachID ?>' <?= $coachID === $project->Coach ? 'selected' : '' ?>><?= $coach->FullName ?></option>
<?php } ?>
<label for="description">Beschreibung:</label>
<textarea id="description" name="description"><?= $project->Description; ?></textarea>
<section class="student-detail">
<?php
$where = ['ProjectID' => '=' . $project->ID];
$order = ['Fullname' => "ASC"];
foreach (\NeueMedien\studentprojectview::findAll(where: $where, order: $order) as $id => $detail) { ?>
<ul>
<li data-id="<?= $detail->StudentID ?>">
<?= $detail->Fullname ?>
(<?= $detail->Role ?>)</li>
</ul>
<?php
}
?>
</section>
<?php
else :
?>
<p>Das Projekt konnte nicht gefunden werden.</p>
<?php
endif;
?>
<a href="./">Zurück</a>
</section>