-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudentdashboard.php
More file actions
116 lines (106 loc) · 4.01 KB
/
studentdashboard.php
File metadata and controls
116 lines (106 loc) · 4.01 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
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
<?php
session_start();
$connection = mysqli_connect("localhost","root","");
$db = mysqli_select_db($connection,"srms");
if (!isset($_SESSION['loggedin'])) {
header('Location: index.php');
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<title>Student Dashboard</title>
<style type="text/css">
th{
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-md-6">
<h2>Dashboard</h2>
</div>
<div class="col-md-6">
<a href="stdchangepass.php" class="btn btn-success" style="margin-left: 80%;"> Edit password </a>
</div>
<div class="col-md-12">
<hr>
</div>
</div>
<?php
$connection = mysqli_connect("localhost","root","");
$db = mysqli_select_db($connection, 'srms');
$query = "SELECT * FROM studentwisemarks where id='$_SESSION[id]'";
$query_run = mysqli_query($connection, $query);
$proname = $_SESSION['username']; // something like this is optional, of course
$proid = substr($proname,7);
?>
<div class="row">
<div class="col-md-12">
<h3>Name: <?php echo $proname ?></h3>
<br>
<h3 class="proid">Enrollement ID: <?php echo '2020ITB'.(100+$proid) ?></h3>
<div class="col-md-12">
<hr>
</div>
<table class="table table-bordered" style="background-color: white;">
<thead class="table-dark">
<tr>
<th> Subject Name</th>
<th> GPA</th>
</tr>
</thead>
<tbody>
<?php
if($query_run)
{
while($row = mysqli_fetch_array($query_run))
{
?>
<tr>
<th>Subject1</th>
<th> <?php echo $row['sub1_gpa']; ?> </th>
</tr>
<tr>
<th>Subject2</th>
<th> <?php echo $row['sub2_gpa']; ?> </th>
</tr>
<tr>
<th>Subject3</th>
<th> <?php echo $row['sub3_gpa']; ?> </th>
</tr>
<tr>
<th>Total CGPA</th>
<th> <?php echo ($row['sub1_gpa']+$row['sub2_gpa']+$row['sub3_gpa'])/3; ?> </th>
</tr>
<?php
}
}
else
{
?>
<tr>
<th colspan="6"> No Record Found </th>
</th>
<?php
}
?>
</tbody>
</table>
</div>
<div class="col-md-6">
<a href="logout.php" class="btn btn-success" style="margin-left: 80%;"> Logout </a>
</div>
</div>
</div>
</div>
</body>
</html>