| Current Path : /var/www/html/rkala/data/ |
| Current File : /var/www/html/rkala/data/ta.php |
<?php
session_start();
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($_SESSION['access'] != 1) {
// another example...
// user is logged in but not a manager, let's stop him
die("Access Denied");
}
$t = $_SESSION['user'];
$t = explode(',', $t);
parse_str($t[0]);
$t = explode('=', $t[0]);
$roll = $t[1];
?>
<?php
function capital($username){
return strtoupper($username);
}
include 'tester/credential.php';
$scan_total = 0;
$scan_copy_total = 0;
$con = new mysqli($host, $user, $pass, $db);
if($con -> connect_errno){
echo "<script> alert('Server is Offline. Please try again later.'); window.location.href = 'logon.php'; </script>";
}
if($stmt = $con->prepare('select count(distinct(stud_id)) from ques_stud_ans where scan_id = ?')){
$stmt->bind_param('s',$roll);
$stmt->execute();
//$result = @$stmt->get_result();
$result = get_result($stmt);
//while($row = $result->fetch_array()){
while ($row = array_shift($result)){
$scan_copy_total = $row['count(distinct(stud_id))'];
}
}
if($stmt = $con->prepare('select count(stud_id) from ques_stud_ans where scan_id = \''. $roll. '\'')){
$stmt->execute();
//$result = @$stmt->get_result();
$result = get_result($stmt);
//while($row = $result->fetch_array()){
while ($row = array_shift($result)){
$scan_total = $row['count(stud_id)'];
}
}
$con -> close();
?>
<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)}
}
/* 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;
}
.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/sam8.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>
<title>Home</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 ×</button>
<a href="#" class="w3-bar-item w3-button">User</a>
<a href="student_insert.php" class="w3-bar-item w3-button">Scanning</a>
<a href="process.php" target="_blank" class="w3-bar-item w3-button">Re-Evaluation</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()">☰</button>
<h1 align="center" >
TA Home
</h1>
</div>
<h2 class="w3-margin" align="center">
<?php echo capital($roll); ?>
</h2>
<div class="w3-margin">
<table align="center" width="50%" class="w3-centered w3-striped w3-border">
<tr><th>Subject</th><th>Exam</th><th>Total Scans</th><th>Total Copies</th><th>Scan Quality</th></tr>
<tr><td>OOM-332C</td><td>End-Sem</td><td><?php echo $scan_total; ?></td><td><?php echo $scan_copy_total; ?></td><td>NA</td></tr>
</table>
</div>
<? if(capital($roll) == 'RKALA'){ ?>
<div class="w3-center w3-margin">
<a href="verification_student.php" class="w3-bar-item w3-btn w3-black w3-margin">DST Results<span class="w3-badge w3-margin-left w3-white">Complete</span></a></p>
</div>
<? } ?>
</body>
</html>