?
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_franchisee_fee_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><th colspan="2"></td><td align="right"><img src="' . base_url() . 'assets/img/' . $logo . '" style="float:right;width:200px;"/></th> <tr><th colspan="3" style="font-size:16px;" align="center"><b><u>Franchisee Fee Report as on ' . date('d-m-Y') . '</u></b></th></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>'; if (array_key_exists('field_name_1', $postdata)) $html.='<th style="text-align:left;" bgcolor="#7FCEFF" >Franchisee Name</th>'; if (array_key_exists('field_name_2', $postdata)) $html.='<th style="text-align:left;" bgcolor="#7FCEFF">Batch No</th>'; if (array_key_exists('field_name_3', $postdata)) $html.='<th style="text-align:left;" bgcolor="#7FCEFF">Course Name</th>'; if (array_key_exists('field_name_4', $postdata)) $html.='<th style="text-align:left;" bgcolor="#7FCEFF">Payment Amount</th>'; if (array_key_exists('field_name_5', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF">Payment Date</th>'; if (array_key_exists('field_name_6', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF" >Payment Remarks</th>'; if (array_key_exists('field_name_7', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF" >Payment Mode</th>'; if (array_key_exists('field_name_8', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF" >Franchisee Receipt No</th>'; if (array_key_exists('field_name_9', $postdata)) $html.='<th style="text-align:left" bgcolor="#7FCEFF" >PV No</th>'; $html.='<th style="text-align:left" bgcolor="#7FCEFF" >Status</th>'; $html.='</tr> </thead><tbody>'; //var_dump($report); 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['batch_no'] . '</td>'; if (array_key_exists('field_name_3', $postdata)) $html.='<td rowspan=' . $count . '>' . $rep['course_name'] . '</td>'; if (array_key_exists('field_name_4', $postdata)) $html.='<td style="text-align:right" rowspan=' . $count . '>' . number_format ($rep['franchisee_fee_amount'],2) . '</td>'; if (array_key_exists('field_name_5', $postdata)) $html.='<td rowspan=' . $count . '>' . $this->mastermodel->convertdatenormalformat($rep['franchisee_fee_date']) . '</td>'; if (array_key_exists('field_name_6', $postdata)) $html.='<td rowspan=' . $count . '>' . $rep['franchisee_fee_payment_remarks'] . '</td>'; if (array_key_exists('field_name_7', $postdata)) $html.='<td rowspan=' . $count . '>' . $rep['franchisee_fee_payment_mode'] . '</td>'; if (array_key_exists('field_name_8', $postdata)) $html.='<td rowspan=' . $count . '>' . $rep['franchisee_receipt_no'] . '</td>'; if (array_key_exists('field_name_9', $postdata)) $html.='<td rowspan=' . $count . '>' . $rep['reference'] . '</td>'; $total_course_fee = $this->franchiseemodel->get_total_royalty($rep['batch_id']); $paid_royalty = $this->franchiseemodel->get_paid_royaly($rep['batch_id']); $franchisee_royalty = $this->mastermodel->get_single_field_value('franchisee_course', 'franchisee_course_royalty', 'course_id', $rep['batch_id']); $total_royalty = $franchisee_royalty*$total_course_fee/100; if($total_royalty > $paid_royalty) $status = "Payment Pending"; else $status = "Payment Completed"; $html.='<td rowspan=' . $count . '>' .$status . '</td>'; } $html.='</tr>'; $i++; $k = $row['franchisee_id']; } } } $html.='</tbody></table> <hr>'; if ($view == 'view') { $html.="</div>"; echo $html; } else { $html.='</body></html>'; $filename = "Franchisee Fee 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, 'Franchisee Fee','true'); } print $html; exit; } ?>