-
Notifications
You must be signed in to change notification settings - Fork 0
/
select_exam.php
60 lines (44 loc) · 1.4 KB
/
select_exam.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
<?php
session_start();
if(!isset($_SESSION["username"]))
{
?>
<script type="text/javascript">
window.location="login.php";
</script>
<?php
}
?>
<?php
include "connection.php";
include "header.php";
?>
<div class="row" style="margin: 0px; padding:0px; margin-bottom: 50px;">
<div class="col-lg-6 col-lg-push-3" style="min-height: 500px; background-color: white;">
<?php
$res=mysqli_query($link,"select * from exam_category");
while($row=mysqli_fetch_array($res))
{
?>
<input type="button" class="btn btn-success form-control" value="<?php echo $row["category"]; ?>" style="margin-top: 10px; background-color: blue; color: white" onclick="set_exam_type_session(this.value);">
<?php
}
?>
</div>
</div>
<?php
include "footer.php";
?>
<script type="text/javascript">
function set_exam_type_session(exam_category)
{
var xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
window.location = "dashboard.php";
}
};
xmlhttp.open("GET","forajax/set_exam_type_session.php?exam_category="+ exam_category,true);
xmlhttp.send(null);
}
</script>