$to = 0; } } elseif ($SESSION->is_set('doclto')) { $SESSION->restore('doclto', $to); } else { $to = 0; } $SESSION->save('doclto', $to); if (!isset($_GET['s'])) { $SESSION->restore('docls', $s); } else { $s = $_GET['s']; } $SESSION->save('docls', $s); } $documentlist = GetDocumentList($o, array('type' => $t, 'customer' => $c, 'numberplan' => $p, 'from' => $from, 'to' => $to, 'status' => $s)); $listdata['total'] = $documentlist['total']; $listdata['order'] = $documentlist['order']; $listdata['direction'] = $documentlist['direction']; $listdata['type'] = $t; $listdata['customer'] = $c; $listdata['numberplan'] = $p; $listdata['from'] = $from; $listdata['to'] = $to; $listdata['status'] = $s; unset($documentlist['total']); unset($documentlist['order']); unset($documentlist['direction']); $pagelimit = ConfigHelper::getConfig('phpui.documentlist_pagelimit'); $page = !isset($_GET['page']) ? ceil($listdata['total'] / $pagelimit) : intval($_GET['page']); $start = ($page - 1) * $pagelimit;
$SESSION->save('doclfrom', $from); if (isset($_GET['to'])) { if ($_GET['to'] != '') { list($year, $month, $day) = explode('/', $_GET['to']); $to = mktime(23, 59, 59, $month, $day, $year); } else { $to = 0; } } elseif ($SESSION->is_set('doclto')) { $SESSION->restore('doclto', $to); } else { $to = 0; } $SESSION->save('doclto', $to); } $documentlist = GetDocumentList($o, $t, $c, $p, $from, $to); $listdata['total'] = $documentlist['total']; $listdata['order'] = $documentlist['order']; $listdata['direction'] = $documentlist['direction']; $listdata['type'] = $t; $listdata['customer'] = $c; $listdata['numberplan'] = $p; $listdata['from'] = $from; $listdata['to'] = $to; unset($documentlist['total']); unset($documentlist['order']); unset($documentlist['direction']); $pagelimit = ConfigHelper::getConfig('phpui.documentlist_pagelimit'); $page = !isset($_GET['page']) ? ceil($listdata['total'] / $pagelimit) : intval($_GET['page']); $start = ($page - 1) * $pagelimit; $layout['pagetitle'] = trans('Documents List');