-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubject.php
271 lines (229 loc) · 8.03 KB
/
subject.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
<?php
session_start();
require('helper.php');
sec('index.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous"
/>
<link
href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link rel="stylesheet" type="text/css" href="style.css" />
<style>
#frgt {
background: url("https://images.wallpaperscraft.com/image/book_reading_inspiration_113238_1920x1080.jpg")
center center no-repeat;
background-size: cover;
height: 100%;
width: 100%;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
text-align: center;
align-items: center;
object-fit: cover;
min-width: 100%;
min-height: 100%;
background-repeat: repeat-x;'>
}
</style>
</head>
<body id="frgt">
<!-- Nav Bar -->
<nav
class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top py-4 pt-md-4"
>
<div class="container">
<a class="navbar-brand mx-auto">Fergusson College Exam Portal</a>
<button
class="navbar-toggler"
data-toggle="collapse"
data-target="#navbarCollapse"
>
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbarCollapse">
<div class="input-group-prepend" >
<span class="input-group-text ml-auto bg-light">
<i class="fas fa-user fa-2" ></i>
</span>
<ul class="navbar-nav mx-auto ">
<li class="nav-item active ml-3 mt-1">
<h5 class="h5 mx-auto mr-2 font-weight-bold text-light " >Hello,<?php echo $_SESSION['_login'];?> </h>
</li>
</ul>
</div>
</div>
</nav>
<!--End Nav-->
<button
class="navbar-toggler ml-auto"
type="button"
data-toggle="collapse"
data-target="#navbar2"
>
<span class="navbar-toggler-icon"></span>
</button>
<nav
class="navbar navbar-expand-md special-card1 navbar-dark py-0 " style="height:75px"
id="navbar2"
>
<div class="navbar-collapse collapse pt-md-4 " style = "margin-bottom:15px">
<div class="fontsize">
<a class="navbar-brand ml-3 mr-5 " href="#">Exam</a>
</div>
<ul class="navbar-nav">
<li class="nav-item active fontsize"
<?php if(@$_GET['q']==1) ?>>
<a class="nav-link ml-5 mr-5" href="subject.php?q=1">
<i class="fas fa-home"></i> Home
<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active fontsize">
<?php if(@$_GET['q']==2) ?>
<a class="nav-link ml-5 mr-5" href="subject.php?q=2">
<i class="fas fa-history"></i> History</a>
</li>
<li class="nav-item active fontsize">
<?php if(@$_GET['q']==3) ?>
<a class="nav-link ml-5 mr-5" href="logoutstudent.php">
<i class="fas fa-sign-out-alt"></i> Signout</a>
</li>
</ul>
</div>
</nav>
<!--Home Start-->
<?php
if(@$_GET['q']==1)
{
require('connection.php');
$conn=getConnection();
$user=$_SESSION['_login'];
$stmt = $conn->prepare("SELECT * from result where s_id='$user'");
$stmt->execute();
if ($stmt->rowCount()!=0) {
echo "<script>alert('Already given the exam')</script>";
}
else {
$stmt = $conn->query("SELECT Semister from student where s_id='$user' ");
$t=$stmt->fetch();
$_SESSION['sem']=$sem=$t['Semister'];
$stmt = $conn->query("SELECT subject_title from subject where semister='$sem' ");
$t=$stmt->fetch();
;
echo
' <div class="panel mt-5 ">
<table class="table table-striped mt-5 table-bordered text-center table-hover table-active " >
<thead class="thead-light">
<tr class="mt-5 style="font-size:14px">
<th>S.N</th>
<th>Subject Name</th>
<th >Total Questions</th>
<th>Marks</th>
<th>Time Limit</th>
<th class="">Start Test</th>
</tr>
</thead>
<tbody class="text-center justify-content px-0">
<tr class="bg-light">
<th scope="row">1</th>
<td>
'.
$t["subject_title"].'
</td>
<td>15</td>
<td>15</td>
<td>15</td>
<td><b><a href="rules.php" class="btn btn-primary"><span><i class="fas fa-external-link-alt"></i></span> <span><b>Start</b></span></a></td>
</tr>
</tbody>
</table>
</div>';
}
}
?>
<!--History Start-->
<?php
if(@$_GET['q']==2)
{
require('connection.php');
$conn=getConnection();
$user=$_SESSION['_login'];
$stmt = $conn->prepare("SELECT * from result where s_id='$user'");
$stmt->execute();
if ($stmt->rowCount()==0) {
echo "<script>alert('havent given any exam yet')</script>";
}
else {
$stmt = $conn->query("SELECT s_id,subject_title,score from result natural join subject where s_id='$user' ");
while ($t=$stmt->fetch()) {
echo
' <div class="panel mt-5 ">
<table class="table table-striped mt-5 table-bordered text-center table-hover table-active bg-white" >
<thead class="thead-dark ">
<tr class="mt-5 style="font-size:14px">
<th>S.N</th>
<th>Subject Name</th>
<th>score</th>
</tr>
</thead>
<tbody class="text-center justify-content px-0">
<tr >
<th scope="row"> '.$user.'</th>
<td>
'.$t['subject_title'].'
</td>
<td> '.$t['score'].'</td>
</tr>
</tbody>
</table>
</div>';
}
}
}
?>
<!--Analysis Start-->
<script
src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"
></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"
></script>
<script
src="https://kit.fontawesome.com/74622583e2.js"
crossorigin="anonymous"
></script>
</body>
</html>