| Current Path : /var/www/html/rkala/data/admin/ |
| Current File : /var/www/html/rkala/data/admin/ta_eval.php |
<?php
session_start();
include '../credential.php';
/*
if(!isset($_SESSION['encrpy']) || !isset($_SESSION['user']) || $_SESSION['encrpy'] != md5($_SESSION['user']."unbreakabelcipehre")) {
// user is not logged in, do something like redirect to login.php
header("Location: ../logon.php");
die();
}
*/
if(!isset($_SESSION['user'])) {
// another example...
// user is logged in but not a manager, let's stop him
die("Access Denied");
}
?>
<html>
<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">
<style>
table, th, td {
padding: 50px;
border: 0px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: center;
}
table#t02 {
border: 2px solid black;
}
table#t02 th {
background-color: black;
color: white;
}
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 () {
$('img').on('click', function () {
var image = $(this).attr('src');
$('#myModal').on('show.bs.modal', function () {
$('.img-responsive').attr('src', image);
});
});
});
</script>
</head>
<body>
<h2 align="right"><a href = "#" onclick="javascript:window.top.opener = null;window.close();">Close</a></h2>
<h1 align="center">
Evaluation Board
</h1>
<h3 align="center">
<p><b><?php echo $_GET['roll']; ?></b></p>
<?php
$roll = $_GET['roll'];
$question = $_GET['quest'];
$peer_roll = $_GET['peer'];
$roll = test_input($roll);
$question = test_input($question);
$ta = $_SESSION['user'];
$ta = explode(',', $ta);
parse_str($ta[0]);
$con = mysqli_connect($host, $user, $pass, $db);
check($con);
$query = "Select marks, ta_id from correction_ta where stud_id = '$roll' and question_id = $question and ta_id = '$uid'";
if($uid == 'rkala')
$query = "Select marks, ta_id from correction_ta where stud_id = '$roll' and question_id = $question";
$result = mysqli_query($con, $query) or die(mysqli_error());
while($row = mysqli_fetch_array($result)){
$res = "";
$tick = $row[0];
$ta_name = $row[1];
if($row[0] != -1){
$res = $row[0];
}
$query = "Select question_no, question, maxm from question where q_id = $question";
$result = mysqli_query($con, $query) or die(mysqli_error());
$row = mysqli_fetch_array($result);
?>
<div align = "center">
<table id = "t01" width="75%"><tr><th>Q.No</th><th>Question</th><th>Max. Marks</th></tr>
<tr><td><?php echo $row[0]; ?></td><td><?php echo $row[1]; ?></td><td><?php echo $row[2]; ?></td></tr>
</table><br>
<!--
<form id="input_form_2" action="login.php" method="POST">
<input type= "hidden" name = "roll" value = "<?php echo $roll; ?>">
<input type= "hidden" name = "hiden" value = "<?php echo $uid; ?>">
<input type= "hidden" name = "question" value = "<?php echo $question; ?>">
<table id="t02"><tr>
<td><input type="number" step="0.25" min="-1" max="<?php echo $row[2]; ?>" placeholder = "Input marks" name="marks" value="<?php echo $res; ?>" required></td>
<td><input type="submit" value="Save Marks" /></td>
<td><img class="event" id="status" title="Status" src="<?php if($tick != -1){?> ../img/tick.png <?php } else {?> ../img/cross.png <?php } ?>"></img></td></tr></table>
<br>
</form>
-->
</div>
<table id = "t02" align = "center"> <caption>Peer Evaluation Report</caption><tr><th>TA ID</th><th>TA Marks</th><th>Peer ID</th><th>Peer Marks</th><th>Comment</th><th>Blur</th></tr>
<?php
//$query = "Select marks, comment, blur from allocation where peer_id = '$roll' and question_id = $question and stud_id = '$peer_roll'";
$query = "Select marks, comment, blur, stud_id from allocation where peer_id = '$roll' and question_id = $question";
$result = mysqli_query($con, $query) or die(mysqli_error());
$bool = 0;
while($row = mysqli_fetch_array($result)){
$bool += 1;
if($row['blur'] == 0){
$var = "NO";
}else{
$var = "YES";
}
if($row['stud_id'] == $peer_roll){
echo "<tr bgcolor='#FF5733'><td>".$ta_name."</td><td>".$res."</td><td>"./*$peer_roll*/$row['stud_id']."</td><td>".$row['marks']."</td><td>".$row['comment']."</td><td>".$var."</td></tr>";
}else{
echo "<tr><td>".$ta_name."</td><td>".$res."</td><td>"./*$peer_roll*/$row['stud_id']."</td><td>".$row['marks']."</td><td>".$row['comment']."</td><td>".$var."</td></tr>";
}
}
?>
</table><br>
<table id = "t01" align = "center"><tr>
<?php
$query = "Select ans_id from ques_stud_ans where stud_id = '$roll' and ques_id = $question";
$result = mysqli_query($con, $query) or die(mysqli_error());
$bool = 0;
while($row = mysqli_fetch_array($result)){
$id = $row['ans_id'];
$query = "Select image from answer_id where a_id = $id";
$result2 = mysqli_query($con, $query) or die(mysqli_error());
while($row = mysqli_fetch_array($result2)){
// displaying the blob object
$bool += 1;
if($bool % 3 == 0){
echo '<td><img id="myImg" data-toggle="modal" data-target="#myModal" alt="Trolltunga, Norway" height="400" width="300" src="'.$row['image'].'"/></td></tr><tr>';
}else{
echo '<td><img id="myImg" data-toggle="modal" data-target="#myModal" alt="Trolltunga, Norway" height="400" width="300" src="'.$row['image'].'"/></td>';
}
//echo '<img id="myImg" data-toggle="modal" data-target="#myModal" alt="Trolltunga, Norway" height="300" width="200" src="tester/images/lion.jpg"/>';
}
}
?>
</tr></table>
<?php
if($bool == 0){
echo "No Answer Found";
}
}
mysqli_close($con);
?>
</h3>
<!-- <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>