/home/techb158/exp.abdallabala.com/application/controllers
NameSizeModeActions
.DS_Store61480644editdlrm
accounts.php77290644editdlrm
admin.php67330644editdlrm
ajax.date-summary.php37960644editdlrm
ajax.expense-calendar.php10310644editdlrm
ajax.income-calendar.php9970644editdlrm
api.php75950644editdlrm
appearance.php20290644editdlrm
autologin.php15990644editdlrm
board.php9890644editdlrm
calendar.php49490644editdlrm
client.php630190644editdlrm
clx_api.php431780644editdlrm
console.php57000644editdlrm
contacts.php612540644editdlrm
cp.php15570644editdlrm
customers.php970644editdlrm
dashboard-alt.php320644editdlrm
dashboard.php365810644editdlrm
default.php1420644editdlrm
delete.php96310644editdlrm
demo.php6890644editdlrm
documents.php54930644editdlrm
editor.php21490644editdlrm
export.php48740644editdlrm
files.php12430644editdlrm
generate.php14680644editdlrm
help.php3810644editdlrm
ibtest.php2110644editdlrm
index.html1120644editdlrm
invoices.php581820644editdlrm
iview.php14100644editdlrm
jsonapi.php47010644editdlrm
jsonexport.php33120644editdlrm
legacy.php250644editdlrm
login.php64400644editdlrm
logout.php800644editdlrm
orders.php88460644editdlrm
plugins.php4260644editdlrm
ps.php100160644editdlrm
quotes.php393340644editdlrm
reorder.php24040644editdlrm
reports.php262270644editdlrm
search.php21250644editdlrm
settings.php1100910644editdlrm
sys_imgcrop.php39380644editdlrm
tags.php19130644editdlrm
tax.php50240644editdlrm
transactions.php285610644editdlrm
update.php18390644editdlrm
update_473.php527630644editdlrm
util.php180270644editdlrm
Edit: /home/techb158/exp.abdallabala.com/application/controllers/export.php (4874B)
assign('_title', $_L['Reports'] . '- ' . $config['CompanyName']); $ui->assign('_pagehead', ' 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 = '

' . $account . ' Statement [' . date($config['df'], strtotime($fdate)) . ' - ' . date($config['df'], strtotime($tdate)) . ']

'; $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 .= "" . " "; } $html .= '
' . $_L['Date'] . ' ' . $_L['Description'] . ' ' . $_L['Dr'] . ' ' . $_L['Cr'] . ' ' . $_L['Balance'] . '
$date $description $dr $cr $bal
'; $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 = ' '; $nhtml = <<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'; }