?
Current Path : /home1/savoy/public_html/savoyglobal.net/sec/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/application/views/report/xls_student_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/img/' . $logo . '" style="float:right;width:200px;"/></td> <tr><td colspan="3" style="font-size:16px;" align="center"><b><u>Students 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.=" <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" cellpading="5px" style="width:100%;text-align:left" class="sort"> <thead> <tr>'; $html.='<th style="text-align:left" bgcolor="#7FCEFF">Sl No</th>'; if (array_key_exists('field_name_1', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Student No</th>'; if (array_key_exists('field_name_2', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">First Name</th>'; if (array_key_exists('field_name_3', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Last Name</th>'; if (array_key_exists('field_name_4', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Gender</th>'; if (array_key_exists('field_name_5', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">DOB</th>'; if (array_key_exists('field_name_6', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Age</th>'; if (array_key_exists('field_name_7', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Batch</th>'; if (array_key_exists('field_name_8', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Course Code</th>'; if (array_key_exists('field_name_9', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Course Name</th>'; if (array_key_exists('field_name_10', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Nationality</th>'; if (array_key_exists('field_name_11', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">School Name</th> '; if (array_key_exists('field_name_12', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Grade Name</th>'; if (array_key_exists('field_name_13', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Qatar Id</th>'; if (array_key_exists('field_name_14', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Blood Group</th>'; if (array_key_exists('field_name_15', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Previous Medical Illness</th>'; if (array_key_exists('field_name_16', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Address</th>'; if (array_key_exists('field_name_17', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Email</th>'; if (array_key_exists('field_name_18', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Father Name</th>'; if (array_key_exists('field_name_19', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Father Mobile No</th>'; if (array_key_exists('field_name_20', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Mother Name</th>'; if (array_key_exists('field_name_21', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Mother Mobile No</th>'; if (array_key_exists('field_name_22', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Slibing Name</th>'; if (array_key_exists('field_name_23', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Reg No</th>'; if (array_key_exists('field_name_24', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Gender</th>'; if (array_key_exists('field_name_25', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Batch</th>'; //if (array_key_exists('field_name_23', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Student Type</th>'; $html.='</tr></thead><tbody>'; $i = 1; $k = ""; $j = 1; $co = ""; $std_id = ""; $p_array = array(); $j = 0; $si = 1; foreach ($report as $rep) { $j++; $sibling[$rep['std_id']] = $this->mastermodel->get_sibling_details($rep['p_id'], $rep['std_id']); $rowspan = ""; $sib_count = 0; if (isset($sibling[$rep['std_id']])) { $sib_count = count($sibling[$rep['std_id']]); if ($sib_count > 1) $rowspan = "rowspan='" . $sib_count . "'"; } $cancelled = $this->studentmodel->check_student_cancelled($rep['std_id'], $rep['batch_id']); $status = ""; if ($si == 1) { $html.='<tr style="color:#555555">'; $html.='<td ' . $rowspan . '>' . $i++ . '</td>'; if (array_key_exists('field_name_1', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['reg_no'] . '</td>'; if (array_key_exists('field_name_2', $postdata)) { if ($cancelled > 0) $status = " ( Cancelled ) "; $html.='<td ' . $rowspan . '>' . $rep['first_name'] . $status . '</td>'; } if (array_key_exists('field_name_3', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['last_name'] . '</td>'; if (array_key_exists('field_name_4', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['gender'] . '</td> '; if (array_key_exists('field_name_5', $postdata)) $html.='<td ' . $rowspan . '>' . $this->mastermodel->convertdatenormalformat($rep['dob']) . '</td> '; if (array_key_exists('field_name_6', $postdata)) $html.='<td ' . $rowspan . '>' . date_diff(date_create($rep['dob']), date_create('today'))->y . '</td> '; if (array_key_exists('field_name_7', $postdata)) { $html.='<td ' . $rowspan . '>' . $rep['batch_no'] . '</td> '; } if (array_key_exists('field_name_8', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['course_code'] . '</td> '; if (array_key_exists('field_name_9', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['course_name'] . '</td>'; if (array_key_exists('field_name_10', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['nationality'] . '</td>'; if (array_key_exists('field_name_11', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['school_name'] . '</td>'; if (array_key_exists('field_name_12', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['grade_name'] . '</td>'; if (array_key_exists('field_name_13', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['qatar_id'] . '</td>'; if (array_key_exists('field_name_14', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['blood_group'] . '</td>'; if (array_key_exists('field_name_15', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['previous_medical_illness'] . '</td>'; if (array_key_exists('field_name_16', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['address'] . '</td>'; if (array_key_exists('field_name_17', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['email'] . '</td>'; if (array_key_exists('field_name_18', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['father_name'] . '</td>'; if (array_key_exists('field_name_19', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['father_mobile_no'] . '</td>'; if (array_key_exists('field_name_20', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['mother_name'] . '</td>'; if (array_key_exists('field_name_21', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['mother_mobile_no'] . '</td>'; } $sib_name = ""; $sib_reg_name = ""; $sib_gender = ""; $sib_batch = ""; if (count($sibling[$rep['std_id']]) > 0) { foreach ($sibling[$rep['std_id']] as $sib) { if ($si > 1) { $html.='<tr style="color:#555555">'; } $batch = $this->reportmodel->get_batch($sib['student_id']); $sib_name = $sib['first_name'] . ' ' . $sib['last_name']; $sib_reg_name = $sib['reg_no']; $sib_gender = $sib['gender']; $sib_batch = $batch; if (array_key_exists('field_name_22', $postdata)) $html.='<td>' . $sib_name . '</td>'; if (array_key_exists('field_name_23', $postdata)) $html.='<td>' . $sib_reg_name . '</td>'; if (array_key_exists('field_name_24', $postdata)) $html.='<td>' . $sib_gender . '</td>'; if (array_key_exists('field_name_25', $postdata)) $html.='<td>' . $sib_batch . '</td>'; // if (array_key_exists('field_name_23', $postdata)) $html.='<td>' . $postdata['student_type'] . '</td>'; if ($si > 1) { $html.='</tr>'; } $si = $si + 1; } } else { $html.='<td colspan="5"></td>'; } if ($si == 1) { $html.='</tr>'; } $si = 1; $std = $rep['student_id']; $k = $rep['parent_id']; } $html.='</tbody></table>'; $html.='<hr>'; if ($view == 'view') { $html.="</div>"; echo $html; } else { $html.='</body></html>'; $filename = "Students 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, 'Student','true'); } print $html; exit; } ?>