?
Current Path : /home1/savoy/www/savoyglobal.net/cocorico/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/www/savoyglobal.net/cocorico/application/views/report/xls_parents_report.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); $i=1; $span = 0; while ($i < $postdata['field_count']) { if (array_key_exists("field_name_$i", $postdata)) $span++; $i++; } ?> <html> <head> <body> <table width="100%"> <tr><td colspan="<?= $span-2 ?>"></td><td align="right"><img src="<?=base_url()?>assets/logo/<?=$logo?>" style="float:right"/></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> <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">Father Name</th>'; if (array_key_exists('field_name_2', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">father Qatar ID NO</th>'; if (array_key_exists('field_name_3', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">father Occupation</th>'; if (array_key_exists('field_name_4', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">fathers Mobile No</th>'; if (array_key_exists('field_name_5', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">father Office No</th>'; if (array_key_exists('field_name_6', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">father Residence No</th>'; if (array_key_exists('field_name_7', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">father Email ID</th>'; if (array_key_exists('field_name_8', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Mother Name</th>'; if (array_key_exists('field_name_9', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Mother Qatar Id</th>'; if (array_key_exists('field_name_10', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Mother Occupation</th>'; if (array_key_exists('field_name_11', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Mother Mobile No</th>'; if (array_key_exists('field_name_12', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Mother Office No</th>'; if (array_key_exists('field_name_13', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Mother Residence No</th>'; if (array_key_exists('field_name_14', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Mother Email ID</th>'; if (array_key_exists('field_name_15', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Emergency Contact No</th>'; if (array_key_exists('field_name_16', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Student Name</th>'; if (array_key_exists('field_name_17', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Reg No</th>'; if (array_key_exists('field_name_18', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Gender</th>'; if (array_key_exists('field_name_19', $postdata)) echo '<th style="text-align:left" bgcolor="#7FCEFF">Class Name</th>'; ?> </tr></thead> <tbody> <?php $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'])) { if (isset($p_array[$rep['p_id']]) && $p_array[$rep['p_id']] > 1) $rowspan = 'rowspan="' . $p_array[$rep['p_id']] . '"'; } ?> <tr style="color:#555555"> <?php if ($k != $rep['p_id']) { $s = ""; ?> <td <?= $rowspan ?>> <?= $i++ ?></td> <?php if (array_key_exists('field_name_1', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['father_name'] ?></td> <?php } if (array_key_exists('field_name_2', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['father_qatar_id_no'] ?></td> <?php } if (array_key_exists('field_name_3', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['father_occupation'] ?></td> <?php } if (array_key_exists('field_name_4', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['father_mobile_no'] ?></td> <?php } if (array_key_exists('field_name_5', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['father_ofc_no'] ?></td> <?php } if (array_key_exists('field_name_6', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['father_residence_no'] ?></td> <?php } if (array_key_exists('field_name_7', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['father_email'] ?></td> <?php } if (array_key_exists('field_name_8', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['mother_name'] ?></td> <?php } if (array_key_exists('field_name_9', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['mother_qatar_id_no'] ?></td> <?php } if (array_key_exists('field_name_10', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['mother_occupation'] ?></td> <?php } if (array_key_exists('field_name_11', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['mother_mobile_no'] ?></td> <?php } if (array_key_exists('field_name_12', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['mother_ofc_no'] ?></td> <?php } if (array_key_exists('field_name_13', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['mother_residence_no'] ?></td> <?php } if (array_key_exists('field_name_14', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['mother_email'] ?></td> <?php } if (array_key_exists('field_name_15', $postdata)) { ?> <td <?= $rowspan ?>><?= $rep['emergency_contact_no'] ?></td> <?php } } $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)) {?> <td <?= $std_row ?>><?= $rep['first_name'] ?> <?= $rep['last_name'] ?></td> <?php } if (array_key_exists('field_name_17', $postdata)) { ?> <td <?= $std_row ?>><?= $rep['reg_no'] ?></td> <?php } if (array_key_exists('field_name_18', $postdata)) { ?> <td <?= $std_row ?>><?= $rep['gender'] ?></td> <?php } } $s = $s_array[$rep['p_id']][$rep['student_id']]; if (array_key_exists('field_name_19', $postdata)) { ?> <td><?= $rep['class_name_code'] ?></td> <?php } ?> </tr> <?php $k = $rep['parent_id']; } ?> </tbody> </table> <hr> </body> </html> <?php $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') { } ?>