?
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_parents_report.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); $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>Parents 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 cellspacing="0px" class="sort" cellpading="5px" ' . $border . ' style="width:100%;text-align:left" > <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">Father Name</th>'; if (array_key_exists('field_name_2', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">father Qatar ID NO</th>'; if (array_key_exists('field_name_3', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">father Occupation</th>'; if (array_key_exists('field_name_4', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">fathers Mobile No</th>'; if (array_key_exists('field_name_5', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">father Office No</th>'; if (array_key_exists('field_name_6', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">father Residence No</th>'; if (array_key_exists('field_name_7', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">father Email ID</th>'; if (array_key_exists('field_name_8', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Mother Name</th>'; if (array_key_exists('field_name_9', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Mother Qatar Id</th> '; if (array_key_exists('field_name_10', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Mother Occupation</th>'; if (array_key_exists('field_name_11', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Mother Mobile No</th>'; if (array_key_exists('field_name_12', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Mother Office No</th>'; if (array_key_exists('field_name_13', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Mother Residence No</th>'; if (array_key_exists('field_name_14', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Mother Email ID</th>'; if (array_key_exists('field_name_15', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Emergency Contact No</th>'; if (array_key_exists('field_name_16', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Student Name</th>'; if (array_key_exists('field_name_17', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Reg No</th>'; if (array_key_exists('field_name_18', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Gender</th>'; if (array_key_exists('field_name_19', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Batch</th>'; if (array_key_exists('field_name_20', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Course Code</th>'; if (array_key_exists('field_name_21', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Course Name</th>'; $html.='<th style="text-align:left" bgcolor="#7FCEFF">Student Type</th>'; $html.='</tr></thead><tbody>'; $i = 1; $k = ""; $j = 1; $co = ""; $p_array = array(); $s_array = array(); $student = array(); foreach ($report as $rep) { if (isset($p_array[$rep['p_id']])) $count = $p_array[$rep['p_id']]; else $count = 0; $p_array[$rep['p_id']] = $count + 1; $s_array[$rep['p_id']][$rep['student_id']][] = $rep['student_id']; } foreach ($report as $rep) { $rowspan = ""; if (isset($postdata['field_name_16']) || isset($postdata['field_name_17']) || isset($postdata['field_name_18']) || isset($postdata['field_name_19']) || isset($postdata['field_name_20']) || isset($postdata['field_name_21'])) { if (isset($p_array[$rep['p_id']]) && $p_array[$rep['p_id']] > 1) $rowspan = 'rowspan="' . $p_array[$rep['p_id']] . '"'; } $html.='<tr style="color:#555555">'; if ($k != $rep['p_id']) { $s = ""; $html.='<td ' . $rowspan . '>' . $i++ . '</td>'; if (array_key_exists('field_name_1', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['father_name'] . '</td>'; if (array_key_exists('field_name_2', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['father_qatar_id_no'] . '</td>'; if (array_key_exists('field_name_3', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['father_occupation'] . '</td>'; if (array_key_exists('field_name_4', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['father_mobile_no'] . '</td> '; if (array_key_exists('field_name_5', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['father_ofc_no'] . '</td> '; if (array_key_exists('field_name_6', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['father_residence_no'] . '</td> '; if (array_key_exists('field_name_7', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['father_email'] . '</td>'; if (array_key_exists('field_name_8', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['mother_name'] . '</td>'; if (array_key_exists('field_name_9', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['mother_qatar_id_no'] . '</td>'; if (array_key_exists('field_name_10', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['mother_occupation'] . '</td>'; if (array_key_exists('field_name_11', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['mother_mobile_no'] . '</td>'; if (array_key_exists('field_name_12', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['mother_ofc_no'] . '</td>'; if (array_key_exists('field_name_13', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['mother_residence_no'] . '</td>'; if (array_key_exists('field_name_14', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['mother_email'] . '</td>'; if (array_key_exists('field_name_15', $postdata)) $html.='<td ' . $rowspan . '>' . $rep['emergency_contact_no'] . '</td>'; } $std_row = ""; if ($s != $s_array[$rep['p_id']][$rep['student_id']]) { $std_row = 'rowspan="' . count($s_array[$rep['p_id']][$rep['student_id']]) . '"'; } if ($s != $s_array[$rep['p_id']][$rep['student_id']]) { if (array_key_exists('field_name_16', $postdata)) $html.='<td ' . $std_row . '>' . $rep['first_name'] . ' ' . $rep['last_name'] . '</td>'; if (array_key_exists('field_name_17', $postdata)) $html.='<td ' . $std_row . '>' . $rep['reg_no'] . '</td>'; if (array_key_exists('field_name_18', $postdata)) $html.='<td ' . $std_row . '>' . $rep['gender'] . '</td>'; } $s = $s_array[$rep['p_id']][$rep['student_id']]; if (array_key_exists('field_name_19', $postdata)) $html.='<td>' . $rep['batch_no'] . '</td>'; if (array_key_exists('field_name_20', $postdata)) $html.='<td>' . $rep['course_code'] . '</td>'; if (array_key_exists('field_name_21', $postdata)) $html.='<td>' . $rep['course_name'] . '</td>'; $html.='<td>' . $postdata['student_type'] . '</td>'; $html.='</tr>'; $k = $rep['parent_id']; } $html.='</tbody></table>'; $html.='<hr>'; if ($view == 'view') { $html.="</div>"; echo $html; } else { $html.='</body></html>'; $filename = "Parents 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, 'ParentsReport'); } print $html; exit; } ?>