|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | +<html > |
| 3 | +<head> |
| 4 | +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
| 5 | +<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | + |
| 7 | +<title>AVIATION AND COMMUNICATION</title> |
| 8 | +<link rel="stylesheet" href="css/bootstrap.min.css"/> |
| 9 | + <link rel="stylesheet" href="css/bootstrap-theme.min.css"/> |
| 10 | + <link rel="stylesheet" href="css/main.css"> |
| 11 | + <link rel="stylesheet" href="css/font.css"> |
| 12 | + <script src="js/jquery.js" type="text/javascript"></script> |
| 13 | + |
| 14 | + |
| 15 | + <script src="js/bootstrap.min.js" type="text/javascript"></script> |
| 16 | +<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'> |
| 17 | + <!--alert message--> |
| 18 | +<?php if(@$_GET['w']) |
| 19 | +{echo'<script>alert("'.@$_GET['w'].'");</script>';} |
| 20 | +?> |
| 21 | +<!--alert message end--> |
| 22 | + |
| 23 | +</head> |
| 24 | +<?php |
| 25 | +include_once 'dbConnection.php'; |
| 26 | +?> |
| 27 | +<body> |
| 28 | +<div class="header"> |
| 29 | +<div class="row"> |
| 30 | +<div class="col-lg-6"> |
| 31 | +<span class="logo">AVIATION</span></div> |
| 32 | +<div class="col-md-4 col-md-offset-2"> |
| 33 | + <?php |
| 34 | + include_once 'dbConnection.php'; |
| 35 | +session_start(); |
| 36 | + if(!(isset($_SESSION['email']))){ |
| 37 | +header("location:index.php"); |
| 38 | + |
| 39 | +} |
| 40 | +else |
| 41 | +{ |
| 42 | +$name = $_SESSION['name']; |
| 43 | +$email=$_SESSION['email']; |
| 44 | + |
| 45 | +include_once 'dbConnection.php'; |
| 46 | +echo '<span class="pull-right top title1" ><span class="log1"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Hello,</span> <a href="account.php?q=1" class="log log1">'.$name.'</a> | <a href="logout.php?q=account.php" class="log"><span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> Signout</button></a></span>'; |
| 47 | +}?> |
| 48 | +</div> |
| 49 | +</div></div> |
| 50 | +<div class="bg"> |
| 51 | + |
| 52 | +<!--navigation menu--> |
| 53 | +<nav class="navbar navbar-default title1"> |
| 54 | + <div class="container-fluid"> |
| 55 | + <!-- Brand and toggle get grouped for better mobile display --> |
| 56 | + <div class="navbar-header"> |
| 57 | + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> |
| 58 | + <span class="sr-only">Toggle navigation</span> |
| 59 | + <span class="icon-bar"></span> |
| 60 | + <span class="icon-bar"></span> |
| 61 | + <span class="icon-bar"></span> |
| 62 | + </button> |
| 63 | + <a class="navbar-brand" href="#"><b>Test Your Skills</b></a> |
| 64 | + </div> |
| 65 | + |
| 66 | + <!-- Collect the nav links, forms, and other content for toggling --> |
| 67 | + <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
| 68 | + <ul class="nav navbar-nav"> |
| 69 | + <li <?php if(@$_GET['q']==1) echo'class="active"'; ?> ><a href="account.php?q=1"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> Home<span class="sr-only">(current)</span></a></li> |
| 70 | + <li <?php if(@$_GET['q']==2) echo'class="active"'; ?>><a href="account.php?q=2"><span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span> History</a></li> |
| 71 | + <li <?php if(@$_GET['q']==3) echo'class="active"'; ?>><a href="account.php?q=3"><span class="glyphicon glyphicon-stats" aria-hidden="true"></span> Ranking</a></li> |
| 72 | + <li class="pull-right"> <a href="logout.php?q=account.php"><span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> Signout</a></li> |
| 73 | + </ul> |
| 74 | + <form class="navbar-form navbar-left" role="search"> |
| 75 | + <div class="form-group"> |
| 76 | + <input type="text" class="form-control" placeholder="Enter tag "> |
| 77 | + </div> |
| 78 | + <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> Search</button> |
| 79 | + </form> |
| 80 | + </div><!-- /.navbar-collapse --> |
| 81 | + </div><!-- /.container-fluid --> |
| 82 | +</nav><!--navigation menu closed--> |
| 83 | +<div class="container"><!--container start--> |
| 84 | +<div class="row"> |
| 85 | +<div class="col-md-12"> |
| 86 | + |
| 87 | +<!--home start--> |
| 88 | +<?php if(@$_GET['q']==1) { |
| 89 | + |
| 90 | +$result = mysqli_query($con,"SELECT * FROM quiz ORDER BY date DESC") or die('Error'); |
| 91 | +echo '<div class="panel"><div class="table-responsive"><table class="table table-striped title1"> |
| 92 | +<tr><td><b>S.N.</b></td><td><b>Topic</b></td><td><b>Total question</b></td><td><b>Marks</b></td><td><b>Time limit</b></td><td></td></tr>'; |
| 93 | +$c=1; |
| 94 | +while($row = mysqli_fetch_array($result)) { |
| 95 | + $title = $row['title']; |
| 96 | + $total = $row['total']; |
| 97 | + $sahi = $row['sahi']; |
| 98 | + $time = $row['time']; |
| 99 | + $eid = $row['eid']; |
| 100 | +$q12=mysqli_query($con,"SELECT score FROM history WHERE eid='$eid' AND email='$email'" )or die('Error98'); |
| 101 | +$rowcount=mysqli_num_rows($q12); |
| 102 | +if($rowcount == 0){ |
| 103 | + echo '<tr><td>'.$c++.'</td><td>'.$title.'</td><td>'.$total.'</td><td>'.$sahi*$total.'</td><td>'.$time.' min</td> |
| 104 | + <td><b><a href="account.php?q=quiz&step=2&eid='.$eid.'&n=1&t='.$total.'" class="pull-right btn sub1" style="margin:0px;background:#99cc32"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> <span class="title1"><b>Start</b></span></a></b></td></tr>'; |
| 105 | +} |
| 106 | +else |
| 107 | +{ |
| 108 | +echo '<tr style="color:#99cc32"><td>'.$c++.'</td><td>'.$title.' <span title="This quiz is already solve by you" class="glyphicon glyphicon-ok" aria-hidden="true"></span></td><td>'.$total.'</td><td>'.$sahi*$total.'</td><td>'.$time.' min</td> |
| 109 | + <td><b><a href="update.php?q=quizre&step=25&eid='.$eid.'&n=1&t='.$total.'" class="pull-right btn sub1" style="margin:0px;background:red"><span class="glyphicon glyphicon-repeat" aria-hidden="true"></span> <span class="title1"><b>Restart</b></span></a></b></td></tr>'; |
| 110 | +} |
| 111 | +} |
| 112 | +$c=0; |
| 113 | +echo '</table></div></div>'; |
| 114 | + |
| 115 | +}?> |
| 116 | +<span id="countdown" class="timer"></span> |
| 117 | +<script> |
| 118 | +var seconds = 75; |
| 119 | + function secondPassed() { |
| 120 | + var minutes = Math.round((seconds - 30)/60); |
| 121 | + var remainingSeconds = seconds % 60; |
| 122 | + if (remainingSeconds < 10) { |
| 123 | + remainingSeconds = "0" + remainingSeconds; |
| 124 | + } |
| 125 | + document.getElementById('countdown').innerHTML = minutes + ":" + remainingSeconds; |
| 126 | + if (seconds == 0) { |
| 127 | + clearInterval(countdownTimer); |
| 128 | + document.getElementById('countdown').innerHTML = "Buzz Buzz"; |
| 129 | + } else { |
| 130 | + seconds--; |
| 131 | + } |
| 132 | + } |
| 133 | +var countdownTimer = setInterval('secondPassed()', 1000); |
| 134 | +</script>--> |
| 135 | + |
| 136 | +<!--home closed--> |
| 137 | + |
| 138 | +<!--quiz start--> |
| 139 | +<?php |
| 140 | +if(@$_GET['q']== 'quiz' && @$_GET['step']== 2) { |
| 141 | +$eid=@$_GET['eid']; |
| 142 | +$sn=@$_GET['n']; |
| 143 | +$total=@$_GET['t']; |
| 144 | +$q=mysqli_query($con,"SELECT * FROM questions WHERE eid='$eid' AND sn='$sn' " ); |
| 145 | +echo '<div class="panel" style="margin:5%">'; |
| 146 | +while($row=mysqli_fetch_array($q) ) |
| 147 | +{ |
| 148 | +$qns=$row['qns']; |
| 149 | +$qid=$row['qid']; |
| 150 | +echo '<b>Question '.$sn.' ::<br />'.$qns.'</b><br /><br />'; |
| 151 | +} |
| 152 | +$q=mysqli_query($con,"SELECT * FROM options WHERE qid='$qid' " ); |
| 153 | +echo '<form action="update.php?q=quiz&step=2&eid='.$eid.'&n='.$sn.'&t='.$total.'&qid='.$qid.'" method="POST" class="form-horizontal"> |
| 154 | +<br />'; |
| 155 | + |
| 156 | +while($row=mysqli_fetch_array($q) ) |
| 157 | +{ |
| 158 | +$option=$row['option']; |
| 159 | +$optionid=$row['optionid']; |
| 160 | +echo'<input type="radio" name="ans" value="'.$optionid.'">'.$option.'<br /><br />'; |
| 161 | +} |
| 162 | +echo'<br /><button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span> Submit</button></form></div>'; |
| 163 | +header("location:dash.php?q=4&step=2&eid=$id&n=$total"); |
| 164 | +} |
| 165 | +//result display |
| 166 | +if(@$_GET['q']== 'result' && @$_GET['eid']) |
| 167 | +{ |
| 168 | +$eid=@$_GET['eid']; |
| 169 | +$q=mysqli_query($con,"SELECT * FROM history WHERE eid='$eid' AND email='$email' " )or die('Error157'); |
| 170 | +echo '<div class="panel"> |
| 171 | +<center><h1 class="title" style="color:#660033">Result</h1><center><br /><table class="table table-striped title1" style="font-size:20px;font-weight:1000;">'; |
| 172 | + |
| 173 | +while($row=mysqli_fetch_array($q) ) |
| 174 | +{ |
| 175 | +$s=$row['score']; |
| 176 | +$w=$row['wrong']; |
| 177 | +$r=$row['sahi']; |
| 178 | +$qa=$row['level']; |
| 179 | +echo '<tr style="color:#66CCFF"><td>Total Questions</td><td>'.$qa.'</td></tr> |
| 180 | + <tr style="color:#99cc32"><td>right Answer <span class="glyphicon glyphicon-ok-circle" aria-hidden="true"></span></td><td>'.$r.'</td></tr> |
| 181 | + <tr style="color:red"><td>Wrong Answer <span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span></td><td>'.$w.'</td></tr> |
| 182 | + <tr style="color:#66CCFF"><td>Score <span class="glyphicon glyphicon-star" aria-hidden="true"></span></td><td>'.$s.'</td></tr>'; |
| 183 | +} |
| 184 | +$q=mysqli_query($con,"SELECT * FROM rank WHERE email='$email' " )or die('Error157'); |
| 185 | +while($row=mysqli_fetch_array($q) ) |
| 186 | +{ |
| 187 | +$s=$row['score']; |
| 188 | +echo '<tr style="color:#990000"><td>Overall Score <span class="glyphicon glyphicon-stats" aria-hidden="true"></span></td><td>'.$s.'</td></tr>'; |
| 189 | +} |
| 190 | +echo '</table></div>'; |
| 191 | + |
| 192 | +} |
| 193 | +?> |
| 194 | +<!--quiz end--> |
| 195 | +<?php |
| 196 | +//history start |
| 197 | +if(@$_GET['q']== 2) |
| 198 | +{ |
| 199 | +$q=mysqli_query($con,"SELECT * FROM history WHERE email='$email' ORDER BY date DESC " )or die('Error197'); |
| 200 | +echo '<div class="panel title"> |
| 201 | +<table class="table table-striped title1" > |
| 202 | +<tr style="color:red"><td><b>S.N.</b></td><td><b>Quiz</b></td><td><b>Question Solved</b></td><td><b>Right</b></td><td><b>Wrong<b></td><td><b>Score</b></td>'; |
| 203 | +$c=0; |
| 204 | +while($row=mysqli_fetch_array($q) ) |
| 205 | +{ |
| 206 | +$eid=$row['eid']; |
| 207 | +$s=$row['score']; |
| 208 | +$w=$row['wrong']; |
| 209 | +$r=$row['sahi']; |
| 210 | +$qa=$row['level']; |
| 211 | +$q23=mysqli_query($con,"SELECT title FROM quiz WHERE eid='$eid' " )or die('Error208'); |
| 212 | +while($row=mysqli_fetch_array($q23) ) |
| 213 | +{ |
| 214 | +$title=$row['title']; |
| 215 | +} |
| 216 | +$c++; |
| 217 | +echo '<tr><td>'.$c.'</td><td>'.$title.'</td><td>'.$qa.'</td><td>'.$r.'</td><td>'.$w.'</td><td>'.$s.'</td></tr>'; |
| 218 | +} |
| 219 | +echo'</table></div>'; |
| 220 | +} |
| 221 | + |
| 222 | +//ranking start |
| 223 | +if(@$_GET['q']== 3) |
| 224 | +{ |
| 225 | +$q=mysqli_query($con,"SELECT * FROM rank ORDER BY score DESC " )or die('Error223'); |
| 226 | +echo '<div class="panel title"><div class="table-responsive"> |
| 227 | +<table class="table table-striped title1" > |
| 228 | +<tr style="color:red"><td><b>Rank</b></td><td><b>Name</b></td><td><b>Gender</b></td><td><b>College</b></td><td><b>Score</b></td></tr>'; |
| 229 | +$c=0; |
| 230 | +while($row=mysqli_fetch_array($q) ) |
| 231 | +{ |
| 232 | +$e=$row['email']; |
| 233 | +$s=$row['score']; |
| 234 | +$q12=mysqli_query($con,"SELECT * FROM user WHERE email='$e' " )or die('Error231'); |
| 235 | +while($row=mysqli_fetch_array($q12) ) |
| 236 | +{ |
| 237 | +$name=$row['name']; |
| 238 | +$gender=$row['gender']; |
| 239 | +$college=$row['college']; |
| 240 | +} |
| 241 | +$c++; |
| 242 | +echo '<tr><td style="color:#99cc32"><b>'.$c.'</b></td><td>'.$name.'</td><td>'.$gender.'</td><td>'.$college.'</td><td>'.$s.'</td><td>'; |
| 243 | +} |
| 244 | +echo '</table></div></div>';} |
| 245 | +?> |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | +</div></div></div></div> |
| 250 | +<!--Footer start--> |
| 251 | +<div class="row footer"> |
| 252 | +<div class="col-md-4 box"> |
| 253 | +<a href="#" data-toggle="modal" data-target="#login">Admin Login</a></div> |
| 254 | +<div class="col-md-4 box"> |
| 255 | +<a href="#" data-toggle="modal" data-target="#developers">Developers</a> |
| 256 | +</div> |
| 257 | + <div class="col-md-3 box"> |
| 258 | +<a href="feedback.php" target="_blank">Feedback</a></div></div> |
| 259 | + Modal For Developers |
| 260 | +<div class="modal fade title1" id="developers"> |
| 261 | + <div class="modal-dialog"> |
| 262 | + <div class="modal-content"> |
| 263 | + <div class="modal-header"> |
| 264 | + <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> |
| 265 | + <h4 class="modal-title" style="font-family:'typo' "><span style="color:orange">Developer</span></h4> |
| 266 | + </div> |
| 267 | + |
| 268 | + <div class="modal-body"> |
| 269 | + <p> |
| 270 | + <div class="row"> |
| 271 | + <div class="col-md-4"> |
| 272 | + <img src="#" width=100 height=100 alt="ABHINAV VERMA" class="img-rounded"> |
| 273 | + </div> |
| 274 | + <div class="col-md-5"> |
| 275 | + <a href="http://yugeshverma.blogspot.in" style="color:#202020; font-family:'typo' ; font-size:18px" title="Find on Facebook">Abhinav Verma</a> |
| 276 | + <h4 style="color:#202020; font-family:'typo' ;font-size:16px" class="title1">+91 8791189792</h4> |
| 277 | + <h4 style="font-family:'typo' "> [email protected]</h4> |
| 278 | + <h4 style="font-family:'typo' ">jaypee institute of information and technalogy ,Noida .</h4></div></div> |
| 279 | + </p> |
| 280 | + </div> |
| 281 | + |
| 282 | + </div><!-- /.modal-content |
| 283 | + </div><!-- /.modal-dialog --> |
| 284 | +</div><!-- /.modal --> |
| 285 | + |
| 286 | +<!--Modal for admin login--> |
| 287 | + <div class="modal fade" id="login"> |
| 288 | + <div class="modal-dialog"> |
| 289 | + <div class="modal-content"> |
| 290 | + <div class="modal-header"> |
| 291 | + <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> |
| 292 | + <h4 class="modal-title"><span style="color:orange;font-family:'typo' ">LOGIN</span></h4> |
| 293 | + </div> |
| 294 | + <div class="modal-body title1"> |
| 295 | +<div class="row"> |
| 296 | +<div class="col-md-3"></div> |
| 297 | +<div class="col-md-6"> |
| 298 | +<form role="form" method="post" action="admin.php?q=connect.php"> |
| 299 | +<div class="form-group"> |
| 300 | +<input type="text" name="uname" maxlength="20" placeholder="Admin user id" class="form-control"/> |
| 301 | +</div> |
| 302 | +<div class="form-group"> |
| 303 | +<input type="password" name="password" maxlength="15" placeholder="Password" class="form-control"/> |
| 304 | +</div> |
| 305 | +<div class="form-group" align="center"> |
| 306 | +<input type="submit" name="login" value="Login" class="btn btn-primary" /> |
| 307 | +</div> |
| 308 | +</form> |
| 309 | +</div><div class="col-md-3"></div></div> |
| 310 | + </div> |
| 311 | + <!--<div class="modal-footer"> |
| 312 | + <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> |
| 313 | + </div>--> |
| 314 | + </div><!-- /.modal-content --> |
| 315 | + </div><!-- /.modal-dialog --> |
| 316 | +</div><!-- /.modal --> |
| 317 | +<!--footer end--> |
| 318 | + |
| 319 | + |
| 320 | +</body> |
| 321 | +</html> |
0 commit comments