-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathview.php
117 lines (111 loc) · 3.09 KB
/
view.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
<?php
include "config.php";
global $conn;
$qry = "SELECT * FROM onair WHERE url='" . $_GET['onairID'] . "'";
$exe = mysqli_query($conn, $qry);
$onairData = array(array());
$i = 0;
while ($cont = mysqli_fetch_array($exe)) {
for ($j = 0; $j <= 5; $j++) {
$onairData[$i][$j] = $cont[$j];
}
$i++;
}
$qry = "SELECT * FROM questions WHERE paper_id='" . $onairData[0][1] . "'";
$exe = mysqli_query($conn, $qry);
$questions = array(array());
$i = 0;
while ($cont = mysqli_fetch_array($exe)) {
for ($j = 0; $j <= 3; $j++) {
$questions[$i][$j] = $cont[$j];
}
$i++;
}
$qry = "SELECT * FROM paper WHERE paper_id='" . $onairData[0][1] . "'";
$exe = mysqli_query($conn, $qry);
$paperData = array(array());
$i = 0;
while ($cont = mysqli_fetch_array($exe)) {
for ($j = 0; $j <= 5; $j++) {
$paperData[$i][$j] = $cont[$j];
}
$i++;
}
$qry = "SELECT * FROM subjects WHERE code='" . $paperData[0][1] . "'";
$exe = mysqli_query($conn, $qry);
$subjects = array(array());
$i = 0;
while ($cont = mysqli_fetch_array($exe)) {
for ($j = 0; $j <= 4; $j++) {
$subjects[$i][$j] = $cont[$j];
}
$i++;
}
?>
<style>
body {
margin: 10%;
}
.paper-parent {
border: 1px solid;
width: 100%;
}
.center {
text-align: center;
}
.flex-between {
display: flex;
justify-content: space-between;
}
</style>
<div class="paper-parent">
<h1 class="center"><?php echo getSubjectName($paperData[0][1]) ?></h1>
<h3 class="center">Subject Code:<?php echo $paperData[0][1] ?></h3>
<h3 class="center" style="text-transform:uppercase;"><?php echo $subjects[0][4] ?></h3>
<h3 class="flex-between">
<span class="left">Time Duration: 3 Hours</span>
<span class="right">Max. Marks: <?php echo $paperData[0][3] ?></span>
</h3>
<h5>INSTRUCTION TO CANDIDATES :</h5>
<ul>
<li>SECTION-A is COMPULSORY consisting of TEN questions carrying TWO marks each.</li>
<li>SECTION-B contains FIVE questions carrying FIVE marks each and students have to attempt any FOUR questions.</li>
<li>SECTION-C contains THREE questions carrying TEN marks each and students have to attempt any TWO questions.</li>
</ul>
<div>
<h3 class="center">Section A</h3>
<ol>
<?php
foreach ($questions as $question) {
if ($question[3] == "A") {
echo "<li>$question[2]</li>";
}
}
?>
</ol>
</div>
<div>
<h3 class="center">Section B</h3>
<ol>
<?php
foreach ($questions as $question) {
if ($question[3] == "B") {
echo "<li>$question[2]</li>";
}
}
?>
</ol>
</div>
<div>
<h3 class="center">Section C</h3>
<ol>
<?php
foreach ($questions as $question) {
if ($question[3] == "C") {
echo "<li>$question[2]</li>";
}
}
?>
</ol>
</div>
</div>