-
Notifications
You must be signed in to change notification settings - Fork 1
/
Professor-details.php
189 lines (171 loc) · 8.54 KB
/
Professor-details.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
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
<?php include_once('includes/dbconnection.php');
//Coding For query
if(isset($_POST['submit']))
{
$fname=$_POST['fname'];
$emailid=$_POST['emailid'];
$mobileno=$_POST['mobileno'];
$querymsg=$_POST['query'];
$teacherid=$_GET['tid'];
$sql="insert into tblquery(teacherId,fName,emailId,mobileNumber,Query)values(:teacherid,:fname,:emailid,:mobileno,:querymsg)";
$query=$dbh->prepare($sql);
$query->bindParam(':fname',$fname,PDO::PARAM_STR);
$query->bindParam(':emailid',$emailid,PDO::PARAM_STR);
$query->bindParam(':mobileno',$mobileno,PDO::PARAM_STR);
$query->bindParam(':querymsg',$querymsg,PDO::PARAM_STR);
$query->bindParam(':teacherid',$teacherid,PDO::PARAM_STR);
$query->execute();
$LastInsertId=$dbh->lastInsertId();
if ($LastInsertId>0) {
echo '<script>alert("Message Sent Successfully.")</script>';
echo "<script>window.location.href ='index.php'</script>";
}else{
echo '<script>alert("Something Went Wrong. Please try again")</script>';
}}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>ProfsPortail | Professor Details</title>
<!-- Favicon-->
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<!-- Bootstrap icons-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="css/styles.css" rel="stylesheet" />
</head>
<body class="d-flex flex-column h-100">
<main class="flex-shrink-0">
<!-- Navigation-->
<?php include_once('includes/header.php'); ?>
<!-- Page Content-->
<?php
$tid=intval($_GET['tid']);
$sql="SELECT * from tblteacher where isPublic='1' and ID='$tid'";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
if($query->rowCount() > 0)
{
foreach($results as $row)
{ ?>
<section class="py-5">
<div class="container px-5 my-5">
<div class="text-center mb-5">
<h1 class="fw-bolder"><?php echo htmlentities($row->Name);?>'s Details</h1>
<p class="lead fw-normal text-muted mb-0">Registered Since <?php echo htmlentities($row->RegDate);?></p>
</div>
<div class="row gx-5">
<div class="col-xl-8">
<!-- FAQ Accordion 1-->
<!-- <h2 class="fw-bolder mb-3">Persoanl Details </h2> -->
<div class="accordion mb-5" id="accordionExample">
<div class="accordion-item">
<h3 class="accordion-header" id="headingOne"><button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">Personal Details</button></h3>
<div class="accordion-collapse collapse show" id="collapseOne" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
<div class="accordion-body">
<table class="table table-bordered">
<tr>
<th></th>
<td><img src="Professor/images/<?php echo htmlentities($row->Picture);?>" width="200"></td>
</tr>
<tr>
<th>Professor Name</th>
<td><?php echo htmlentities($row->Name);?></td>
</tr>
<tr>
<th>Professor Email ID</th>
<td><?php echo htmlentities($row->Email);?></td>
</tr>
<tr>
<th>Professor Mobile Number</th>
<td><?php echo htmlentities($row->MobileNumber);?></td>
</tr>
<tr>
<th>Professor Address</th>
<td><?php echo htmlentities($row->Address);?></td>
</tr>
<tr>
<th>Registered Since</th>
<td><?php echo htmlentities($row->RegDate);?></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<!-- FAQ Accordion 2-->
<div class="accordion mb-5 mb-xl-0" id="accordionExample2">
<div class="accordion-item">
<h3 class="accordion-header" id="headingOne"><button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">Professional Details</button></h3>
<div class="accordion-collapse collapse show" id="collapseOne" aria-labelledby="headingOne" data-bs-parent="#accordionExample2">
<div class="accordion-body">
<table class="table table-bordered">
<tr>
<th>Professor Qualifications</th>
<td><?php echo htmlentities($row->Qualifications);?></td>
</tr>
<tr>
<th>Teaching Experience (in Years)</th>
<td><?php echo htmlentities($row->teachingExp);?></td>
</tr>
<tr>
<th>Subject</th>
<td><?php echo htmlentities($row->TeacherSub);?></td>
</tr>
<tr>
<th>Description (if Any)</th>
<td><?php echo htmlentities($row->description);?></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-4">
<div class="card border-0 bg-light mt-xl-5">
<div class="card-body p-4 py-lg-5">
<div class="d-flex align-items-center justify-content-center">
<div class="text-center">
<div class="h6 fw-bolder">Have more questions?</div>
<p class="text-muted mb-4">
Contact me at
<br />
<a href="#!"><?php echo htmlentities($row->Email);?></a>
</p>
<h5>OR</h5>
<form method="post">
<p> <input type="text" name="fname" placeholder="Enter your fullname" class="form-control" required></p>
<p><input type="email" name="emailid" placeholder="Enter your emaild" class="form-control" required></p>
<p><input type="text" name="mobileno" placeholder="Enter your mobile no" class="form-control" pattern="[0-9]{10}" title="10 numeric characters only" required></p>
<p><textarea class="form-control" name="query" placeholder="Query / Message" required></textarea>
</p>
<input type="submit" class="btn btn-primary" name="submit">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php } } else{ ?>
<hr />
<h3 align="center" style="color:red;">Record not Found</h3>
<?php } ?>
</main>
<!-- Footer-->
<?php include_once('includes/footer.php'); ?>
<!-- Bootstrap core JS-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<!-- Core theme JS-->
<script src="js/scripts.js"></script>
</body>
</html>