Your IP : 216.73.216.40


Current Path : /var/www/html/rkala/data/
Upload File :
Current File : /var/www/html/rkala/data/login.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>
	<script type="text/javascript">
			function w3_open() {
				document.getElementById("mySidebar").style.display = "block";
			}
			function w3_close() {
				document.getElementById("mySidebar").style.display = "none";
			}
	</script>
	<head>
		<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)}
			}

			.rotate90 {
			    -webkit-transform: rotate(90deg);
			    -moz-transform: rotate(90deg);
			    -o-transform: rotate(90deg);
			    -ms-transform: rotate(90deg);
			    transform: rotate(90deg);
			}

			/* 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: 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;
		  }
		  </style>		  	
		<script type="text/javascript">
			$(document).ready(function (e) {
				$("[id^=input_form]").on('submit',(function(e) {
					e.preventDefault();
					$.ajax({
						url: "tester/sam4.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");
					    	}	        
				   	});
				}));
			});
		</script>
	</head>
	<title>Evaluation Board</title>
	<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 &times;</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-teal">
		<button class="w3-button w3-teal w3-xlarge" onclick="w3_open()">&#9776;</button>
		<h1 align="center">
			Evaluation 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_once '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 = false;
				
				if($stmt = $con->prepare('select * from allocation where stud_id = ?')){
					$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;
							$algos = hash_algos();
							if (in_array("sha256", $algos)) {
								$hid_val = hash ("sha256", $row['peer_id'] . $salt);
							}else{
								echo "something Went wrong";
							}
							$hid_val = $hid_val . "|" . $row['question_id'];							
							echo "<option value=\"". $hid_val . "\">". $i ."</option>";
							$chk_question = true;
						}
					}
					$con->close();
				}
			?>
			</select>
			<?php
			if($chk_question == true){
			?>
			<input type="submit" value="Questions" class="btnSubmit" /><br>
			<?php
			}else{
				echo "<input type=\"button\" value=\"No Questions\"/>";
			}
			?>
			</form>
		</h3>
		
		<div id="targetLayer" class="w3-margin">
		
		</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>