-
Notifications
You must be signed in to change notification settings - Fork 0
/
Performance analysis.php
96 lines (78 loc) · 2.08 KB
/
Performance analysis.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
<?php
require_once("connection.php");
require_once("dbConnection.php");
session_start();
if(!isset($_SESSION['email'])){
header("location:index.php");
}
$db_handle = new DBController();
$year1=$_SESSION['year1'];
$name = $_SESSION['name'];
$email=$_SESSION['email'];
$q1=mysqli_query($con,"SELECT * FROM user WHERE email='$email' " )or die('Error231');
ob_start();
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',12);
$pdf->Image('image/logo1.png', 64, 8);
$pdf->SetFont('Times', 'B', 20);
$pdf->Cell(187, 180, 'Performance Analysis', 0, 2, 'C');
$pdf->SetFont('Times', 'B', 15);
$pdf->SetY(110);
$pdf->SetX(80);
$pdf->Cell(36,12,'Name:', 0, 0, 'L');
$pdf->SetY(110);
$pdf->SetX(96);
$pdf->Cell(36,12,$name , 0,1, 'L');
$pdf->SetY(120);
$pdf->SetX(80);
$pdf->Cell(36,12,'Year(number):', 0, 0, 'L');
while($row=mysqli_fetch_array($q1) ){
$year1=$row['year1'];
$pdf->Cell(36,12,$year1 , 0,1, 'L');
}
$q1=mysqli_query($con,"SELECT * FROM user WHERE email='$email' " )or die('Error231');
$pdf->SetY(130);
$pdf->SetX(80);
$pdf->Cell(36,12,'Department:', 0, 0, 'L');
$pdf->SetY(130);
$pdf->SetX(110);
while($row=mysqli_fetch_array($q1) ){
$department=$row['department'];
$pdf->Cell(36,12,$department, 0, 1, 'L');
}
$pdf->SetFont('Times', 'B', 14);
$header = array('Quiz','Total questions','Full marks', 'Correct', 'Incorrect','Marks obtained');
$pdf->SetY(150);
$pdf->SetX(2);
foreach($header as $heading) {
$pdf->Cell(34.5,12,$heading,1,' ','C');
}
$q=mysqli_query($con,"SELECT * FROM history WHERE email='$email' ORDER BY date DESC " )or die('Error197');
while($row=mysqli_fetch_array($q) )
{
$eid=$row['eid'];
$s=$row['score'];
$w=$row['wrong'];
$r=$row['sahi'];
$q23=mysqli_query($con,"SELECT * FROM quiz WHERE eid='$eid' " )or die('Error208');
while($row=mysqli_fetch_array($q23) )
{
$title=$row['title'];
$qa=$row['total'];
$r1=$row['sahi'];
}
$fm=$r1 * $qa;
$c++;
$result=array($title,$qa,$fm,$r,$w,$s);
$pdf->ln();
$pdf->SetX(2);
foreach($result as $row) {
$pdf->SetFont('Arial','B',12);
$pdf->Cell(34.5,12,$row,1,'','C');
}
}
$pdf->Output();
ob_end_flush();
?>