?
Current Path : /home1/savoy/public_html/savoyglobal.net/sec_old/application/views/report/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/sec_old/application/views/report/xls_test_report.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); $html = ''; $html = ''; if ($view != 'view') { $border = ""; $html.= '<html><head><body>'; $html.='<table width="100%" class="sort"> <tr> <td colspan="2"></td> <td align="right"><img src="' . base_url() . 'assets/images/' . $logo . '" style="float:right;width:200px;"/></td> <tr><td colspan="3" style="font-size:16px;" align="center"><b><u>Test Report</u></b></td></tr> <tr><td colspan="3">Printout Date : ' . date('d-m-Y') . ', ' . date('h:i:s a') . '</td></tr> </table> <br><br>'; $html.='<hr>'; } else {$html.="<link rel='stylesheet' media='all' type='text/css' href='".base_url()."/assets/css/tablesort.css' /> <div style='width: 100%;border:1px solid #e4e4e4;padding:2px; height: auto; overflow-x: scroll;'> "; } if($view!='xls'){ $border = "border='1'"; } $html.='<table '.$border.' cellspacing="0px" class="sort" cellpading="5px" > <thead> <tr> <th style="text-align:left;width: 15px" bgcolor="#7FCEFF" rowspan="2">Sl No</th> <th style="text-align:left" bgcolor="#7FCEFF" rowspan="2">Batch Code</th> <th style="text-align:left" bgcolor="#7FCEFF" rowspan="2">Course Code</th> <th style="text-align:left" bgcolor="#7FCEFF" rowspan="2">Course Name </th> <th style="text-align:left" bgcolor="#7FCEFF" rowspan="2">Exam Name</th> <th style="text-align:left" bgcolor="#7FCEFF" rowspan="2">Test Date</th> <th style="text-align:left" bgcolor="#7FCEFF" rowspan="2">Remarks</th> <th style="text-align:left" bgcolor="#7FCEFF" rowspan="2">Student Type</th> <th style="text-align:left" bgcolor="#7FCEFF" rowspan="2">Student Name</th> <th style="text-align:left" bgcolor="#7FCEFF" rowspan="2">Reg No</th> <th style="text-align:left" bgcolor="#7FCEFF" rowspan="2">Gender</th> <th style="text-align:left" bgcolor="#7FCEFF" rowspan="2">Nationality</th> '; foreach ($report as $value) { $sub = $this->mastermodel->get_data('course_subject', $value['course_id'], 'course_id'); $i = 1; foreach ($sub as $list) { $subjects = $this->mastermodel->get_single_field_value('subject', 'subject_name', 'subject_id', $list['subject_id']); $html.=' <th style="text-align: center" colspan="2">' . $subjects . '</th>'; $i++; } } $html.='</tr>'; $html.='<tr>'; for ($i = 1; $i <= sizeof($sub); $i++) { $html.='<td style="text-align: center">Marks/ Grade</td> <td style="text-align: center">Remarks</td>'; '<th style="text-align:left" bgcolor="#7FCEFF">Student Type</th>'; } $html.='</tr> </thead> <tbody>'; //foreach ($report as $value) { // // // $student[$value['batch_id']] = $this->studentmodel->get_batch_student_details($value['batch_id'],$course); //} // $count= count($student); // $k=count; $i = 0; $j = 1; foreach ($report as $value) { $course=$this->mastermodel->get_single_field_value('batch','course_id','batch_id',$value['batch_id']); $student = $this->studentmodel->get_batch_student_details($value['batch_id'],$course); $count= count($student); $i++; $html.='<tr> <td style="vertical-align:text-top;" rowspan='.$count.'>' . $i . '</td> <td rowspan='.$count.'>' . $value['batch_no'] . '</td> <td rowspan='.$count.'>' . $value['course_code'] . '</td> <td rowspan='.$count.'>' . $value['course_name'] . '</td> <td rowspan='.$count.'>' . $value['exammaster_name'] . '</td> <td rowspan='.$count.'>' . $this->mastermodel->convertdatenormalformat($value['test_date']) . '</td> <td rowspan='.$count.'>' . $value['remarks'] . '</td>'; $html.='<td rowspan='.$count.'>' .$postdata['student_type']. '</td>'; // $marks=$this->mastermodel->get_data('performance_exam_subject',$value['performance_id'],'performance_id'); $j=1; if(empty($student)){ $html.='<td></td><td></td><td></td><td></td></tr>'; } foreach ($student as $row) { if($j>1) $html.='<tr>'; $sub_marks = $this->reportmodel->get_marks($row['student_id'], $value['performance_id']); $studnt_name = $this->mastermodel->get_data_srow('student', $row['student_id'], 'student_id'); $html.='<td>' . $studnt_name->first_name . " " . $studnt_name->last_name . '</td> <td style="text-align: center">' . $studnt_name->reg_no . '</td> <td style="text-align: center">' . $studnt_name->gender . '</td> <td style="text-align: center">' . $studnt_name->nationality . '</td>'; $k = 1; foreach ($sub_marks as $list) { $html.='<td style="text-align: center;width: 120px;height: 30px;">' . $list['marks'] . '</td> <td style="text-align: center;width: 120px;height: 30px;">' . $list['remarks'] . '</td>'; $k++; } if (sizeof($sub) > sizeof($sub_marks)) { $a = sizeof($sub_marks) + 1; for ($i = $a; $i <= sizeof($sub); $i++) { $html.='<td style="text-align: center;width: 120px;height: 30px;"></td> <td style="text-align: center;width: 120px;height: 30px;"></textarea>'; } } $j++; $html.='<td>'.$postdata['student_type']. '</td>'; $html.='</tr>'; } } $html.='</tbody> </table>'; $html.='<hr>'; if ($view == 'view') { $html.="</div>"; echo $html; } else { $html.='</body></html>'; $filename = "Test report"; if ($view == 'xls') { header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=" . $filename . ".xls"); header("Pragma: no-cache"); header("Expires: 0"); } if ($view == 'pdf') { pdf_create($html, 'Test'); } print $html; exit; } ?>