-
Notifications
You must be signed in to change notification settings - Fork 16
/
student_profile.php
86 lines (79 loc) · 3.12 KB
/
student_profile.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
<?php
require_once 'config.php';
session_start();
// Check if the user is logged in, if not then redirect him to login page
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
header("location: student_login.php");
exit;
}
$regdno = $_SESSION["num"];
//$regdno = $_GET['num'];
$sql = "select * from student where regdno ='$regdno'";
$result = ($conn->query($sql));
//declare array to store the data of database
$row = [];
if ($result->num_rows > 0) {
// fetch all data from db into array
$row = $result->fetch_all(MYSQLI_ASSOC);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>student profile</title>
<link type="text/css" rel="stylesheet" href="stylesheet.css">
</head>
<body>
<div id='student'>
<p style="text-align:right;">
<a href="student_reset_password.php" class="button"><img src="resetpassword.jpg" alt="resetpassword" width="20" height="20"></a>
<a href="student_logout.php" class="button" align='right'><img src="signout.jpg" alt="signout" width="20" height="20"></a>
</p>
<h1 align="center">STUDENTS DETAILS</h1><br><br>
<table border='0' cellspacing="0" align="center" style="background: color #757575;font-size: 15px;">
<?php
if(!empty($row))
foreach($row as $rows)
{
?>
<tr><td align="right"><b>Regdno :</b></td>
<td><?php echo $rows['regdno'];
$n=$rows['regdno'];
$sql1="select * from marks where regdno='$n'";
$result1 = ($conn->query($sql1));
$row1 = [];
if ($result->num_rows > 0) {
// fetch all data from db into array
$row1 = $result->fetch_all(MYSQLI_ASSOC);
}
while($rows1=$result1->fetch_assoc()){
?></td>
<td> </td>
<td align="right"><b>Backlogs :<b></td>
<td><?php echo $rows1['backlogs']; ?></td></tr>
<tr><td align="right"><b>Name :<b></td>
<td><?php echo $rows['name']; ?></td>
<td></td>
<td align="right"><b>CGPA :<b></td>
<td><?php echo $rows1['cgpa']; ?></td></tr>
<tr><td align="right"><b>Contact :<b></td>
<td><?php echo $rows['contact'] ?></td></tr>
<tr><td align="right"><b>Email :<b></td>
<td><?php echo $rows['email'] ?></td></tr>
<tr><td align="right"><b>D.O.B :<b></td>
<td><?php echo $rows['dob'] ?></td>
<?php } ?>
</tr>
<tr><td><br><br><br></td>
<td><h1>upload placement </h1></td>
<td><h1> details</h1></td></tr>
<tr><td></td><td><a href="update_placement.php" class="button"><img src="upload.jpg" alt="upload" width="100" height="100"></td>
</tr>
<?php } ?>
</table><br><br>
</div>
</body>
</html>
<?php
mysqli_close($conn);
?>