-
Notifications
You must be signed in to change notification settings - Fork 1
/
stuPerf.php
294 lines (266 loc) · 9.34 KB
/
stuPerf.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Welcome to SIS</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet" type="text/css">
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
<link href="css/templatemo_style.css" rel="stylesheet" type="text/css">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="sidebar/styles.css">
<script src="sidebar/jquery-latest.js" type="text/javascript"></script>
<script src="sidebar/script.js"></script>
<link rel="icon" type="image/png" href="/dbms/logo/logo.png">
</head>
<body class="templatemo-bg-gray">
<?php
// set the session
$_SESSION["logged"] = true;
// Get the data from the home
$roll_no = $_SESSION["roll"];
$password = $_SESSION["pwd"];
$semester = $_SESSION["sem"];
$section = $_SESSION["sec"];
$name = $_SESSION["name"];
// Create conncetion to database
$server = "localhost:6994";
$username = "STUDENT";
$passwd = "student";
$dbname = "studentinfodb";
// Set sessions
$_SESSION["ask"] = false;
$_SESSION["view"] = false;
$con = new mysqli($server, $username, $passwd, $dbname);
if($con->connect_error)
{
echo "<div id=\"try\">
<h1 class=\"margin-bottom-15\">OOPS !!! Something went wrong.</h1> Please submit a <a href=\"contact/contact.html\">
Bug Report,</a> Or<a href=\"login.html\"> Try Again </a>
</div>";
$_SESSION["login"] = false;
die();
};
// Check for valid roll no and password
$query = "SELECT roll_no, passwd
FROM stu_login
WHERE roll_no = '$roll_no' AND passwd = '$password'";
$tmp = $con->query($query);
$row = mysqli_num_rows($tmp);
if($row < 1)
{
echo "<div id=\"try\">
<h1 class=\"margin-bottom-15\">PLEASE ENTER A CORRECT ROLL NO. OR PASSWORD</h1>
Please<a href=\"login.html\"> Try Again</a>
</div>";
$_SESSION["login"] = false;
die();
}
else
$validate = true;
// Fetch the performance
$query = "SELECT c.course_name as subject, periodical_marks, ass_marks, final_marks, total_marks
FROM marks_attendence as m, course_info as c
WHERE m.roll_no = '$roll_no' and c.course_code = m.course_code";
$tmp = $con->query($query);
// Fetch the time table
$day = date("l");
$query = "SELECT class1, class2, class3, class4, class5, class6, class7, class8
FROM timetable
WHERE semester = '$semester' and day = '$day' AND section= '$section'";
$Time = $con->query($query);
$data = $Time->fetch_assoc();
$class1 = $data["class1"];
$query = "SELECT course_name
FROM course_info
WHERE course_code = '$class1'";
$time = $con->query($query);
$cname = $time->fetch_assoc();
$class1 = $cname["course_name"];
$class2 = $data["class2"];
$query = "SELECT course_name
FROM course_info
WHERE course_code = '$class2'";
$time = $con->query($query);
$cname = $time->fetch_assoc();
$class2 = $cname["course_name"];
$class3 = $data["class3"];
$query = "SELECT course_name
FROM course_info
WHERE course_code = '$class3'";
$time = $con->query($query);
$cname = $time->fetch_assoc();
$class3 = $cname["course_name"];
$class4 = $data["class4"];
$query = "SELECT course_name
FROM course_info
WHERE course_code = '$class4'";
$time = $con->query($query);
$cname = $time->fetch_assoc();
$class4 = $cname["course_name"];
$class5 = $data["class5"];
$query = "SELECT course_name
FROM course_info
WHERE course_code = '$class5'";
$time = $con->query($query);
$cname = $time->fetch_assoc();
$class5 = $cname["course_name"];
$class6 = $data["class6"];
$query = "SELECT course_name
FROM course_info
WHERE course_code = '$class6'";
$time = $con->query($query);
$cname = $time->fetch_assoc();
$class6 = $cname["course_name"];
$class7 = $data["class7"];
$query = "SELECT course_name
FROM course_info
WHERE course_code = '$class7'";
$time = $con->query($query);
$cname = $time->fetch_assoc();
$class7 = $cname["course_name"];
$class8 = $data["class8"];
$query = "SELECT course_name
FROM course_info
WHERE course_code = '$class8'";
$time = $con->query($query);
$cname = $time->fetch_assoc();
$class8 = $cname["course_name"];
if(!$class1)
$class1 = "Yuipee No Class :-)";
if(!$class2)
$class2 = "Yuipee No Class :-)";
if(!$class3)
$class3 = "Yuipee No Class :-)";
if(!$class4)
$class4 = "Yuipee No Class :-)";
if(!$class5)
$class5 = "Yuipee No Class :-)";
if(!$class6)
$class6 = "Yuipee No Class :-)";
if(!$class7)
$class7 = "Yuipee No Class :-)";
if(!$class8)
$class8 = "Yuipee No Class :-)";
//-----------------------------------------------------------------------------------------------------------------------
// Now the main part starts
if($validate)
{echo "
<div id=\"title\"><strong><center>
STUDENT INFORMATION SYSTEM<br><center>NIT HAMIRPUR</strong>
</div>
<div id=\"mcont\">
<div id=\"mnu\">
<div id=\"txt\">Welcome $name</div>
<ul style='margin-left: 40%'>
<li><a href=\"stu_dash.php\">Home</a></li>
<li><a href=\"stuPerf.php\">View my Performance</a></li>
<li><a href=\"stuAtt.php\">View my attendance</a></li>
<li><a href=\"stuAsn.php\">Assignments</a></li>
<li><a href=\"stuDout.php\">Doubt corner</a></li>
<li><a href=\"stuUinfo.php\">Update info</a></li>
<li><a href=\"logout.php\">Logout</a></li>
</ul>
</div> <!-- end menu -->
<div id=\"ctnt\">
<p id=\"infohead\"><br><u><strong>Here is your performance</strong></u>:</p>"; ?>
<div id="tabl">
<table class="table2">
<thead>
<tr>
<th></th>
<th scope="col" abbr="Starter">Subject</th>
<th scope="col" abbr="Medium">Periodical Marks</th>
<th scope="col" abbr="Business">Assessment</th>
<th scope="col" abbr="Deluxe">Finals</th>
<th scope="col" abbr="Total">Total</th>
</tr>
<?php
while($result = $tmp->fetch_assoc())
{
echo "<tr>
<th scope=\"row\"></th>";
echo "<td><center>" .$result["subject"]. "</td>".
"<td><center>" .$result["periodical_marks"]. "</td>".
"<td><center>" .$result["ass_marks"]. "</td>".
"<td><center>" .$result["final_marks"]. "</td>".
"<td><center>" .$result["total_marks"]. "</td>"
;
echo "</tr>";
}
?><!--PHP END -->
</tbody>
</table>
</div>
</div> <!--end content-->
<!--Sidebar-->
<?php
echo"
<div id=\"sb\">
<div id=\"cssmenu\">
<ul>
<li class=\"active has-sub\"><a><span>Today's Lectures:</span></a>
<ul style=\"display: none;\">
<li class=\"has-sub\"><a href=\"#\"><span>First Class:</span></a>
<ul style=\"\">
<li><a href=\"#\"><span>$class1</span></a></li>
</ul>
</li>
<li class=\"has-sub\"><a href=\"#\"><span>Second Class:</span></a>
<ul style=\"\">
<li><a href=\"#\"><span>$class2</span></a></li>
</ul>
</li>
<li class=\"has-sub\"><a href=\"#\"><span>Third Class:</span></a>
<ul style=\"\">
<li><a href=\"#\"><span>$class3</span></a></li>
</ul>
</li>
<li class=\"has-sub\"><a href=\"#\"><span>Fourth Class:</span></a>
<ul style=\"\">
<li><a href=\"#\"><span>$class4</span></a></li>
</ul>
</li>
<li class=\"has-sub\"><a href=\"#\"><span>Fifth Class:</span></a>
<ul style=\"\">
<li><a href=\"#\"><span>$class5</span></a></li>
</ul>
</li>
<li class=\"has-sub\"><a href=\"#\"><span>Sixth Class:</span></a>
<ul style=\"\">
<li><a href=\"#\"><span>$class6</span></a></li>
</ul>
</li>
<li class=\"has-sub\"><a href=\"#\"><span>Seventh Class:</span></a>
<ul style=\"\">
<li><a href=\"#\"><span>$class7</span></a></li>
</ul>
</li>
<li class=\"has-sub\"><a href=\"#\"><span>Eighth Class:</span></a>
<ul style=\"\">
<li><a href=\"#\"><span>$class8</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div> <!-- end sidebar -->
</div>
";
}
?><!--PHP END-->
<div id="footer">
Developed By: Prateek Prasher and Arnav Dhiman, CSED NIT-Hamirpur
<br>Found a bug ? <a href="contact/contact.html">Contact us.</a>
</div>
</body>
</html>