-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoursedetails.php
More file actions
75 lines (74 loc) · 2.96 KB
/
coursedetails.php
File metadata and controls
75 lines (74 loc) · 2.96 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
<?php
include('./dbConnection.php');
// Header Include from mainInclude
include('./mainInclude/header.php');
?>
<div class="container-fluid bg-dark"> <!-- Start Course Page Banner -->
<div class="row">
<img src="./image/coursebanner.jpg" alt="courses" style="height:200px; width:100%; object-fit:cover; box-shadow:10px;"/>
</div>
</div> <!-- End Course Page Banner -->
<div class="container mt-5"> <!-- Start All Course -->
<?php
if(isset($_GET['course_id'])){
$course_id = $_GET['course_id'];
$_SESSION['course_id'] = $course_id;
$sql = "SELECT * FROM course WHERE course_id = '$course_id'";
$result = $conn->query($sql);
if($result->num_rows > 0){
while($row = $result->fetch_assoc()){
echo '
<div class="row">
<div class="col-md-4">
<img src="'.str_replace('..', '.', $row['course_img']).'" class="card-img-top" alt="Guitar" />
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title">Course Name: '.$row['course_name'].'</h5>
<p class="card-text"> Description: '.$row['course_desc'].'</p>
<p class="card-text"> Duration: '.$row['course_duration'].'</p>
<form action="checkout.php" method="post">
<p class="card-text d-inline">Price: <small><del>₹ '.$row['course_original_price'].'</del></small> <span class="font-weight-bolder">₹ '.$row['course_price'].'<span></p>
<input type="hidden" name="id" value='. $row["course_price"] .'>
<button type="submit" class="btn btn-primary text-white font-weight-bolder float-right" name="buy">Buy Now</button>
</form>
</div>
</div>
';
}
}
}
?>
</div><!-- End All Course -->
<div class="container">
<div class="row">
<?php $sql = "SELECT * FROM lesson";
$result = $conn->query($sql);
if($result->num_rows > 0){
echo '
<table class="table table-bordered table-hover">
<thead>
<tr>
<th scope="col">Lesson No.</th>
<th scope="col">Lesson Name</th>
</tr>
</thead>
<tbody>';
$num = 0;
while($row = $result->fetch_assoc()){
if($row['course_id'] == $course_id) {
$num++;
echo ' <tr>
<th scope="row">'.$num.'</th>
<td>'. $row["lesson_name"].'</td></tr>';
}
}
echo '</tbody>
</table>';
} ?>
</div>
</div>
<?php
// Footer Include from mainInclude
include('./mainInclude/footer.php');
?>