| Current Path : /var/www/html/rkala/data/ |
| Current File : /var/www/html/rkala/data/verification.php |
<?php
session_start();
if(!isset($_GET['roll']) && !isset($_SESSION['encrpy']) || !isset($_SESSION['user']) || $_SESSION['encrpy'] != md5($_GET['roll']."tsaltycipeher")) {
// user is not logged in, do something like redirect to login.php
header("Location: logon.php");
//echo $_SESSION['user'];
//echo $_GET['roll'];
die();
}
if($_SESSION['access'] != 2) {
// another example...
// user is logged in but not a manager, let's stop him
die("Access Denied");
}
?>
<html>
<head><title>DST Result SELF</title>
<style>
#myImg {
border-radius: 5px;
cursor: pointer;
transition: 0.3s;
}
#myImg:hover {opacity: 0.7;}
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}
/* Modal Content (image) */
.modal-content {
margin: auto;
display: block;
width: 200%;
max-width:700px;
}
/* Caption of Modal Image */
#caption {
margin: auto;
display: block;
width: 80%;
max-width: 700px;
text-align: center;
color: #ccc;
padding: 10px 0;
height: 150px;
}
/* Add Animation */
.modal-content, #caption {
-webkit-animation-name: zoom;
-webkit-animation-duration: 0.6s;
animation-name: zoom;
animation-duration: 0.6s;
}
@-webkit-keyframes zoom {
from {-webkit-transform:scale(0)}
to {-webkit-transform:scale(1)}
}
@keyframes zoom {
from {transform:scale(0)}
to {transform:scale(1)}
}
/* The Close Button */
.close {
position: absolute;
top: 15px;
right: 35px;
color: #f1f1f1;
font-size: 40px;
font-weight: bold;
transition: 0.3s;
}
.close:hover,
.close:focus {
color: #bbb;
text-decoration: none;
cursor: pointer;
}
/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px){
.modal-content {
width: 100%;
}
}
</style>
<script src="js/jquery-2.1.3.js"></script>
<script src="js/bootstrap.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<style>
table, th, td {
border: 0px solid black;
border-collapse: collapse;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-collapse:separate;
border-radius: 4px;
}
th, td {
padding: 5px;
text-align: center;
}
table#t02 {
border-radius: 4px;
border-collapse:separate;
border: 2px solid black;
}
table#t01 tr:nth-child(even) {
background-color: #ded;
}
table#t01 tr:nth-child(odd) {
background-color:#fff;
}
table#t01 th {
background-color: black;
color: white;
}
.modal-header, h4, .close {
background-color: #5cb85c;
color:white !important;
text-align: center;
font-size: 30px;
}
h2{
background-color: #eee;
color:white !important;
text-align: right;
padding-right : 50px;
font-size: 20px;
}
.modal-footer {
background-color: #f9f9f9;
}
input[type=submit] {
padding:5px 15px;
background:#ddd;
border:5 none;
cursor:pointer;
-webkit-border-radius: 5px;
border-radius: 5px;
}
select {
padding:3px;
margin: 0;
border-radius:5px;
-webkit-box-shadow:
0 0px 0 #ccc,
0 0px #fff inset;
background: no-repeat right, -moz-linear-gradient(top, #FBFBFB 0%, #E9E9E9 100%);
background: no-repeat right, -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FBFBFB), color-stop(100%,#E9E9E9));
color:black;
border:none;
outline:none;
display: inline-block;
-webkit-appearance:none;
cursor:pointer;
border: 1px solid #ccc;
}
</style>
<script type="text/javascript">
$(document).ready(function (e) {
$("[id^=input_form]").on('submit',(function(e) {
e.preventDefault();
$.ajax({
url: "tester/sam9.php",
type: "POST",
data: new FormData(this),
contentType: false,
cache: false,
processData:false,
timeout:15000,
beforeSend: function()
{
$("#targetLayer").html("Fetching");
},
success: function(data)
{
$("#targetLayer").html(data);
},
error: function()
{
$("#targetLayer").html("ERROR");
}
});
}));
});
function w3_open() {
document.getElementById("mySidebar").style.display = "block";
}
function w3_close() {
document.getElementById("mySidebar").style.display = "none";
}
</script>
</head>
<body class = "w3-light-gray">
<!-- Sidebar -->
<div class="w3-sidebar w3-large w3-bar-block w3-border-right w3-animate-left" style="display:none" id="mySidebar">
<button onclick="w3_close()" class="w3-bar-item w3-large">Close ×</button>
<a href="student.php?roll=<?php echo $_GET['roll']; ?>" class="w3-bar-item w3-button">Student</a>
<a href="#" class="w3-bar-item w3-button">Evaluation</a>
<a href="#" class="w3-bar-item w3-button">Verification</a>
<a href="logon.php?out" class="w3-bar-item w3-button">Logout</a>
</div>
<div class="w3-container w3-teal">
<button class="w3-button w3-teal w3-xlarge" onclick="w3_open()">☰</button>
<h1 align="center" >
Verification Board
</h1>
</div>
<h3 align="center">
<form id="input_form" action="login.php" method="POST">
<p><b><?php echo $_GET['roll']; ?></b></p>
<input name="roll" type = "hidden" value="<?php echo $_GET['roll']; ?>"/>
<select name = "question">
<?php
include 'credential.php';
$con = new mysqli($host, $user, $pass, $db);
check($con);
$salt = "fwkirtm452%2wkf#773&D";
$variable = $_GET['roll'];
$variable = test_input($variable);
$insert_image="select * from allocation where stud_id = '". $variable ."'";
$chk_question = 0;
if($stmt = $con->prepare('select * from question')){
//$stmt->bind_param('s',$variable);
if($stmt->execute()){
//$result = $stmt->get_result();
$result = get_result($stmt);
$i = 0;
//while($row = $result->fetch_array()){
while ($row = array_shift($result)){
$i += 1;
$hid_val = $row['maxm'];
$hid_val = $hid_val . "|" . $row['q_id'];
echo "<option value=\"". $hid_val . "\">". $row['question_no'] ."</option>";
$chk_question += 1;
}
}
$con->close();
}
?>
</select>
<?php
if($chk_question > 0){
?>
<input type="submit" value="Questions" class="btnSubmit" /><br><br>
<?php
}else{
echo "<input type=\"button\" value=\"No Questions\"/>";
}
echo "Total Count :: " . $chk_question;
?>
</form>
</h3>
<div id="targetLayer">
</div>
<!-- <img id="myImg" src="tester/images/lion.jpg" alt="Trolltunga, Norway" width="300" height="200"> -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content" >
<div class="modal-body" >
<img class="img-responsive" src=""/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</body>
</html>