forked from divyanshukapoor/Quiz-Portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
activate_test.php
138 lines (118 loc) · 4.68 KB
/
activate_test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
session_start();
if($_SESSION["teacher_email"]==true)
{
?>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<link rel="icon" type="image/png" href="images/icons/favicon.ico"/>
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="animate.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<link rel="stylesheet" type="text/css" href="css/adminprofile.css">
<link type="text/css" rel="stylesheet" href="bootstrap-3.2.0-dist\css\bootstrap.css"> <!--css file link in bootstrap folder-->
<title>View teachers</title>
<script type="text/javascript">
function deleteteacher($email)
{
var s=<?php
$query="delete from `Teacher Info` where email='$email'";
$run=mysqli_query($dbcon,$query);
?>
}
</script>
</head>
<style>
.login-panel {
margin-top: 150px;
} +
.table {
margin-top: 50px;
}
</style>
<body>
<div class="table-scrol container-fluid">
<div class="table-responsive"><!--this is used for responsive display in mobile and other devices-->
<h2 align="center" style="font-family:Monospace"><strong> List of Quizes</strong></h2>
<table class="table table-bordered table-hover table-striped" style="table-layout: fixed">
<thead>
<tr>
<th>Exam ID</th>
<th>Subject Code</th>
<th>No of Questions</th>
<th>Branch</th>
<th>Key</th>
<th>Hours</th>
<th>Minutes</th>
<th>Activate Quiz</th>
</tr>
</thead>
<?php
$dbcon=mysqli_connect('172.31.100.41','quizmnnit','quizportal123');
mysqli_select_db($dbcon,'dbquizmnnit');
$s=substr($_SESSION["teacher_email"],0,strlen($_SESSION["teacher_email"])-12);
$view_teachers_query="select * from `Test_Info` where Teacher_id='$s'";//select query for viewing users.
$run=mysqli_query($dbcon,$view_teachers_query);//here run the sql query.
$storeArray=Array();
while($row=mysqli_fetch_array($run,MYSQLI_ASSOC))//while look to fetch the result and store in a array $row.
{
$examid=$row['Exam_id'];
$Teacher_id=$row['Teacher_id'];
$No_Ques=$row['No_Ques'];
$Subject_code=$row['Subject_code'];
$Branch=$row['Branch'];
$Test_key=$row['Test_key'];
$Hours=$row['Hours'];
$Minutes=$row['Minutes'];
?>
<tr>
<!--here showing results in the table -->
<td><?php echo $examid; ?></td>
<td><?php echo $Subject_code; ?></td>
<td><?php echo $No_Ques; ?></td>
<td><?php echo $Branch; ?></td>
<td><?php echo $Test_key; ?></td>
<td><?php echo $Hours; ?></td>
<td><?php echo $Minutes; ?></td>
<td>
<a href="php/test_active.php?id=<?php echo $examid;?>"><button class="btn btn-success" > Activate</button></a>
</td> </tr>
<?php }
mysqli_close($dbcon);
?>
</table>
</div>
</div>
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<script src="vendor/bootstrap/js/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="vendor/select2/select2.min.js"></script>
<script src="vendor/tilt/tilt.jquery.min.js"></script>
<script >
$('.js-tilt').tilt({
scale: 1.1
})
</script>
</body>
</html>
<?php
}
else
{
header('location:./teacher.html');
}
?>