-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_view_course_query.php
129 lines (104 loc) · 2.35 KB
/
admin_view_course_query.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
<?php
include_once 'connection.php';
$sql_query = "select * from course";
$result = mysqli_query($con, $sql_query);
while($row=mysqli_fetch_assoc($result)){
if($row){
$course_title=$row['course_title'];
$course_code=$row['course_code'];
$sql_query2 = "select teacher_id from takes where course_code ='$course_code'";
$result2 = mysqli_query($con, $sql_query2);
$row2=mysqli_fetch_assoc($result2);
if($row2){
$teacher_id=$row2['teacher_id'];
$sql_query3 = "select user_name from user where user_id='$teacher_id'";
$result3 = mysqli_query($con, $sql_query3);
$row3=mysqli_fetch_assoc($result3);
if($row3){
$t_name=$row3['user_name'];
echo '
<style type="text/css">
* {
margin: 0px;
padding: 0px;
}
body {
font-family: arial;
}
.main {
margin: 2%;
}
.card {
display: flex;
flex-direction: column;
align-items: center;
width: 18rem;
height: fit-content;
box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.2);
border-radius: 5px;
}
.image img {
width: 100%;
border-top-right-radius: 10px;
border-top-left-radius: 10px;
}
.title {
text-align: center;
padding: 10px;
}
h1 {
font-size: 20px;
}
.des {
padding: 3px;
text-align: center;
padding-top: 10px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
button {
margin-top: 60px;
margin-bottom: 10px;
background-color: white;
border: 1px solid black;
border-radius: 5px;
padding:10px;
}
button:hover {
background-color: black;
color: white;
transition: .5s;
cursor: pointer;
}
</style>
<div class="main">
<div class="card">
<div class="image">
<img src="images/pic1.png">
</div>
<div class="title">
<h2>';
echo $course_title;
echo '</h2>
<h1>';
echo $course_code;
echo '</h1>
</div>
<div class="des">
<p>';
echo $t_name;
echo '</p>
<td>
<a href="dist/index.php">
<button>View</button>
</a>
</td>
</div>
</div>
</div>
';
}
}
}
}
?>