-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcourse2.php
More file actions
202 lines (168 loc) · 6.17 KB
/
course2.php
File metadata and controls
202 lines (168 loc) · 6.17 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
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
195
196
197
198
199
200
201
202
<?php
session_start();
include('connect.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" />
<!-- font awesome cdn -->
<link rel="stylesheet" type="text/css"
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<!-- Owl Carousel -->
<link rel="stylesheet" type="text/css" href="css/owl.carousel.min.css" />
<link rel="stylesheet" type="text/css" href="css/owl.theme.default.min.css" />
<!-- custom css file link up -->
<link rel="stylesheet" type="text/css" href="style2.css" />
<style>
.headr {
background-color: #009879;
color: #ffffff;
text-align: left;
border: 1px solid black;
}
.zigzag {
margin: 25px 0;
font-size: 0.9em;
font-family: sans-serif;
min-width: 400px;
margin-left: auto;
margin-right: auto;
border: 1px solid black;
}
.zigzag tbody tr {
border-bottom: 1px solid #dddddd;
}
.zigzag th,
.zigzag td {
padding: 12px 15px;
border: 1px solid rgb(255, 255, 255);
}
.zigzag td {
background-color: rgb(9, 54, 232);
color: #ffffff;
}
.boxx {
float: right;
margin-right: 150px;
color: white;
background: rgb(46, 36, 222);
background: linear-gradient(90deg,
rgba(46, 36, 222, 0.6) 0%,
rgba(51, 205, 245, 0.6) 50%,
rgba(27, 90, 103, 0.6) 100%);
padding: 10px;
border-radius: 5%;
}
.btn {
margin-top: 10px;
color: white;
background-color: red;
}
.seat {
font-weight: bold;
font-size: large;
}
</style>
<title>Student | Course List</title>
</head>
<body>
<?php
if($_SESSION['userID'] != NULL){
?>
<header>
<div class="overlay">
<div class="container">
<div class="row">
<div class="col-md-12">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="#">জীবন যুদ্ধ | Course List</a>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="studentProfile2.php">Home <span
class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Teachers</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Students</a>
</li>
<li class="nav-item">
<a class="nav-link" id="s-out" href="index.php">Sign Out</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
</div>
<div class="boxx">
<p class="seat">Enroll in a course?</p>
<form name="f2" action="enroll2.php" method="POST">
<label class="seat">Enter Course ID</label>
<br />
<input type="text" name="bid" required />
<br />
<input type="submit" name="bking" value="Enroll" class="btn" />
<br />
</form>
</div>
<table class="zigzag" id="tabl">
<thead>
<tr>
<th class="headr"><b>Course ID</b></th>
<th class="headr"><b>Course Name</b></th>
<th class="headr"><b>Category</b></th>
<th class="headr"><b>Description</b></th>
</tr>
</thead>
<tbody>
<?php
$cour = $_GET['value'];
$query = "SELECT* FROM $cour, course WHERE $cour.C_ID = course.C_ID";
$data = mysqli_query($conn,$query);
$row = mysqli_fetch_array($data, MYSQLI_ASSOC);
$total = mysqli_num_rows($data);
$result = $conn->query($query);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc())
{ ?>
<tr>
<td><?php echo $row["C_ID"] ?></td>
<td><?php echo $row["C_Name"]; ?></td>
<td><?php echo $row["category"]; ?></td>
<td><?php echo $row["description"]; ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</header>
<?php
}
else
{
?>
<script>
alert("Error. Login Required");
</script>
<?php
echo "<script>window.location.href='index.php?'</script>";
}
?>
</body>
</html>