-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewQuestions.php
68 lines (59 loc) · 2.44 KB
/
viewQuestions.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
<?php
include_once ("inc/classes/session.php");
include ("inc/classes/View.php");
$userSession = new Session();
if ($userSession->getSession('login') != true) {
header('Location: login.php');
}
$userSession->destroy();
$view = new View();
$viewQuestions = $view->viewQuestions();
//var_dump($viewCandidates);
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>View all Questions</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
</head>
<body>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<?php include ('nav.php'); ?>
<div id="signupbox" style=" margin-top:10px" class="mainbox col-md-10 col-md-offset-1 col-sm-8 col-sm-offset-2">
<div class="panel panel-info">
<div class="panel-heading">
<div class="panel-title">View All Questions</div>
</div>
<div class="panel-body" >
<table class="table table-bordered" style="width: 100%; table-layout: auto;">
<thead>
<tr>
<th style="width: 10%;">SL</th>
<th style="width: 80%;">Question</th>
<th style="width: 10%;">Action</th>
</tr>
</thead>
<tbody>
<?php $i = 0; foreach ($viewQuestions as $viewQuestion): ?>
<tr>
<td style="vertical-align: middle;"><?php $i += 1; echo $i; ?></td>
<td style="vertical-align: middle;"><?php echo $viewQuestion['question']; ?></td>
<td style="vertical-align: middle;">
<a href="editQuestion.php?id=<?php echo $viewQuestion['question_id']; ?>" style="width: 100px;" class="btn btn-primary">Edit</a>
<a href="delete.php?action=questiondelete&id=<?php echo $viewQuestion['question_id']; ?>" style="width: 100px; margin-top: 10px;" class="btn btn-danger">Delete</a>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<p class="text-center top_spac"> <a href="?action=logout">Logout</a> </p>