-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlessons.php
More file actions
96 lines (92 loc) · 3.11 KB
/
lessons.php
File metadata and controls
96 lines (92 loc) · 3.11 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
include 'includes/dbcon.php';
?>
<?php
// Πλήθος Μαθηματων
$sql = "SELECT * FROM lesson";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$number_of_lessons = $stmt->rowCount();
?>
<?php include "includes/header.php"; ?>
<!-- Begin Page Content -->
<div class="container-fluid">
<div class="mb-3">
<h1 class="h3 mb-0 text-gray-800">Σύνοψη</h1>
</div>
<div class="row">
<div class="col-xl-3 col-md-6 mb-4">
<a role="button" href="lessons.php" class="btn-outline-light card border-left-primary shadow py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Μαθηματα</div>
<div class="h5 mb-0 font-weight-bold text-gray-800"><?php echo $number_of_lessons; ?></div>
</div>
<div class="col-auto">
<i class="fas fa-bookmark fa-3x text-gray-300"></i>
</div>
</div>
</div>
</a>
</div>
</div>
<div class="my-3">
<h1 class="h3 mb-0 text-gray-800">Λίστα Μαθημάτων</h1>
</div>
<!-- Πίνακας Μαθημάτων -->
<div class="shadow">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Μαθήματα</h6>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="dataTable" class="table table-bordered table-hover" style="width:100%">
<thead>
<tr>
<th>Κωδικός</th>
<th>Τίτλος</th>
<th>Κατηγορία</th>
<th>Εξάμηνο</th>
<th>Μονάδες ECTS</th>
</tr>
</thead>
<tbody>
<!-- Εμφάνιση Λίστας Μαθημάτων -->
<?php
$sql = "SELECT lesson_code, title, semester, ects, cat_title
FROM lesson, lesson_cat
WHERE lesson.cat_id = lesson_cat.cat_short_title";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$lessons = $stmt->fetchAll();
foreach ($lessons as $lesson) :
?>
<tr>
<td><a href="lesson.php?lesson_id=<?php echo $lesson['lesson_code']; ?>" class="text-gray-600"><?php echo $lesson['lesson_code']; ?></a></td>
<td><?php echo $lesson['title']; ?></td>
<td><?php echo $lesson['cat_title']; ?></td>
<td><?php echo $lesson['semester']; ?></td>
<td><?php echo $lesson['ects']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
<?php include "includes/footer.php"; ?>
<script>
$(document).ready(function() {
$('#dataTable').DataTable();
});
$('tbody>tr').click(function() {
window.location = $(this).find('a').attr('href');
}).hover(function() {
$(this).toggleClass('hover');
});
</script>