mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-19 14:57:55 -05:00
Tom git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@24 c3eb156b-1dc0-44e1-88ae-e38439141b53
70 lines
1.6 KiB
PHP
70 lines
1.6 KiB
PHP
<?php
|
|
//OJB: Check if for excel export process
|
|
if($export_excel == 1){
|
|
ob_start();
|
|
$this->load->view("partial/header_excel");
|
|
}else{
|
|
$this->load->view("partial/header");
|
|
}
|
|
?>
|
|
<div id="page_title" style="margin-bottom:8px;"><?php echo $title ?></div>
|
|
<div id="page_subtitle" style="margin-bottom:8px;"><?php echo $subtitle ?></div>
|
|
<div id="table_holder">
|
|
<table class="tablesorter report" id="sortable_table">
|
|
<thead>
|
|
<tr>
|
|
<?php foreach ($headers as $header) { ?>
|
|
<th><?php echo $header; ?></th>
|
|
<?php } ?>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($data as $row) { ?>
|
|
<tr>
|
|
<?php foreach ($row as $cell) { ?>
|
|
<td><?php echo $cell; ?></td>
|
|
<?php } ?>
|
|
</tr>
|
|
<?php } ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div id="report_summary">
|
|
<?php foreach($summary_data as $name=>$value) { ?>
|
|
<div class="summary_row"><?php echo $this->lang->line('reports_'.$name). ': '.to_currency($value); ?></div>
|
|
<?php }?>
|
|
</div>
|
|
<?php
|
|
if($export_excel == 1){
|
|
$this->load->view("partial/footer_excel");
|
|
$content = ob_end_flush();
|
|
|
|
$filename = trim($filename);
|
|
$filename = str_replace(array(' ', '/', '\\'), '', $title);
|
|
$filename .= "_Export.xls";
|
|
header('Content-type: application/ms-excel');
|
|
header('Content-Disposition: attachment; filename='.$filename);
|
|
echo $content;
|
|
die();
|
|
|
|
}else{
|
|
$this->load->view("partial/footer");
|
|
?>
|
|
|
|
<script type="text/javascript" language="javascript">
|
|
function init_table_sorting()
|
|
{
|
|
//Only init if there is more than one row
|
|
if($('.tablesorter tbody tr').length >1)
|
|
{
|
|
$("#sortable_table").tablesorter();
|
|
}
|
|
}
|
|
$(document).ready(function()
|
|
{
|
|
init_table_sorting();
|
|
});
|
|
</script>
|
|
<?php
|
|
} // end if not is excel export
|
|
?>
|