-
Notifications
You must be signed in to change notification settings - Fork 3
/
profile_courses.html
57 lines (56 loc) · 2 KB
/
profile_courses.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Courses</title>
<?php include('inc/header.inc.php');
include('inc/session.inc.php'); ?>
<div class="body2">
<div class="main">
<!-- content -->
<section id="content">
<div class="box1">
<div class="wrapper">
<article class="col1">
<div class="pad_left1">
<h2>Current Courses</h2>
</div>
<ul class="list1">
<?php
$user=$_SESSION['login_user'];
$userType = $user[0];
if($userType=='L'){
$sql1="SELECT * from courses where lecturer_id='$user'";
$result1=mysqli_query($db,$sql1);
while($row1 = mysqli_fetch_array($result1,MYSQLI_ASSOC)){
$course_id=$row1['courseID'];
$course_name=$row1['name'];
echo "<li><a href=\"courses/courses_view.html?id=$course_id\">$course_name</a></li>";
}
echo '</ul>';
}
else if($userType=='1') {
$sql1="SELECT courseid from student_courses where studentid='$user';";
$result1=mysqli_query($db,$sql1);
while($row1 = mysqli_fetch_array($result1,MYSQLI_ASSOC)){
$course_id=$row1['courseid'];
$sql2="SELECT * from courses where courseID='$course_id';";
$result2=mysqli_query($db,$sql2);
while($row2 = mysqli_fetch_array($result2,MYSQLI_ASSOC)){
$course_name=$row2['name'];
echo "<li><a href=\"courses/courses_view.html?id=$course_id\">$course_name</a></li>";
}
}
echo '</ul>';
}else{header("login-page.html");}?>
<div class="pad_top2"> <a href="inc\logout.inc.php" class="button"><span><span>LOGOUT</span></span></a> </div>
</article>
</div>
</div>
</section>
<!-- content -->
<?php include('inc/footer.inc.php'); ?>
</div>
</div>
<script type="text/javascript">Cufon.now();</script>
</body>
</html>