-
Notifications
You must be signed in to change notification settings - Fork 3
/
CourseInfo.php
194 lines (164 loc) · 7.54 KB
/
CourseInfo.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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<?php
//this is id to LTP choosen row
$Id_course = $_POST['Id_course'];
include "connection.php";
$query = "select Title, Description, Time_Completion, Category, email, experience, Workplace, Surname, Name from Course, CourseS, Teacher where Course.Id_course = CourseS.Id_course and Teacher.Id_teacher = CourseS.Id_teacher and Course.Id_course = $Id_course ";
$result = mysqli_query($link, $query) or die(mysqli_error($link));
if ($result) {
while($object = mysqli_fetch_object($result)){
$Title = $object -> Title;
$Description = $object -> Description;
$Time_Completion = $object -> Time_Completion;
$Category = $object -> Category;
$email = $object -> email;
$experience = $object -> experience;
$Workplace = $object -> Workplace;
$Surname = $object -> Surname;
$Name = $object -> Name;
}
} else {
}
// count amound of students in course
$query2 = "select Count(Id_uic) as s From UIC where Id_course = $Id_course";
$result2 = mysqli_query($link, $query2) or die(mysqli_error($link));
while( $object2 = mysqli_fetch_object($result2)){
$NofStudents = $object2 -> s;
}
$query3 = "select Count(Id_courseS) as c From CourseS where Id_teacher = (select Id_teacher from CourseS where Id_course = $Id_course)";
$result3 = mysqli_query($link, $query3) or die(mysqli_error($link));
while( $object3 = mysqli_fetch_object($result3)){
$NofCourses = $object3 -> c;
}
?>
<!DOCTYPE html>
<html>
<title>Course Info</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
html,body,h1,h2,h3,h4,h5,h6 {font-family: "Roboto", sans-serif}
</style>
<body class="w3-light-grey">
<!-- Page Container -->
<div class="w3-content w3-margin-top" style="max-width:1400px;">
<!-- The Grid -->
<div class="w3-row-padding" style="padding-left : 8.3%">
<!-- Right Column -->
<div class="w3-twothird">
<div class="w3-container w3-card w3-white w3-margin-bottom">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-globe fa-fw w3-margin-right w3-text-teal"></i><?php echo $Title; ?> <span class="w3-tag w3-teal w3-round"><?php echo $Category ; ?></span></h2>
<div class="w3-container">
<h5 class="w3-opacity">About Course</h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>Time Completion - <?php echo $Time_Completion; ?> </h6>
<p><?php echo $Description; ?></p>
<hr>
<h5 class="w3-opacity"><b><?php echo $NofStudents; ?> - Number of students already in this course. </b></h5>
<p align="right"><a href="something" class="button6" >Join</a></p>
</div>
</div>
<div class="w3-container w3-card w3-white">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-certificate fa-fw w3-margin-right w3-xxlarge w3-text-teal"></i>Lessons</h2>
<?php
$mysql0 = new mysqli('localhost','id15179784_user','fw4@las[]5ST_Ptp','id15179784_teacherskill');
$sql0 = "SELECT Id_LessonContent, Title , ContentText, ContentVideo FROM LessonContent where Id_course = $Id_course";
$num = 1;
$result_select = mysqli_query($mysql0, $sql0);
while($object = mysqli_fetch_object($result_select)){
$TitleL = $object->Title;
$Id_LessonContent = $object-> Id_LessonContent;
echo "<div class='w3-container'>";
echo "<form class='' action='LessonView.php' method='post'>";
echo "<input type='hidden' name='Id_LessonContent' value='$Id_LessonContent'> ";
echo "<table width='100%'><tr><td width='10%'><div><h5> $num </h5></div></td> <td td width='75%'><div><h5><u>$TitleL</u></h5></div></td><td td width='15%'><div > <input style='background-color: silver; border-radius:8px;font-family:Arial;font-size:14px; padding:6px 20px;' type='submit' name='view' class='class' value='view'> </div></td></tr></table></p>";
//echo "<input style='background-color: grey; align: right;' type='submit' name='view' class='class' value='view'>";
echo "</form></div>";
$num += 1;
}
$mysql0 ->close();
?>
<hr>
</div>
<!-- End Right Column -->
</div>
<!-- Left Column -->
<div class="w3-quarter" >
<div class="w3-white w3-text-grey w3-card-4">
<div class="w3-display-container">
<img src="https://cdn.pixabay.com/photo/2019/08/11/18/59/icon-4399701_960_720.png" style="width:100%" alt="Avatar">
<div class="w3-display-bottomleft w3-container w3-text-black">
</div>
</div>
<div class="w3-container">
<h2><?php echo $Name; ?> <?php echo $Surname; ?></h2>
<p><i class="fa fa-home fa-fw w3-margin-right w3-large w3-text-teal"></i><?php echo $Workplace; ?></p>
<p><i class="fa fa-envelope fa-fw w3-margin-right w3-large w3-text-teal"></i><?php echo $email; ?></p>
<p><i class="fa fa-briefcase fa-fw w3-margin-right w3-large w3-text-teal"></i><?php echo $experience; ?> month of experince</p>
<p><i class="fa fa-briefcase fa-fw w3-margin-right w3-large w3-text-teal"></i> Number of courses: <?php echo $NofCourses; ?></p>
<hr>
<p class="w3-large"><b><i class="fa fa-asterisk fa-fw w3-margin-right w3-text-teal"></i>Score for Course</b></p>
<p>Content</p>
<div class="w3-light-grey w3-round-xlarge w3-small">
<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:90%">90%</div>
</div>
<p>Intelligibility</p>
<div class="w3-light-grey w3-round-xlarge w3-small">
<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:80%">
<div class="w3-center w3-text-white">80%</div>
</div>
</div>
<p>Responsiveness</p>
<div class="w3-light-grey w3-round-xlarge w3-small">
<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:75%">75%</div>
</div>
<br>
<p class="w3-large w3-text-theme"><b><i class="fa fa-globe fa-fw w3-margin-right w3-text-teal"></i>Teacher stats</b></p>
<p>Stat 1</p>
<div class="w3-light-grey w3-round-xlarge">
<div class="w3-round-xlarge w3-teal" style="height:24px;width:100%"></div>
</div>
<p>Stat 2</p>
<div class="w3-light-grey w3-round-xlarge">
<div class="w3-round-xlarge w3-teal" style="height:24px;width:55%"></div>
</div>
<br>
</div>
</div><br>
<!-- End Left Column -->
</div>
<!-- End Grid -->
</div>
<!-- End Page Container -->
</div>
</body>
<style>
a.button6{
display:inline-block;
padding:0.7em 1.4em;
margin:0 0.3em 0.3em 0;
border-radius:0.15em;
box-sizing: border-box;
text-decoration:none;
font-family:'Roboto',sans-serif;
text-transform:uppercase;
font-weight:400;
color:#FFFFFF;
background-color:#3369ff;
box-shadow:inset 0 -0.6em 0 -0.35em rgba(0,0,0,0.17);
text-align:center;
position:relative;
}
a.button6:active{
top:0.1em;
}
@media all and (max-width:30em){
a.button6{
display:block;
margin:0.4em auto;
}
}
tr:hover {background-color:#f5f5f5;}
</style>
</html>