?
Current Path : /home1/savoy/public_html/oscarerp.com/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/oscarerp.com/application/views/report/xls_franchisee_report.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); $html = '<html><head><body>'; $html.='<table width="100%"> <tr><td colspan="2"></td><td align="right"><img src="' . base_url() . 'assets/images/'.$logo.'" style="float:right"/></td> <tr><td colspan="3" style="font-size:16px;" align="center"><b><u>Franchisee 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>'; $html.='<table cellspacing="-1" style="width:100%;text-align:left"> <tr>'; if (array_key_exists('field_name_1', $postdata)) $html.='<td bgcolor="#7FCEFF" style="text-align:left;">Franchisee Name</td>'; if (array_key_exists('field_name_2', $postdata)) $html.='<td bgcolor="#7FCEFF" style="text-align:left;">Franchisee Code</td>'; if (array_key_exists('field_name_3', $postdata)) $html.='<td bgcolor="#7FCEFF" style="text-align:left;">Address</td>'; if (array_key_exists('field_name_4', $postdata)) $html.='<td bgcolor="#7FCEFF" style="text-align:left;">Contact No</td>'; if (array_key_exists('field_name_5', $postdata)) $html.='<td style="text-align:left" bgcolor="#7FCEFF">Email</td>'; if (array_key_exists('field_name_6', $postdata)) $html.='<td style="text-align:left" bgcolor="#7FCEFF">Website</td>'; if (array_key_exists('field_name_7', $postdata)) $html.='<td style="text-align:left" bgcolor="#7FCEFF">Remarks</td>'; if (array_key_exists('field_name_8', $postdata)) $html.='<td style="text-align:left" bgcolor="#7FCEFF">Course Code</td>'; if (array_key_exists('field_name_9', $postdata)) $html.='<td style="text-align:left" bgcolor="#7FCEFF">Course Name</td>'; if (array_key_exists('field_name_10', $postdata)) $html.='<td style="text-align:left" bgcolor="#7FCEFF">Course Remarks</td>'; $html.='</tr> </thead><tbody>'; foreach ($report as $rep) { $html.='<tr style="color:#555555">'; $i = 1; $count=$this->mastermodel->get_num_rows('franchisee_course', 'franchisee_id',$rep['franchisee_id']); $franchisee_details = $this->mastermodel->get_data('franchisee_course',$rep['franchisee_id'],'franchisee_id'); if (sizeof($franchisee_details) > 0) { $k=""; foreach ($franchisee_details as $key => $row) { $html.='<tr>'; if($k!=$row['franchisee_id']) { if (array_key_exists('field_name_1', $postdata)) $html.='<td rowspan='.$count.'>' . $rep['franchisee_name'] .'</td>'; if (array_key_exists('field_name_2', $postdata)) $html.='<td rowspan='.$count.'>' . $rep['franchisee_code'] . '</td>'; if (array_key_exists('field_name_3', $postdata)) $html.='<td rowspan='.$count.'>' . $rep['franchisee_address'] . '</td>'; if (array_key_exists('field_name_4', $postdata)) $html.='<td rowspan='.$count.'>' . $rep['franchisee_contact_no'] . '</td>'; if (array_key_exists('field_name_5', $postdata)) $html.='<td rowspan='.$count.'>' . $rep['franchisee_email'] . '</td>'; if (array_key_exists('field_name_6', $postdata)) $html.='<td rowspan='.$count.'>' . $rep['franchisee_website'] . '</td>'; if (array_key_exists('field_name_7', $postdata)) $html.='<td rowspan='.$count.'>' . $rep['franchisee_remarks'] . '</td>'; } $course=$this->mastermodel->get_data_srow('course',$row['course_id'],'course_id'); if (array_key_exists('field_name_8', $postdata)) $html.='<td>' .$course->course_code . '</td>'; if (array_key_exists('field_name_9', $postdata)) $html.='<td>' . $course->course_name . '</td>'; if (array_key_exists('field_name_10', $postdata)) $html.='<td>' . $row['franchisee_course_remarks'] . '</td>'; $html.='</tr>'; $i++; $k=$row['franchisee_id']; } } } $html.='</table> <hr>'; $html.='</body></html>'; $filename = "Franchisee Report"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=".$filename.".xls"); header("Pragma: no-cache"); header("Expires: 0"); print $html; exit; ?>