-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdashboard.php
More file actions
125 lines (110 loc) · 4.01 KB
/
Copy pathdashboard.php
File metadata and controls
125 lines (110 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
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>DashBoard</title>
<link rel="stylesheet" href="Addons/dashboard.css">
<link rel="stylesheet" href="">
</head>
<body>
<?php
// include 'session.php';
$user = 'student';
$pass = 'sakec';
$db = 'students';
$conn = new mysqli('localhost', $user, $pass, $db) or die("Unable to connect to server".$db);
$get_all = "select * from profile where UserId=\"".$_SESSION['name']."\"";
$data = mysqli_query($conn, $get_all) or die("No records found.");
$row = mysqli_fetch_assoc($data);
$x=40;
$y=20;
echo'<div class="container">';
if ($row['Notifications']!=NULL) {
echo "<div class='attendance'><p>Notification: ".$row['Notifications']."</p></div>";
}
echo'<div class="details">
<p>Details:<p>
<hr>
<ul class="left">
<li>Name: </li>
<li>smartcard no:</li>
<li>class:</li>
</ul>
<ul class="right">
<li>'.$row["Fname"].' '.$row["Lname"].'</li>
<li>'.$row["UserId"].'</li>
<li>'.$row["Class"].' - '.$row["Division"].' - '.$row["RollNo"].'</li>
</ul>
</div>';
if ($_SESSION['type']!='admin') {
echo'<div class="attendance">
<p>Attendance:</p>
<hr>
<table class="tattendance">
<tr>
<th>Attended</th>
<th>Total</th>
<th>Percentage</th>
</tr>
<tr>
<td>'.$row["Attended"].'</td>
<td>'.$row["Total"].'</td>';
if ($row["Total"]!=0) {
echo '<td>'.$row["Percent"].'%</td>
';
}
else {
echo '<td>0%</td>';
}
echo '
</tr>
</table>
</div>';
}
echo '<div class="notification">
<p>Assignment:</p>
<hr>';
$user = 'student';
$pass = 'sakec';
$db = 'students';
$i = 0;
$conn = new mysqli('localhost', $user, $pass, $db) or die("Unable to connect to server".$db);
$fetch = "select * from assign";
$temp = mysqli_query($conn, $fetch) or die("Record not found.");
while($row = mysqli_fetch_assoc($temp)) {
if($i<2){
echo "<span><b>Assignment No: </b>" .$row["no."]."<br><b>Subject: </b>".$row["subject"]."<br><b>Assigned Date: </b> ".$row["assigned"]." <br><b>Submission Date: </b>".$row["submission"]."<br><br></span>";
$i++;
}
else {
break;
}
}
mysqli_close($conn);
echo '<p></p>
</div>
<div class="event">
<p>Events:</p>
<hr>';
$user = 'student';
$pass = 'sakec';
$db = 'students';
$i = 0;
$conn = new mysqli('localhost', $user, $pass, $db) or die("Unable to connect to server".$db);
$fetch = "select * from events";
$temp = mysqli_query($conn, $fetch) or die("Record not found.");
while($row = mysqli_fetch_assoc($temp)) {
if($i<2){
echo "<span><b>Name: </b>" .$row["event_name"]."<br><b>Event Id: </b>".$row["id"]."<br><b>Date: </b> ".$row["date"]." <br><b>Time: </b>".$row["time"]."<br><b>Venue: </b>".$row["venue"]."<br><br></span>";
$i++;
}
else {
break;
}
}
echo "</table></div>";
echo '</p></div>';
mysqli_close($conn);
?>
</body>
</html>