?
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_stock_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/img/logo.jpg" style="float:right;width:200px;"/></td> <tr><td colspan="3" style="font-size:16px;" align="center"><b><u>' . $postdata['report_name'] . '</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.=" <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><th style="text-align:left" bgcolor="#7FCEFF">Sl No</th>'; foreach ($report as $key => $value) { $column_name = array_keys($value); } //foreach ($column_name as $key) { $html .= '<th style="text-align:left" bgcolor="#7FCEFF">Inventory Type</th> <th style="text-align:left" bgcolor="#7FCEFF">Quantity</th>'; //} $html.='</tr> </thead> <tbody>'; $i = 0; foreach ($report as $value) { $i++; $html.='<tr><td>' . $i . '</td>'; $html.='<td>' . $value['inventory_type'] . '</td>'; $html.='<td>' . $this->inventorymodel->get_stock($value['inventory_id']) . '</td></tr>'; } $html.='</tbody></table>'; $html.='<hr>'; if ($view == 'view') { $html.="</div>"; echo $html; } else { $html.='</body></html>'; $filename = $postdata['report_name']; 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, $filename); } print $html; exit; } ?>