Repository navigation
Expand file tree
/
Copy pathreport.php
More file actions
118 lines (85 loc) · 3.69 KB
/
Copy pathreport.php
File metadata and controls
118 lines (85 loc) · 3.69 KB
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 require_once("../common/_header.php"); ?>
<?php
require_once("../includes/database.class.php"); ?>
<?php
$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";
$select = "ED.*, MClg.name as college_name, EU.*, MU.name as user_name, EU.id as exam_user_id ";
$data = $dbObj->fetchMultiple($table, $where, $select);
if($data){
foreach ($data as $key => $row) {
$table = "exam_marksheet";
$where = "exam_user_id = " . $row["exam_user_id"]; //tya student che marks ghyayche jyacha exam_user_id ha row variable madhe ahe
$select = "*";
$data[$key]["marksheet"] = $dbObj->fetchMultiple($table, $where, $select);
}
}
?>
<?php //display
if($data){
?>
<thead>
<tr>
<?php
$count=0;
$output .= '
<table class="table" table-bordered>
<th>Name </th>
<th>Seatno</th>
';
foreach ($data as $record_key => $record_value) {
$row = $record_value; //ekach student cha data store kela row madhe
$marksheet = $row["marksheet"];
if($count==0)
{ //marksheet madhe bakicha data store na karat fakta marksheet array store kela
if($marksheet)
{
foreach ($marksheet as $key => $value)
{
$output .=
'
<th>'.$value['short_code'].'<br>'.
$value['type'].'</th>
';
}
$count=$count+1;
}
$output .= ' <th>Total </th>
<th>Result</th>
';
}
?>
</tr>
</thead><?php
?>
<?php
$output .= '
<tr>
<td>'.$row['user_name'].'</td>
<td>'.$row['seat_no'].'</td>
';
foreach ($marksheet as $key => $value)
{
$output .=
'
<td>'.$value['obtained'].'
'.$value['special_char'].'</td>
';
}
$output .= '
<td>'.$row['marks_total'].'</td>
<td>'.$row['result'].'</td>
';
?>
<?php
}
}
$output .= '</table>';
// header('Content-Type: application/xls');
// header('Content-Disposition: attachment; filename=download.xls');
echo $output;
?>
<?php require_once("../common/_footer.php"); ?>