-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.php
More file actions
178 lines (135 loc) · 4.55 KB
/
rules.php
File metadata and controls
178 lines (135 loc) · 4.55 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
<html>
<head>
<link rel="stylesheet" href="styleb.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="javas.js"></script>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
</head>
<body>
<script>
if ( window.history.replaceState ) {
window.history.replaceState( null, null, window.location.href );
}
</script>
<?php
include 'config.php';
if(isset($_GET['id']))
{
$id = $_GET['id'];
}
if(isset($_POST['one1']))
{
$one1 = $_POST['one1'];
}
else
{
$one1="";
}
if(isset($_POST['examname']))
{
$examname = $_POST['examname'];
}
else
{
$examname="";
}
if(isset($_POST['subject']))
{
$subject = $_POST['subject'];
}
else
{
$subject="";
}
echo ($subject.$examname);
if($examname!="" and $one1!="" and $subject!="")
{
$sql8= " select id from teacher where tpass='$one1'; ";
$result8 = $conn-> query($sql8);
if ($result8-> num_rows > 0)
{
while($row = $result8-> fetch_assoc())
{
$id=$row['id'];
}
echo"<script> window.location='paper.php?id=$id&examname=$examname&subject=$subject'</script>";
}
else
{
echo"<script>alert('invalid details')</script>";
}
}
$sql6= "select tname from teacher where id=$id;";
$result6 = $conn-> query($sql6);
while ($row1 = $result6-> fetch_assoc())
{
$username=$row1['tname'];
}
?>
<nav>
<div class="logo">
<img width="50" height="50" class="logo12"src="Capture.jpg" alt="Italian Trulli"></div>
<span id="side1" style="font-size:30px;cursor:pointer;color:blue;" onclick="openNav()" style="color:black;">☰</span></div>
<div class="top9">
<?php
echo"<input type=\"button\" id=\"top1\" class = \"btn btn-primary dropdown-toggle\" data-toggle = \"dropdown\" style='color:black;'value=$username>";
?>
<ul class = "dropdown-menu" role = "menu">
<?php echo"<li><a href = \"rules.php?id=$id\" style=\"color:black;background-color:white;float:right;\">Back</a></li>" ?></br>
<li><a href = "exam.php" style="color:black;background-color:white;float:right;">Logout</a></li>
</ul>
</div>
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()" style="color:blue;">×</a>
<a><?php
echo"<p style='font-size:30px;color:white;text-align:center;line-height:140px;'>$username</p>";
?></a>
<p style='font-size:30px;color:white;text-align:center;line-height:none;'><a href = "exam.php" style="color:white;background-color:transparent;border:0px;top:0;">Logout</a></p>
</div>
<script>
function openNav() {
document.getElementById("mySidenav").style.width = "70%";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
}
</script>
</nav>
<div class ="questions1">
<form method="post">
<div class="op4" style='margin-left:20px;margin-top:20px;'>
<p style="text-align:left;font-size:20px;">QUESTION PAPER</p>
<select name = 'examname'>
<?php
$result1 = $conn-> query("select examname from exam;");
while($row = mysqli_fetch_assoc($result1))
{
$examname = $row["examname"];
echo "<option value='$examname'>$examname</option>";
}
?>
</select>
<select name = 'subject'>
<option value='physics'>physics</option>
<option value='Bio'>Biology</option>
<option value='math'>maths</option>
<option value='chemistry'>chemistry</option>
</select>
<?php
echo"<br><br><input type='password' class='op1' style='border:1px solid black;border-radius:2px;' name='one1'placeholder='TPASSWORD'/><br>";
?>
<input type="submit" name="sandn" id ="sn" class="sn" value="START" />
</div>
</form>
</div>
</div>
</div>
</body>
</html>