lines.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. <?php
  2. /* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
  3. * Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
  4. * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
  5. * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
  6. * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. */
  21. /**
  22. * \file htdocs/accountancy/expensereport/lines.php
  23. * \ingroup Accountancy (Double entries)
  24. * \brief Page of detail of the lines of ventilation of expense reports
  25. */
  26. require '../../main.inc.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
  29. require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
  30. require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
  31. require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
  32. require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
  33. require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
  34. // Load translation files required by the page
  35. $langs->loadLangs(array("compta", "bills", "other", "accountancy", "trips", "productbatch", "hrm"));
  36. $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
  37. $account_parent = GETPOST('account_parent', 'int');
  38. $changeaccount = GETPOST('changeaccount');
  39. // Search Getpost
  40. $search_login = GETPOST('search_login', 'alpha');
  41. $search_expensereport = GETPOST('search_expensereport', 'alpha');
  42. $search_label = GETPOST('search_label', 'alpha');
  43. $search_desc = GETPOST('search_desc', 'alpha');
  44. $search_amount = GETPOST('search_amount', 'alpha');
  45. $search_account = GETPOST('search_account', 'alpha');
  46. $search_vat = GETPOST('search_vat', 'alpha');
  47. $search_date_startday = GETPOST('search_date_startday', 'int');
  48. $search_date_startmonth = GETPOST('search_date_startmonth', 'int');
  49. $search_date_startyear = GETPOST('search_date_startyear', 'int');
  50. $search_date_endday = GETPOST('search_date_endday', 'int');
  51. $search_date_endmonth = GETPOST('search_date_endmonth', 'int');
  52. $search_date_endyear = GETPOST('search_date_endyear', 'int');
  53. $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
  54. $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
  55. // Load variable for pagination
  56. $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
  57. $sortfield = GETPOST('sortfield', 'aZ09comma');
  58. $sortorder = GETPOST('sortorder', 'aZ09comma');
  59. $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
  60. if (empty($page) || $page < 0) {
  61. $page = 0;
  62. }
  63. $offset = $limit * $page;
  64. $pageprev = $page - 1;
  65. $pagenext = $page + 1;
  66. if (!$sortfield) {
  67. $sortfield = "erd.date, erd.rowid";
  68. }
  69. if (!$sortorder) {
  70. if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
  71. $sortorder = "DESC";
  72. } else {
  73. $sortorder = "ASC";
  74. }
  75. }
  76. // Security check
  77. if (!isModEnabled('accounting')) {
  78. accessforbidden();
  79. }
  80. if ($user->socid > 0) {
  81. accessforbidden();
  82. }
  83. if (empty($user->rights->accounting->mouvements->lire)) {
  84. accessforbidden();
  85. }
  86. $formaccounting = new FormAccounting($db);
  87. /*
  88. * Actions
  89. */
  90. // Purge search criteria
  91. if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
  92. $search_login = '';
  93. $search_expensereport = '';
  94. $search_label = '';
  95. $search_desc = '';
  96. $search_amount = '';
  97. $search_account = '';
  98. $search_vat = '';
  99. $search_date_startday = '';
  100. $search_date_startmonth = '';
  101. $search_date_startyear = '';
  102. $search_date_endday = '';
  103. $search_date_endmonth = '';
  104. $search_date_endyear = '';
  105. $search_date_start = '';
  106. $search_date_end = '';
  107. }
  108. if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->accounting->bind->write) {
  109. $error = 0;
  110. if (!(GETPOST('account_parent', 'int') >= 0)) {
  111. $error++;
  112. setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
  113. }
  114. if (!$error) {
  115. $db->begin();
  116. $sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd";
  117. $sql1 .= " SET erd.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
  118. $sql1 .= ' WHERE erd.rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')';
  119. dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= '.$sql1);
  120. $resql1 = $db->query($sql1);
  121. if (!$resql1) {
  122. $error++;
  123. setEventMessages($db->lasterror(), null, 'errors');
  124. }
  125. if (!$error) {
  126. $db->commit();
  127. setEventMessages($langs->trans("Save"), null, 'mesgs');
  128. } else {
  129. $db->rollback();
  130. setEventMessages($db->lasterror(), null, 'errors');
  131. }
  132. $account_parent = ''; // Protection to avoid to mass apply it a second time
  133. }
  134. }
  135. if (GETPOST('sortfield') == 'erd.date, erd.rowid') {
  136. $value = (GETPOST('sortorder') == 'asc,asc' ? 0 : 1);
  137. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  138. $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $value, 'yesno', 0, '', $conf->entity);
  139. }
  140. /*
  141. * View
  142. */
  143. $form = new Form($db);
  144. $formother = new FormOther($db);
  145. llxHeader('', $langs->trans("ExpenseReportsVentilation").' - '.$langs->trans("Dispatched"));
  146. print '<script type="text/javascript">
  147. $(function () {
  148. $(\'#select-all\').click(function(event) {
  149. // Iterate each checkbox
  150. $(\':checkbox\').each(function() {
  151. this.checked = true;
  152. });
  153. });
  154. $(\'#unselect-all\').click(function(event) {
  155. // Iterate each checkbox
  156. $(\':checkbox\').each(function() {
  157. this.checked = false;
  158. });
  159. });
  160. });
  161. </script>';
  162. /*
  163. * Expense reports lines
  164. */
  165. $sql = "SELECT er.ref, er.rowid as erid,";
  166. $sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht, erd.fk_code_ventilation, erd.tva_tx, erd.vat_src_code, erd.date,";
  167. $sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label,";
  168. $sql .= " u.rowid as userid, u.login, u.lastname, u.firstname, u.email, u.gender, u.employee, u.photo, u.statut,";
  169. $sql .= " aa.label, aa.labelshort, aa.account_number";
  170. $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as er";
  171. $sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport_det as erd ON er.rowid = erd.fk_expensereport";
  172. $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
  173. $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_fees as f ON f.id = erd.fk_c_type_fees";
  174. $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = er.fk_user_author";
  175. $sql .= " WHERE erd.fk_code_ventilation > 0";
  176. $sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
  177. $sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
  178. // Add search filter like
  179. if (strlen(trim($search_login))) {
  180. $sql .= natural_search("u.login", $search_login);
  181. }
  182. if (strlen(trim($search_expensereport))) {
  183. $sql .= natural_search("er.ref", $search_expensereport);
  184. }
  185. if (strlen(trim($search_label))) {
  186. $sql .= natural_search("f.label", $search_label);
  187. }
  188. if (strlen(trim($search_desc))) {
  189. $sql .= natural_search("er.comments", $search_desc);
  190. }
  191. if (strlen(trim($search_amount))) {
  192. $sql .= natural_search("erd.total_ht", $search_amount, 1);
  193. }
  194. if (strlen(trim($search_account))) {
  195. $sql .= natural_search("aa.account_number", $search_account);
  196. }
  197. if (strlen(trim($search_vat))) {
  198. $sql .= natural_search("erd.tva_tx", price2num($search_vat), 1);
  199. }
  200. if ($search_date_start) {
  201. $sql .= " AND erd.date >= '".$db->idate($search_date_start)."'";
  202. }
  203. if ($search_date_end) {
  204. $sql .= " AND erd.date <= '".$db->idate($search_date_end)."'";
  205. }
  206. $sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
  207. $sql .= $db->order($sortfield, $sortorder);
  208. // Count total nb of records
  209. $nbtotalofrecords = '';
  210. if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
  211. $result = $db->query($sql);
  212. $nbtotalofrecords = $db->num_rows($result);
  213. if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
  214. $page = 0;
  215. $offset = 0;
  216. }
  217. }
  218. $sql .= $db->plimit($limit + 1, $offset);
  219. dol_syslog("accountancy/expensereport/lines.php", LOG_DEBUG);
  220. $result = $db->query($sql);
  221. if ($result) {
  222. $num_lines = $db->num_rows($result);
  223. $i = 0;
  224. $param = '';
  225. if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
  226. $param .= '&contextpage='.urlencode($contextpage);
  227. }
  228. if ($limit > 0 && $limit != $conf->liste_limit) {
  229. $param .= '&limit='.((int) $limit);
  230. }
  231. if ($search_login) {
  232. $param .= '&search_login='.urlencode($search_login);
  233. }
  234. if ($search_expensereport) {
  235. $param .= "&search_expensereport=".urlencode($search_expensereport);
  236. }
  237. if ($search_label) {
  238. $param .= "&search_label=".urlencode($search_label);
  239. }
  240. if ($search_desc) {
  241. $param .= "&search_desc=".urlencode($search_desc);
  242. }
  243. if ($search_account) {
  244. $param .= "&search_account=".urlencode($search_account);
  245. }
  246. if ($search_vat) {
  247. $param .= "&search_vat=".urlencode($search_vat);
  248. }
  249. if ($search_date_startday) {
  250. $param .= '&search_date_startday='.urlencode($search_date_startday);
  251. }
  252. if ($search_date_startmonth) {
  253. $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
  254. }
  255. if ($search_date_startyear) {
  256. $param .= '&search_date_startyear='.urlencode($search_date_startyear);
  257. }
  258. if ($search_date_endday) {
  259. $param .= '&search_date_endday='.urlencode($search_date_endday);
  260. }
  261. if ($search_date_endmonth) {
  262. $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
  263. }
  264. if ($search_date_endyear) {
  265. $param .= '&search_date_endyear='.urlencode($search_date_endyear);
  266. }
  267. print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'."\n";
  268. print '<input type="hidden" name="action" value="ventil">';
  269. if ($optioncss != '') {
  270. print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
  271. }
  272. print '<input type="hidden" name="token" value="'.newToken().'">';
  273. print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
  274. print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
  275. print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
  276. print '<input type="hidden" name="page" value="'.$page.'">';
  277. print_barre_liste($langs->trans("ExpenseReportLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
  278. print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneExpenseReport").'</span><br>';
  279. print '<br><div class="inline-block divButAction paddingbottom">'.$langs->trans("ChangeAccount").' ';
  280. print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
  281. print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
  282. $moreforfilter = '';
  283. print '<div class="div-table-responsive">';
  284. print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
  285. print '<tr class="liste_titre_filter">';
  286. print '<td class="liste_titre"><input type="text" name="search_login" class="maxwidth50" value="'.$search_login.'"></td>';
  287. print '<td class="liste_titre"></td>';
  288. print '<td><input type="text" class="flat maxwidth50" name="search_expensereport" value="'.dol_escape_htmltag($search_expensereport).'"></td>';
  289. if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
  290. print '<td class="liste_titre"></td>';
  291. }
  292. print '<td class="liste_titre center">';
  293. print '<div class="nowrap">';
  294. print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
  295. print '</div>';
  296. print '<div class="nowrap">';
  297. print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
  298. print '</div>';
  299. print '</td>';
  300. print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
  301. print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
  302. print '<td class="liste_titre right"><input type="text" class="flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
  303. print '<td class="liste_titre center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" placeholder="%" value="'.dol_escape_htmltag($search_vat).'"></td>';
  304. print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="'.dol_escape_htmltag($search_account).'"></td>';
  305. print '<td class="liste_titre center">';
  306. $searchpicto = $form->showFilterButtons();
  307. print $searchpicto;
  308. print '</td>';
  309. print "</tr>\n";
  310. print '<tr class="liste_titre">';
  311. print_liste_field_titre("Employees", $_SERVER['PHP_SELF'], "u.login", $param, "", "", $sortfield, $sortorder);
  312. print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
  313. print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
  314. if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
  315. print_liste_field_titre("DateValidation", $_SERVER["PHP_SELF"], "er.date_valid", "", $param, '', $sortfield, $sortorder, 'center ');
  316. }
  317. print_liste_field_titre("DateOfLine", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
  318. print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
  319. print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
  320. print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
  321. print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, '', $sortfield, $sortorder, 'center ');
  322. print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
  323. $checkpicto = $form->showCheckAddButtons();
  324. print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
  325. print "</tr>\n";
  326. $expensereportstatic = new ExpenseReport($db);
  327. $accountingaccountstatic = new AccountingAccount($db);
  328. $userstatic = new User($db);
  329. $i = 0;
  330. while ($i < min($num_lines, $limit)) {
  331. $objp = $db->fetch_object($result);
  332. $expensereportstatic->ref = $objp->ref;
  333. $expensereportstatic->id = $objp->erid;
  334. $userstatic->id = $objp->userid;
  335. $userstatic->ref = $objp->label;
  336. $userstatic->login = $objp->login;
  337. $userstatic->statut = $objp->statut;
  338. $userstatic->email = $objp->email;
  339. $userstatic->gender = $objp->gender;
  340. $userstatic->firstname = $objp->firstname;
  341. $userstatic->lastname = $objp->lastname;
  342. $userstatic->employee = $objp->employee;
  343. $userstatic->photo = $objp->photo;
  344. $accountingaccountstatic->rowid = $objp->fk_compte;
  345. $accountingaccountstatic->label = $objp->label;
  346. $accountingaccountstatic->labelshort = $objp->labelshort;
  347. $accountingaccountstatic->account_number = $objp->account_number;
  348. print '<tr class="oddeven">';
  349. // Login
  350. print '<td class="nowraponall">';
  351. print $userstatic->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1);
  352. print '</td>';
  353. // Line id
  354. print '<td>'.$objp->rowid.'</td>';
  355. // Ref Expense report
  356. print '<td>'.$expensereportstatic->getNomUrl(1).'</td>';
  357. // Date validation
  358. if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
  359. print '<td class="center">'.dol_print_date($db->jdate($objp->date_valid), 'day').'</td>';
  360. }
  361. print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>';
  362. // Fees label
  363. print '<td class="tdoverflow">'.($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))).'</td>';
  364. // Fees description -- Can be null
  365. print '<td>';
  366. $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments, 1));
  367. $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
  368. print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
  369. print '</td>';
  370. // Amount without taxes
  371. print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
  372. // Vat rate
  373. print '<td class="center">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
  374. // Accounting account affected
  375. print '<td>';
  376. print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1);
  377. print ' <a class="editfielda reposition marginleftonly marginrightonly" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
  378. print img_edit();
  379. print '</a></td>';
  380. print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>';
  381. print "</tr>";
  382. $i++;
  383. }
  384. if ($num_lines == 0) {
  385. $colspan=10;
  386. if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
  387. $colspan++;
  388. }
  389. print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
  390. }
  391. print "</table>";
  392. print "</div>";
  393. if ($nbtotalofrecords > $limit) {
  394. print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);
  395. }
  396. print '</form>';
  397. } else {
  398. print $db->lasterror();
  399. }
  400. // End of page
  401. llxFooter();
  402. $db->close();