-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathResult_down.php
89 lines (78 loc) · 2.76 KB
/
Result_down.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
<?php require_once("../common/_header.php"); ?>
<?php require_once("../includes/database.class.php"); ?>
<style>
table, th, td {
border: 1px solid black;
}
</style>
<?php
// if(isset($_POST["export"]))
{
$table = "exam_details as ED
LEFT JOIN master_college as MClg ON MClg.id = ED.college_id
LEFT JOIN exam_user as EU ON EU.exam_id = ED.id
LEFT JOIN master_user as MU ON MU.id = EU.user_id ";
$where = "1 ORDER BY seat_no ASC";
$select = "ED.*, MClg.name as college_name, EU.*, MU.name as user_name, EU.id as exam_user_id, MU.enroll_no ";
$data = $dbObj->fetchMultiple($table, $where, $select);
if($data){
foreach ($data as $key => $row) {
$table = "exam_marksheet";
$where = "exam_user_id = " . $row["exam_user_id"];
$select = "*";
$data[$key]["marksheet"] = $dbObj->fetchMultiple($table, $where, $select);
}
}
$type = $data[$key]["exam_type"];
$type .= $data[$key]["exam_year"];
}
?>
<?php
header('Content-Type: application/xls');
header('Content-Disposition: attachment; filename='.$type.' Result copy.xls');
?>
<?php
if($data){ ?>
<table >
<tr>
<th> Name </th>
<th> Enrollment No </th>
<th> Seat No </th>
<?php
$data_row = $data[0];
$marksheet = $data_row["marksheet"];
if($marksheet){
foreach ($marksheet as $key => $value) { ?>
<th> <?php echo $value["short_code"] . "<br>" . $value["type"]; ?> </th>
<?php
}
} ?>
<th> Total marks </th>
<th> Result </th>
</tr>
<?php foreach ($data as $record_key => $row) { ?>
<tr>
<td><?php echo $row['user_name']; ?></td>
<td><?php echo $row['enroll_no']; ?></td>
<td><?php echo $row['seat_no']; ?></td>
<?php
$marksheet = $row["marksheet"];
if($marksheet){
foreach ($marksheet as $key => $value) { ?>
<td> <?php
if($value["special_char"]!="*")
{ echo $value["obtained"] .$value["special_char"];
}
else
echo $value["obtained"]?> </td>
<?php
}
} ?>
<td><?php echo $row['marks_total']; ?></td>
<td><?php echo $row['result']; ?></td>
</tr>
<?php } ?>
</table>
<?php
} ?>
<?php require_once("../common/_footer.php"); ?>