-
Notifications
You must be signed in to change notification settings - Fork 0
/
courses.php
103 lines (90 loc) · 3.95 KB
/
courses.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Students Space</title>
<?php include "head.php"; ?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
.course-container {
transition: box-shadow 0.2s ease-in-out;
}
.course-container:hover {
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);
}
</style>
</head>
<body> <?php include "header.php"; ?>
<div class="container-fluid">
<div class="container py-2">
<div class="row justify-content-center mb-4 mt-4">
<div class="col-md-6">
<form method="post">
<div class="input-group">
<select name="cmbcname" class="form-control">
<option value="0">All Courses</option>
<?php
$q = mysqli_query($con, "select * from tblclass");
while ($r = mysqli_fetch_array($q)) {
?> <option value="<?php echo $r["cid"]; ?>"><?php echo $r["cname"]; ?></option>
<?php
}
?>
</select>
<div class="input-group-append">
<button class="btn btn-success" type="submit" name="btnsearchbycategory">Search By Courses</button>
</div>
</div>
</form>
</div>
</div>
<?php
if (isset($_POST["btnsearch"])) {
extract($_POST);
$query = "select * from tblcourse where coname like '%" . $txtsearch . "%'";
} else {
$query = "select * from tblcourse order by courseid desc";
}
if (isset($_POST["btnsearchbycategory"])) {
extract($_POST);
if ($cmbcname == 0) {
$query = "select * from tblcourse";
} else {
$query = "select * from tblcourse where cid = '" . $cmbcname . "'";
}
}
?>
<div class="row mt-5">
<?php
$q = mysqli_query($con, $query);
while ($r = mysqli_fetch_array($q)) {
?>
<div class="course-container col-lg-4 col-md-6 mb-4">
<div class="rounded overflow-hidden mb-2 border mb-3 mt-3">
<img class="img-fluid" src="admin/<?php echo $r["courseimage"]; ?> " alt="">
<div class="bg-light p-4">
<div class="d-flex justify-content-between mb-3">
<small class="m-0"><i class="fas fa-rupee-sign"></i><strike> <?php echo $r["courseprice"]; ?></strike>/-</small>
<small class="m-0 text-success"><i class="fas fa-rupee-sign"></i> <?php echo $r["coursedprice"]; ?>/-</small>
</div>
<h5><?php echo $r["coursename"]; ?></h5>
<div class="border-top mt-4 pt-4">
<a class="btn btn-info" href="details.php?id=<?php echo $r['courseid']; ?>">
<small><i class="fas fa-info-circle"></i> View Details</small>
</a>
<small class="m-3 text-danger"><i class="far fa-clock"></i> <?php echo $r["coursetime"]; ?></small>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php include "footer.php"; ?>
</body>
</html>