-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamcertificate.php
141 lines (125 loc) · 4.05 KB
/
examcertificate.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
139
140
141
<?php
include("header.php");
$sqlstudentprofile = "SELECT * FROM students where regno=$_SESSION[regno]";
$querystudentprofile = mysqli_query($con,$sqlstudentprofile);
$rsstudentprofile = mysqli_fetch_array($querystudentprofile);
$sqlcourse = "SELECT * FROM course where courseid=$rsstudentprofile[courseid]";
$qcourse = mysqli_query($con,$sqlcourse);
$rscourse = mysqli_fetch_array($qcourse);
$sqlsubjects = "SELECT * FROM subjects where courseid=$rscourse[courseid]";
$qsubjects = mysqli_query($con,$sqlsubjects);
$rssubjects = mysqli_fetch_array($qsubjects);
$sqlsubject = "SELECT * FROM exam INNER JOIN subjects ON subjects.subjectcode=exam.subjectcode where exam.examid=$_SESSION[examid]";
$qsubject = mysqli_query($con,$sqlsubject);
$rssubject = mysqli_fetch_array($qsubject);
$sqlexamresult = "SELECT * FROM results where examid=$_SESSION[examid]";
$qexamresult = mysqli_query($con,$sqlexamresult);
$rsexamresult = mysqli_fetch_array($qexamresult);
//unanswered questions
$sqlunanswered = "SELECT * FROM results where examid=$_SESSION[examid] AND answerid=0";
$qunanswered = mysqli_query($con,$sqlunanswered);
$rsunanswered = mysqli_fetch_array($qunanswered);
//answered questions
$sqlanswered = "SELECT * FROM results where examid=$_SESSION[examid] AND answerid<>0";
$qanswered = mysqli_query($con,$sqlanswered);
$rsanswered = mysqli_fetch_array($qanswered);
//Correct answers
$sqlexamresult = "SELECT * FROM results INNER JOIN questions ON questions.queid = results.queid where examid=$_SESSION[examid]";
$qexamresult = mysqli_query($con,$sqlexamresult);
while($rsexamresult = mysqli_fetch_array($qexamresult))
{
if($rsexamresult[answerid] == $rsexamresult[answer])
{
$canswer = $canswer + 1;
}
else
{
$wanswer = $wanswer + 1;
}
}
?>
<div class="slider_top2">
<h2>Exam certificate</h2>
</div>
<div class="clr"></div>
<div class="body_resize">
<div class="body">
<div class="full">
<p>
<form method=post action="">
<input type="hidden" name="setid" value="<?php echo $_SESSION[setid]; ?>" />
<table width="610" border="1" class="tftable">
<tr>
<th colspan="4" scope="col"><center>Candidate details</center></th>
</tr>
<tr>
<th colspan="2" scope="col">Roll No</th>
<td colspan="2" scope="col"> <?php echo $rsstudentprofile[regno]; ?></td>
</tr>
<tr>
<th width="183" colspan="2" scope="col">Student Name</th>
<td width="249" colspan="2" scope="col"> <?php echo $rsstudentprofile[name]; ?></td>
</tr>
<tr>
<th colspan="4" scope="row"><center>Course details</center></th>
</tr>
<tr>
<th colspan="2" scope="row"> Course</th>
<td colspan="2"><label for="certificateid"></label> <?php echo $rscourse[coursename]; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Subject code</th>
<td colspan="2"><label for="studentid"></label> <?php echo $rssubjects[subjectcode]; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Subject name</th>
<td colspan="2"><label for="queid"></label> <?php echo $rssubjects[subjectname]; ?></td>
</tr>
<tr>
<th colspan="4" scope="row"><center>Result details</center></th>
</tr>
<tr>
<th scope="row">Subject</th>
<th scope="row">Maximum Marks</th>
<th>Maximum marks</th>
<th>Result</th>
</tr>
<tr>
<td scope="row">Subject</th>
<td scope="row">Maximum Marks</th>
<td>Maximum marks</th>
<td>Result</th>
</tr>
<tr>
<th colspan="3" scope="row">Total Marks</th>
<td colspan="1"> </td>
</tr>
<tr>
<th colspan="3" scope="row">Percentage</th>
<td colspan="1"><label for="answer"></label></td>
</tr>
</table>
</form>
<br />
<table border="2" width=612 align="center" class="tftable">
<tr>
<td align="center">
<button onclick="myFunction()">Print this page</button>
<script>
function myFunction()
{
window.print();
}
</script>
</td>
</tr>
</table>
</p>
</div>
<div class="clr"></div>
</div>
</div>
<?php
unset($_SESSION[examid]);
include("footer.php");
?>