This repository has been archived by the owner on May 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
97 lines (82 loc) · 3.7 KB
/
index.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
<?php include("partials-front/menu.php"); ?>
<!-- search Section Starts Here -->
<section class="search text-center">
<div class="container">
<form action="<?php echo SITEURL; ?>search.php" method="POST">
<input type="search" name="search" placeholder="Search for Teacher or Course.." required>
<input type="submit" name="submit" value="search" class="btn btn-primary">
</form>
</div>
</section>
<!-- welcome section starts here-->
<section class="teacher">
<div class="container">
<h2 class="text-center">Welcome to TeacherForYou</h2>
<p class="text-center ">TeacherForYou is a platform for people that need help with their studies. <br / >
Here you can find a teacher to help you and make an appointment.</p>
</div>
</section>
<!-- welcome section ends here-->
<!-- teacher Section Starts Here -->
<section class="teacher">
<div class="container">
<h2 class="text-center">Teachers</h2>
<?php
if (isset($_SESSION["booked"])) {
echo $_SESSION["booked"];
unset($_SESSION["booked"]); //removes message
} ?>
<?php
$sql = "SELECT * FROM teacher";
$res = mysqli_query($conn, $sql);
$sn = 1; // sn to display rather than id
if ($res == TRUE) {
$count = mysqli_num_rows($res);
if ($count > 0) {
while ($rows = mysqli_fetch_assoc($res)) {
//get data
$id = $rows["id"];
$firstname = $rows["firstname"];
$lastname = $rows["lastname"];
$email = $rows["email"];
$courses = $rows["courses"];
$payment = $rows["payment"];
$address = $rows["address"];
//display
?>
<div class="teacher-box">
<div class="teacher-img">
<img src="images/teacher_icon.png" alt="iconS"
class="img-responsive img-curve">
</div>
<div class="teacher-desc">
<h4><?php echo $firstname;
echo " ";
echo $lastname; ?></h4>
<p class="teacher-payment"><?php echo $payment; ?>/hour</p>
Courses:
<p class="teacher-curses">
<?php echo $courses; ?>
</p>
Email:
<p class="teacher-curses"><?php echo $email; ?></p>
Address:
<p class="teacher-curses"><?php echo $address; ?></p>
<br>
<a href="<?php echo SITEURL; ?>book-teacher.php?id=<?php echo $id; ?>"
class="btn-secondary">Book</a>
</div>
</div>
<?php
}
}
}
?>
<div class="clearfix"></div>
</div>
<!-- <p class="text-center">-->
<!-- <a href="#">See All Foods</a>-->
<!-- </p>-->
</section>
<!-- teacher Section Ends Here -->
<?php include("partials-front/footer.php"); ?>