-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewusermodule.php
More file actions
143 lines (141 loc) · 5.99 KB
/
Copy pathviewusermodule.php
File metadata and controls
143 lines (141 loc) · 5.99 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#4E0096" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!--sweetalert-->
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@8"></script>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="admincss.css">
<script src="script.js"></script>
<link rel="stylesheet/less" type="text/css" href="styles.less" />
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/3.9.0/less.min.js" ></script>
<style>
#existingcourses{
padding-top: 5%;
padding-bottom: 3%;
background-color: #eff5f5;
}
.no-js #loader { display: none; }
.js #loader { display: block; position: absolute; left: 100px; top: 0; }
.se-pre-con {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background: url(img/loader.gif) center no-repeat #fff;
}
</style>
</head>
<body id="mypage" data-spy="scroll" data-target=".navbar" data-offset="60">
<?php
if(!isset($_SESSION['username'])){
?>
<script type="text/javascript">
Swal.fire({
title: 'Unauthorized user!',
type: 'error',
onAfterClose: function() {
location.assign('index.php');
}
});
</script>
<?php
die();
}
?>
<div class="se-pre-con"></div>
<header>
<nav class="navbar navbar-inverse navbar-fixed-top" style=" margin:0%; background-color: #4E0096; border: 0%; border-radius:0%;">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php#mypage" style="color:white;"> Learn ME</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a href="logout.php">Logout <span class="glyphicon glyphicon-log-out"></span></a></li>
</ul>
</div>
</div>
</nav>
</header>
<div class="jumbotron">
<?php
$course = $_GET["cid"];
$con = new mysqli("localhost","root","","learndb");
$sel="select * from excoursetb where courseid='$course'";
$result=$con->query($sel);
if($result->num_rows>0){
while($row=$result->fetch_assoc()){
$name = $row['coursename'];
?><br>
<?php
}
}
?>
<h2 style="text-align: center;"><?php echo $name; ?></h2>
</div>
<?php
$sel="select * from coursetb where coursename='$course'";
$result=$con->query($sel);
$counter = 1;
if($result->num_rows>0){
?>
<div style="overflow-x:auto;">
<table class="table table-hover" id="table1">
<tr style="background-color: #f2f2f2;">
<th class="col-sm-2" style="text-align:center;">Module ID</th>
<th class="col-sm-6" style="text-align:center;">Module Name</th>
<th class="col-sm-4" style="text-align:center;">View Module</th>
</tr>
<?php
while($row=$result->fetch_assoc()){
?>
<tr>
<td style="text-align:center;"><?php echo $counter; ?></td>
<td style="text-align:center;"><?php echo $row["modulename"]; ?></td>
<td style="text-align:center;"> <a class="btn btn-primary" href = "viewusermore.php?mname=<?php echo $row["modulename"];?>&coursename=<?php echo $course;?>">VIEW MORE</a> </td>
</tr>
<?php
$counter = $counter + 1;
}
?>
</table>
</div>
<?php
}
else{
?>
<h3 style="color:red; text-align:center">There are no modules currently in this particular course</h3>
<?php
}
?>
<script>
$(window).load(function(){
// Animate loader off screen
$(".se-pre-con").fadeOut("slow");
});
</script>
</body>
</html>