forked from sarvanikoppuravuri/Student-Information-System
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresults.php
More file actions
351 lines (326 loc) · 6.9 KB
/
results.php
File metadata and controls
351 lines (326 loc) · 6.9 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
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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<?php
session_start();
$session=$_SESSION["session"];
if(!$session) {
header("Location:index.php");
die();
}
require_once ('dhb.php');
$username=$_SESSION["username"];
$sql = "SELECT * FROM profilepage where username = '$username'";
$resultp = mysqli_query($con,$sql);
$fetchRow= mysqli_fetch_assoc($resultp);
$b=$fetchRow['branch'];
$cc=$fetchRow['rname'];
$ss=$fetchRow['section'];
$s=$fetchRow['sem'];
$z=$s-1;
if($z<3){
if(isset($_POST["btn"])){
$z=$_POST["sem"];
}
$v=$ss.$z;
$sel_q="Select * from course where sem='$z'";
$res= mysqli_query($con,$sel_q);
}
else{
if(isset($_POST["btn"])){
$z=$_POST["sem"];
}
if($z<3){
$v=$ss.$z;
$v = str_replace(' ', '', $v);
$sel_q="Select * from course where sem='$z'";
$res= mysqli_query($con,$sel_q);
}
else{
$v=$b.$z;
$v= str_replace(' ', '', $v);
$sel_q="Select * from course where branch = '$b' and sem='$z'";
$res= mysqli_query($con,$sel_q);
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
* {
box-sizing: border-box;
}
/* Style the body */
body {
font-family: Arial, Helvetica, sans-serif;
margin: 0px;
}
/* Header/logo Title */
.header {
padding: 10px;
text-align: center;
background: #1abc9c;
color: white;
margin: 0px;
}
/* Increase the font size of the heading */
.header h1 {
font-size: 36px;
margin: 7px;
}
.navbar {
overflow: hidden;
background-color: #333;
position: sticky;
position: -webkit-sticky;
top: 0;
}
/* Style the navigation bar links */
.navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 14px 20px;
text-decoration: none;
}
/* Change color on hover */
.navbar a:hover {
background-color: #ddd;
color: black;
}
/* Active/current link */
.navbar a.active {
background-color: #666;
color: white;
}
/* Footer */
.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: black;
color: white;
text-align: center;
padding: 5px;
}
h2{
text-align: center;
font-size : 40px;
color: chocolate;
}
.row {
display: -ms-flexbox; /* IE10 */
display: flex;
-ms-flex-wrap: wrap; /* IE10 */
flex-wrap: wrap;
margin: 2%;
}
.col-50 {
-ms-flex: 50%; /* IE10 */
flex: 50%;
}
.col-75 {
-ms-flex: 75%; /* IE10 */
flex: 75%;
}
.col-25,
.col-50,
.col-75 {
padding: 0 16px;
}
.container {
left: 10%;
width: 80%;
background-color: #f2f2f2;
padding: 0px;
border: 0.5px solid lightgrey;
border-radius: 5px;
position:relative;
}
input[type=text] {
width: 100%;
margin-bottom: 10px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
label {
margin: 5px;
display: block;
}
#customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 70%;
position:relative;
left: 15%;
}
#customers td, #customers th {
border: 1px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: center;
background-color: #4CAF50;
color: white;
}
.btn {
background-color: #000022;
color: white;
padding: 16px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 10%;
position:relative;
left:45%;
opacity: 0.9;
}
.btn:hover {
opacity: 1;
}
.sel{
position:static;
top:20%;
text-align: center;
}
.sel button {
background-color: #000022;
color: white;
padding: 8px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 10%;
}
p{
font-size: 20px;
font-family:Gill Sans;
}
@media (max-width: 800px) {
.row {
flex-direction: column;}
}
@media print {
.header, .navbar , .footer{
visibility: hidden;
}
.row , .table{
visibility: visible;
}
h2 {
position: absolute;
left: 30%;
top: 0;
}
.row {
position: absolute;
top: 10%;
width: 100%;
}
.table{
position: absolute;
top: 40%;
width: 100%;
}
}
</style>
</head>
<body>
<div class="header">
<h1>Student Portal</h1>
</div>
<div class="navbar">
<a href="home.php">Home</a>
<a href="profile.php">My Profile</a>
<a href="regslip.php">Registration Slip</a>
<a href="#" class="active">Results</a>
<a href="change.php">Change Password</a>
<a href="logout.php">Logout</a>
</div>
<h2>Results</h2>
<div class="sel">
<form action="#" method="POST">
<select id="sem" name="sem" style="width:120px ; height:30px;">
<option value="0" >Semester</option>
<?php for($i=1;$i<$s ;$i++){ ?>
<option value= "<?php echo $i ;?>"> <?php echo $i ;?></option> <?php } ?>
</select>
<button name="btn">Submit</button>
</form>
</div>
<div class="row">
<div class="container">
<div class="row">
<div class="col-50">
<label for="expyear">Name </label>
<input type="text" id="expyear" name="name" value="<?php echo $fetchRow['fullname']; ?> " readonly>
</div>
<div class="col-50">
<label for="cvv">Branch </label>
<input type="text" id="cvv" name="branch" value="<?php echo $fetchRow['branch']; ?> " readonly>
</div>
<div class="col-50">
<label for="expyear">Roll Number </label>
<input type="text" id="expyear" name="rolname" value="<?php echo $fetchRow['rolnumber']; ?> " readonly>
</div>
<div class="col-50">
<label for="expyear">Reg Number </label>
<input type="text" id="expyear" name="rname" value="<?php echo $fetchRow['rname']; ?> " readonly>
</div>
</div>
</div>
</div>
<div class="table">
<table id="customers">
<tr class="col">
<th>Sub.code</th>
<th>Subject Name</th>
<th>Credit(s)</th>
<th>Grade</th>
</tr>
<tbody>
<?php
$c=1;
while($row = mysqli_fetch_assoc($res)) {
$n=$row['no'];
?>
<tr>
<td align="center"><?php echo $row["subcode"]; ?></td>
<td align="center"><?php echo $row["subname"]; ?></td>
<td align="center"><?php echo $row["credit"]; ?></td>
<?php if($z<3){
$r=$fetchRow['rname'];
$sel_query="Select * from $v where rname='$r'";
}
else{
$r=$fetchRow['rolnumber'];
$sel_query="Select * from $v where rolnumber='$r'";
}
$result = mysqli_query($con,$sel_query);
if($result){
$g=mysqli_fetch_assoc($result); ?>
<td align="center"><?php echo $g[$c]; ?></td>
<?php } else{ ?>
<td align="center"><?php echo "Not yet updated"; ?></td>
<?php } ?>
<?php $c++;?>
</tr>
<?php } ?>
</tbody>
</table><br>
<button class="btn" onclick="window.print()">Print</button>
<br>
<br>
<br>
<div class="footer">
Designed by - Asritha, Sarvani,Sahiti
</div>
</body>
</html>