?
Current Path : /home1/savoy/public_html/savoyglobal.net/ccnerp/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/ccnerp/application/views/report/xls_student_report.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?> <html> <head> <body> <table width="100%"> <tr><td colspan="2"></td><td align="right"><img src="<?=base_url()?>assets/logo/<?=$logo?>" style="float:right; max-height: 100px;"/></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> <hr> <table cellspacing="-1" style="width:100%;text-align:left" border="1" <thead> <tr> <th style="text-align:left" bgcolor="#7FCEFF">Sl No</th> <?php if (array_key_exists('field_name_1', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Student No</th>'; if (array_key_exists('field_name_2', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">First Name</th>'; if (array_key_exists('field_name_3', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Last Name</th>'; if (array_key_exists('field_name_4', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Class Name</th>'; if (array_key_exists('field_name_5', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Gender</th>'; if (array_key_exists('field_name_6', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Nationality</th>'; if (array_key_exists('field_name_7', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Qatar Id</th>'; if (array_key_exists('field_name_8', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Address</th>'; if (array_key_exists('field_name_9', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Mobile No</th>'; if (array_key_exists('field_name_10', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Father Name</th>'; if (array_key_exists('field_name_11', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Mother Name</th>'; if (array_key_exists('field_name_12', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Slibing Name</th>'; if (array_key_exists('field_name_13', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Slibing Reg No</th>'; if (array_key_exists('field_name_14', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Gender</th>'; ?> </tr> </thead> <tbody> <?php $i = 1; $k = ""; $j = 1; $co = ""; $student_id = ""; $p_array = array(); $j = 0; $si = 1; foreach ($report as $rep) { // echo $rep['student_id']; $j++; $sibling[$rep['student_id']] = $this->mastermodel->get_sibling_details($rep['p_id'], $rep['student_id']); $rowspan = ""; $sib_count = 0; if (isset($sibling[$rep['student_id']])) { $sib_count = count($sibling[$rep['student_id']]); if ($sib_count > 1) $rowspan = "rowspan='" . $sib_count . "'"; } $cancelled=0; $status = ""; if ($si == 1) { echo '<tr style="color:#555555">'; echo '<td ' . $rowspan . '>' . $i++ . '</td>'; if (array_key_exists('field_name_1', $postdata)) echo '<td ' . $rowspan . '>' . $rep['reg_no'] . '</td>'; if (array_key_exists('field_name_2', $postdata)) { if ($cancelled > 0) $status = " ( Cancelled ) "; echo '<td ' . $rowspan . '>' . $rep['first_name'] . $status . '</td>'; } if (array_key_exists('field_name_3', $postdata)) echo '<td ' . $rowspan . '>' . $rep['last_name'] . '</td>'; if (array_key_exists('field_name_4', $postdata)) echo '<td ' . $rowspan . '>' . $rep['class_name_code'] . '</td>'; if (array_key_exists('field_name_5', $postdata)) echo '<td ' . $rowspan . '>' . $rep['gender'] . '</td> '; if (array_key_exists('field_name_6', $postdata)) echo '<td ' . $rowspan . '>' . $rep['nationality_name'] . '</td>'; if (array_key_exists('field_name_7', $postdata)) echo '<td ' . $rowspan . '>' . $rep['qatar_id'] . '</td>'; if (array_key_exists('field_name_8', $postdata)) echo '<td ' . $rowspan . '>' . $rep['address'] . '</td>'; if (array_key_exists('field_name_9', $postdata)) echo '<td ' . $rowspan . '>' . $rep['mobile_no'] . '</td>'; if (array_key_exists('field_name_10', $postdata)) echo '<td ' . $rowspan . '>' . $rep['father_name'] . '</td>'; if (array_key_exists('field_name_11', $postdata)) echo '<td ' . $rowspan . '>' . $rep['mother_name'] . '</td>'; } $sib_name = ""; $sib_reg_name = ""; $sib_gender = ""; $sib_class = ""; if (count($sibling[$rep['student_id']]) > 0) { foreach ($sibling[$rep['student_id']] as $sib) { if ($si > 1) { echo '<tr style="color:#555555">'; } $class = $this->reportmodel->get_class($sib['student_id']); $sib_name = $sib['first_name'] . ' ' . $sib['last_name']; $sib_reg_name = $sib['reg_no']; $sib_gender = $sib['gender']; $sib_class = $class; if (array_key_exists('field_name_12', $postdata)) echo '<td>' . $sib_name . '</td>'; if (array_key_exists('field_name_13', $postdata)) echo '<td>' . $sib_reg_name . '</td>'; if (array_key_exists('field_name_14', $postdata)) echo '<td>' . $sib_gender . '</td>'; if ($si > 1) { echo '</tr>'; } $si = $si + 1; } } else { echo '<td colspan="4"></td>'; } if ($si == 1) { echo '</tr>'; } $si = 1; $std = $rep['student_id']; $k = $rep['parent_id']; } ?> </tbody> </table> <hr> </body> </html> <?php $filename = "Students Report"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=".$filename.".xls"); header("Pragma: no-cache"); header("Expires: 0"); print $html; exit; ?>