-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent-class.php
109 lines (75 loc) · 4.05 KB
/
student-class.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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
<!-- Including Header -->
<?php
include_once 'resources/header.php';
?>
<section id="company-title">
<div>
<img src="images/logo.jpeg" alt="">
</div>
</section>
<div id="dashboard-container">
<div class="row menu-wrapper" style="width:100% !important;margin:0;padding:0;">
<div class="col col-2">
<div class="menu-list">
<ul class="menu">
<li><a href="student.php"><button type="button" class="block">Dashboard</button></a></li>
<li><a href="student-lessons.php"><button type="button" class="block">Lessons</button></a></li>
<li><a href="student-class.php"><button type="button" class="block">Classes</button></a></li>
<li><a href="student-edit.php"><button type="button" class="block">Edit Profile</button></a></li>
</ul>
</div>
</div>
<div class="col col-10 content-panel">
<div>
<table class="table table-block ">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Date</th>
<th scope="col">Student Name</th>
<th scope="col">Class Name</th>
<th scope="col">Grade</th>
</tr>
</thead>
<tbody>
<?php
include_once 'resources/header.php';
$query2 = 'SELECT r.reg_id , c.name as cname , r.date as date , s.full_name as sname, c.grade as grade
FROM class_registrations r
join classes c
on r.c_id=c.c_id
join students s
on s.u_id=r.u_id
WHERE r.u_id = 2;';
$result = $conn->query($query2);
if (!$result) {
printf("Error: %s\n", mysqli_error($conn));
exit();
}
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['reg_id'] . "</td>";
echo "<td>" . $row['date'] . "</td>";
echo "<td>" . $row['sname'] . "</td>";
echo "<td>" . $row['cname'] . "</td>";
echo "<td>" . $row['grade'] . "</td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
<?php
/* include_once 'resources/header.php';
$query1 = 'SELECT c_id FROM class_registrations;';
$id = $conn->query($query1);
$query2 = 'SELECT * FROM classes WHERE c_id=".$id.";';
$result = $conn->query($query2);
while($row = mysql_fetch_array($result))
{
echo '<p>'.$row['column'].' </p>';
}*/
?>
</div>
</div>