Fix PDF export and logo
This commit is contained in:
parent
e3b736e222
commit
759331105d
5
.gitignore
vendored
5
.gitignore
vendored
@ -19,4 +19,7 @@ system/plugin/ui/*
|
|||||||
!system/plugin/ui/index.html
|
!system/plugin/ui/index.html
|
||||||
ui/ui_custom/**
|
ui/ui_custom/**
|
||||||
!ui/ui_custom/index.html
|
!ui/ui_custom/index.html
|
||||||
!ui/ui_custom/README.md
|
!ui/ui_custom/README.md
|
||||||
|
system/uploads/admin.png
|
||||||
|
system/uploads/logo.png
|
||||||
|
system/uploads/user.jpg
|
@ -61,6 +61,12 @@ switch ($action) {
|
|||||||
$title = ' Reports [' . $mdate . ']';
|
$title = ' Reports [' . $mdate . ']';
|
||||||
$title = str_replace('-', ' ', $title);
|
$title = str_replace('-', ' ', $title);
|
||||||
|
|
||||||
|
if(file_exists('system/uploads/logo.png')){
|
||||||
|
$logo = 'system/uploads/logo.png';
|
||||||
|
}else{
|
||||||
|
$logo = 'system/uploads/logo.default.png';
|
||||||
|
}
|
||||||
|
|
||||||
if ($x) {
|
if ($x) {
|
||||||
$html = '
|
$html = '
|
||||||
<div id="page-wrap">
|
<div id="page-wrap">
|
||||||
@ -69,7 +75,7 @@ switch ($action) {
|
|||||||
' . $config['address'] . '<br>
|
' . $config['address'] . '<br>
|
||||||
' . $_L['Phone_Number'] . ': ' . $config['phone'] . '<br>
|
' . $_L['Phone_Number'] . ': ' . $config['phone'] . '<br>
|
||||||
</div>
|
</div>
|
||||||
<div id="logo"><img id="image" src="system/uploads/logo.png" alt="logo" /></div>
|
<div id="logo"><img id="image" src="'.$logo.'" alt="logo" /></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="header">' . $_L['All_Transactions_at_Date'] . ': ' . date($config['date_format'], strtotime($mdate)) . '</div>
|
<div id="header">' . $_L['All_Transactions_at_Date'] . ': ' . date($config['date_format'], strtotime($mdate)) . '</div>
|
||||||
<table id="customers">
|
<table id="customers">
|
||||||
@ -178,7 +184,6 @@ EOF;
|
|||||||
if ($stype != '') {
|
if ($stype != '') {
|
||||||
$d->where('type', $stype);
|
$d->where('type', $stype);
|
||||||
}
|
}
|
||||||
|
|
||||||
$d->where_gte('recharged_on', $fdate);
|
$d->where_gte('recharged_on', $fdate);
|
||||||
$d->where_lte('recharged_on', $tdate);
|
$d->where_lte('recharged_on', $tdate);
|
||||||
$d->order_by_desc('id');
|
$d->order_by_desc('id');
|
||||||
@ -207,7 +212,6 @@ EOF;
|
|||||||
$fdate = _post('fdate');
|
$fdate = _post('fdate');
|
||||||
$tdate = _post('tdate');
|
$tdate = _post('tdate');
|
||||||
$stype = _post('stype');
|
$stype = _post('stype');
|
||||||
|
|
||||||
$d = ORM::for_table('tbl_transactions');
|
$d = ORM::for_table('tbl_transactions');
|
||||||
if ($stype != '') {
|
if ($stype != '') {
|
||||||
$d->where('type', $stype);
|
$d->where('type', $stype);
|
||||||
@ -229,6 +233,11 @@ EOF;
|
|||||||
|
|
||||||
$title = ' Reports [' . $mdate . ']';
|
$title = ' Reports [' . $mdate . ']';
|
||||||
$title = str_replace('-', ' ', $title);
|
$title = str_replace('-', ' ', $title);
|
||||||
|
if(file_exists('system/uploads/logo.png')){
|
||||||
|
$logo = 'system/uploads/logo.png';
|
||||||
|
}else{
|
||||||
|
$logo = 'system/uploads/logo.default.png';
|
||||||
|
}
|
||||||
|
|
||||||
if ($x) {
|
if ($x) {
|
||||||
$html = '
|
$html = '
|
||||||
@ -238,7 +247,7 @@ EOF;
|
|||||||
' . $config['address'] . '<br>
|
' . $config['address'] . '<br>
|
||||||
' . $_L['Phone_Number'] . ': ' . $config['phone'] . '<br>
|
' . $_L['Phone_Number'] . ': ' . $config['phone'] . '<br>
|
||||||
</div>
|
</div>
|
||||||
<div id="logo"><img id="image" src="system/uploads/logo.png" alt="logo" /></div>
|
<div id="logo"><img id="image" src="'.$logo.'" alt="logo" /></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="header">' . $_L['All_Transactions_at_Date'] . ': ' . date($config['date_format'], strtotime($fdate)) . ' - ' . date($config['date_format'], strtotime($tdate)) . '</div>
|
<div id="header">' . $_L['All_Transactions_at_Date'] . ': ' . date($config['date_format'], strtotime($fdate)) . ' - ' . date($config['date_format'], strtotime($tdate)) . '</div>
|
||||||
<table id="customers">
|
<table id="customers">
|
||||||
@ -281,11 +290,7 @@ EOF;
|
|||||||
<h3 class="sum">' . $config['currency_code'] . ' ' . number_format($xy, 2, $config['dec_point'], $config['thousands_sep']) . '</h3>';
|
<h3 class="sum">' . $config['currency_code'] . ' ' . number_format($xy, 2, $config['dec_point'], $config['thousands_sep']) . '</h3>';
|
||||||
|
|
||||||
run_hook('pdf_by_period'); #HOOK
|
run_hook('pdf_by_period'); #HOOK
|
||||||
define('_MPDF_PATH', 'system/vendors/mpdf/');
|
$mpdf = new \Mpdf\Mpdf();
|
||||||
|
|
||||||
require('system/vendors/mpdf/mpdf.php');
|
|
||||||
|
|
||||||
$mpdf = new mPDF('c', 'A4', '', '', 20, 15, 25, 25, 10, 10);
|
|
||||||
$mpdf->SetProtection(array('print'));
|
$mpdf->SetProtection(array('print'));
|
||||||
$mpdf->SetTitle($config['CompanyName'] . ' Reports');
|
$mpdf->SetTitle($config['CompanyName'] . ' Reports');
|
||||||
$mpdf->SetAuthor($config['CompanyName']);
|
$mpdf->SetAuthor($config['CompanyName']);
|
||||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Loading…
x
Reference in New Issue
Block a user