This commit is contained in:
Marcel Kapfer (mmk2410) 2016-04-10 19:18:26 +02:00
parent ab70dabcd7
commit a39fde6e01
Signed by: mmk2410
GPG key ID: CADE6F0C09F21B09

View file

@ -10,8 +10,8 @@
function getFullDay($day) {
if ($day == "Mon") {
return "Monday";
} else if ($day == "Thu") {
return "Thusday";
} else if ($day == "Tue") {
return "Tuesday";
} else if ($day == "Wed") {
return "Wednesday";
} else if ($day == "Thur") {
@ -210,7 +210,7 @@ if ($conn->error) {
</section>
<?php
}
$days = array("Mon", "Thu", "Wed", "Thur", "Fri");
$days = array("Mon", "Tue", "Wed", "Thur", "Fri");
foreach ($days as $day) {
$sql = "SELECT * FROM Titama WHERE day='$day'";
$res = $conn->query($sql);
@ -219,19 +219,23 @@ foreach ($days as $day) {
<section class="card">
<div class="headline"><?php echo getFullDay($day) ?></div>
<?php
$courses = $res->fetch_all();
$courses = array();
$result = $conn->query($sql);
while ($row = $result->fetch_assoc()) {
$courses[] = $row;
}
usort($courses, function($a, $b) {
return $a[5] - $b[5];
});
foreach ($courses as $course) {
?>
<div class="course">
<div class="c_name" id="c_name_<?php echo $course[0] ?>"><?php echo $course[1]; ?></div>
<div class="c_time"><?php echo $course[5]; ?>:00</div>
<div class="c_id">Id: <?php echo $course[0]; ?></div>
<div class="c_kind">Kind: <?php echo $course[2]; ?></div>
<div class="c_place">Place: <?php echo $course[3]; ?></div>
<div class="c_prof">Prof: <?php echo $course[6]; ?></div>
<div class="c_name" id="c_name_<?php echo $course["id"] ?>"><?php echo $course["name"]; ?></div>
<div class="c_time"><?php echo $course["time"]; ?>:00</div>
<div class="c_id">Id: <?php echo $course["id"]; ?></div>
<div class="c_kind">Kind: <?php echo $course["kind"]; ?></div>
<div class="c_place">Place: <?php echo $course["room"]; ?></div>
<div class="c_prof">Prof: <?php echo $course["prof"]; ?></div>
</div>
<?php
}
@ -282,7 +286,7 @@ include './res/php/closedb.php';
</form>
</section>
</section>
<div class="footer">Marcel Kapfer (mmk2410) - 2015</div>
<div class="footer">Marcel Kapfer (mmk2410) - 2015-2016</div>
<script src="./res/jquery-2.1.4.min.js"></script>
<script src="./res/js/titama.js"></script>
</body>