/
home
/
techb158
/
exp.abdallabala.com
/
application
/
controllers
/
/home/techb158/exp.abdallabala.com/application/controllers
mkdir
upload
Name
Size
Mode
Actions
.DS_Store
6148
0644
edit
dl
rm
accounts.php
7729
0644
edit
dl
rm
admin.php
6733
0644
edit
dl
rm
ajax.date-summary.php
3796
0644
edit
dl
rm
ajax.expense-calendar.php
1031
0644
edit
dl
rm
ajax.income-calendar.php
997
0644
edit
dl
rm
api.php
7595
0644
edit
dl
rm
appearance.php
2029
0644
edit
dl
rm
autologin.php
1599
0644
edit
dl
rm
board.php
989
0644
edit
dl
rm
calendar.php
4949
0644
edit
dl
rm
client.php
63019
0644
edit
dl
rm
clx_api.php
43178
0644
edit
dl
rm
console.php
5700
0644
edit
dl
rm
contacts.php
61254
0644
edit
dl
rm
cp.php
1557
0644
edit
dl
rm
customers.php
97
0644
edit
dl
rm
dashboard-alt.php
32
0644
edit
dl
rm
dashboard.php
36581
0644
edit
dl
rm
default.php
142
0644
edit
dl
rm
delete.php
9631
0644
edit
dl
rm
demo.php
689
0644
edit
dl
rm
documents.php
5493
0644
edit
dl
rm
editor.php
2149
0644
edit
dl
rm
export.php
4874
0644
edit
dl
rm
files.php
1243
0644
edit
dl
rm
generate.php
1468
0644
edit
dl
rm
help.php
381
0644
edit
dl
rm
ibtest.php
211
0644
edit
dl
rm
index.html
112
0644
edit
dl
rm
invoices.php
58182
0644
edit
dl
rm
iview.php
1410
0644
edit
dl
rm
jsonapi.php
4701
0644
edit
dl
rm
jsonexport.php
3312
0644
edit
dl
rm
legacy.php
25
0644
edit
dl
rm
login.php
6440
0644
edit
dl
rm
logout.php
80
0644
edit
dl
rm
orders.php
8846
0644
edit
dl
rm
plugins.php
426
0644
edit
dl
rm
ps.php
10016
0644
edit
dl
rm
quotes.php
39334
0644
edit
dl
rm
reorder.php
2404
0644
edit
dl
rm
reports.php
26227
0644
edit
dl
rm
search.php
2125
0644
edit
dl
rm
settings.php
110091
0644
edit
dl
rm
sys_imgcrop.php
3938
0644
edit
dl
rm
tags.php
1913
0644
edit
dl
rm
tax.php
5024
0644
edit
dl
rm
transactions.php
28561
0644
edit
dl
rm
update.php
1839
0644
edit
dl
rm
update_473.php
52763
0644
edit
dl
rm
util.php
18027
0644
edit
dl
rm
Edit:
/home/techb158/exp.abdallabala.com/application/controllers/export.php
(4874B)
<?php _auth(); $ui->assign('_title', $_L['Reports'] . '- ' . $config['CompanyName']); $ui->assign('_pagehead', '<i class="fa fa-bar-chart-o lblue"></i> Reports'); $ui->assign('_application_menu', 'reports'); $action = $routes['1']; $user = User::_info(); $ui->assign('user', $user); $mdate = date('Y-m-d'); $tdate = date('Y-m-d', strtotime('today - 30 days')); //first day of month $first_day_month = date('Y-m-01'); // $this_week_start = date('Y-m-d', strtotime('previous sunday')); // 30 days before $before_30_days = date('Y-m-d', strtotime('today - 30 days')); //this month $month_n = date('n'); switch ($action) { case 'printable': $fdate = _post('fdate'); $tdate = _post('tdate'); $account = _post('account'); $stype = _post('stype'); $d = ORM::for_table('sys_transactions'); $d->where('account', $account); if ($stype == 'credit') { $d->where('dr', '0.00'); } elseif ($stype == 'debit') { $d->where('cr', '0.00'); } else { } $d->where_gte('date', $fdate); $d->where_lte('date', $tdate); $d->order_by_desc('id'); $x = $d->find_many(); $ui->assign('d', $x); $ui->assign('fdate', $fdate); $ui->assign('tdate', $tdate); $ui->assign('account', $account); $ui->display('printable.tpl'); break; case 'pdf': $fdate = _post('fdate'); $tdate = _post('tdate'); $account = _post('account'); $stype = _post('stype'); $d = ORM::for_table('sys_transactions'); $d->where('account', $account); if ($stype == 'credit') { $d->where('dr', '0.00'); } elseif ($stype == 'debit') { $d->where('cr', '0.00'); } else { } $d->where_gte('date', $fdate); $d->where_lte('date', $tdate); $d->order_by_desc('id'); $x = $d->find_many(); $aadmin = $user['fullname']; // $filename= date('Y-m-d')._raid(4).'.pdf'; $title = $account . ' Statement [' . $fdate . ' - ' . $tdate . ']'; $title = str_replace('-', ' ', $title); if ($x) { $html = ' <h4 id="heading">' . $account . ' Statement [' . date($config['df'], strtotime($fdate)) . ' - ' . date($config['df'], strtotime($tdate)) . ']</h4> <table id="customers"> <tr> <th>' . $_L['Date'] . '</th> <th>' . $_L['Description'] . '</th> <th>' . $_L['Dr'] . '</th> <th>' . $_L['Cr'] . '</th> <th>' . $_L['Balance'] . '</th> </tr>'; $c = true; foreach ($x as $value) { // $date = $value['date']; $date = date($config['df'], strtotime($value['date'])); $description = $value['description']; $dr = $value['dr']; $cr = $value['cr']; $bal = $value['bal']; $html .= "<tr" . (($c = !$c) ? ' class="alt"' : ' class=""') . ">" . " <td>$date</td> <td>$description</td> <td>$dr</td> <td>$cr</td> <td>$bal</td> </tr>"; } $html .= '</table>'; $mpdf = new \Mpdf\Mpdf(); $mpdf->SetTitle($config['CompanyName'] . ' Statement'); $mpdf->SetAuthor($config['CompanyName']); $mpdf->SetWatermarkText($d['status']); $mpdf->showWatermarkText = true; $mpdf->watermark_font = 'Helvetica'; $mpdf->watermarkTextAlpha = 0.1; $mpdf->SetDisplayMode('fullpage'); $style = '<style> #heading { font-family: Helvetica, sans-serif; width:100%; border-collapse:collapse; } #customers { font-family: Helvetica, sans-serif; width:100%; border-collapse:collapse; } #customers td, #customers th { font-size:1.2em; border:1px solid #98bf21; padding:3px 7px 2px 7px; } #customers th { font-size:1.4em; text-align:left; padding-top:5px; padding-bottom:4px; background-color:#A7C942; color:#fff; } #customers tr.alt td { color:#000; background-color:#EAF2D3; } </style> '; $nhtml = <<<EOF $style $html EOF; $mpdf->WriteHTML($nhtml); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // reset pointer to the last page // --------------------------------------------------------- //Close and output PDF document $mpdf->Output(date('Y-m-d') . _raid(4) . '.pdf', 'D'); } else { echo 'No Data'; } break; default: echo 'action not defined'; }
Save
cmd:
run