lines.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <?php
  2. /* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
  3. * Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
  4. * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
  5. * Copyright (C) 2014-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 <http://www.gnu.org/licenses/>.
  20. */
  21. /**
  22. * \file htdocs/accountancy/customer/lines.php
  23. * \ingroup Advanced accountancy
  24. * \brief Page of detail of the lines of ventilation of invoices customers
  25. */
  26. require '../../main.inc.php';
  27. require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
  28. require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
  29. require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
  30. require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
  31. require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
  32. require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
  33. require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
  34. // Load translation files required by the page
  35. $langs->loadLangs(array("bills","compta","accountancy","productbatch"));
  36. $account_parent = GETPOST('account_parent');
  37. $changeaccount = GETPOST('changeaccount');
  38. // Search Getpost
  39. $search_lineid = GETPOST('search_lineid', 'int');
  40. $search_ref = GETPOST('search_ref', 'alpha');
  41. $search_invoice = GETPOST('search_invoice', '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_day=GETPOST("search_day","int");
  48. $search_month=GETPOST("search_month","int");
  49. $search_year=GETPOST("search_year","int");
  50. $search_country = GETPOST('search_country', 'alpha');
  51. $search_tvaintra = GETPOST('search_tvaintra', 'alpha');
  52. // Load variable for pagination
  53. $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
  54. $sortfield = GETPOST('sortfield', 'alpha');
  55. $sortorder = GETPOST('sortorder', 'alpha');
  56. $page = GETPOST('page', 'int');
  57. if (empty($page) || $page < 0) $page = 0;
  58. $pageprev = $page - 1;
  59. $pagenext = $page + 1;
  60. $offset = $limit * $page;
  61. if (! $sortfield)
  62. $sortfield = "f.datef, f.ref, fd.rowid";
  63. if (! $sortorder) {
  64. if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
  65. $sortorder = "DESC";
  66. }
  67. }
  68. // Security check
  69. if ($user->societe_id > 0)
  70. accessforbidden();
  71. if (! $user->rights->accounting->bind->write)
  72. accessforbidden();
  73. $formaccounting = new FormAccounting($db);
  74. /*
  75. * Actions
  76. */
  77. // Purge search criteria
  78. if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
  79. {
  80. $search_lineid = '';
  81. $search_ref = '';
  82. $search_invoice = '';
  83. $search_label = '';
  84. $search_desc = '';
  85. $search_amount = '';
  86. $search_account = '';
  87. $search_vat = '';
  88. $search_day = '';
  89. $search_month = '';
  90. $search_year = '';
  91. $search_country = '';
  92. $search_tvaintra = '';
  93. }
  94. if (is_array($changeaccount) && count($changeaccount) > 0) {
  95. $error = 0;
  96. if (! (GETPOST('account_parent','int') >= 0))
  97. {
  98. $error++;
  99. setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
  100. }
  101. if (! $error)
  102. {
  103. $db->begin();
  104. $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l";
  105. $sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
  106. $sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
  107. dol_syslog('accountancy/customer/lines.php::changeaccount sql= ' . $sql1);
  108. $resql1 = $db->query($sql1);
  109. if (! $resql1) {
  110. $error ++;
  111. setEventMessages($db->lasterror(), null, 'errors');
  112. }
  113. if (! $error) {
  114. $db->commit();
  115. setEventMessages($langs->trans('Save'), null, 'mesgs');
  116. } else {
  117. $db->rollback();
  118. setEventMessages($db->lasterror(), null, 'errors');
  119. }
  120. $account_parent = ''; // Protection to avoid to mass apply it a second time
  121. }
  122. }
  123. /*
  124. * View
  125. */
  126. $form = new Form($db);
  127. $formother = new FormOther($db);
  128. llxHeader('', $langs->trans("CustomersVentilation") . ' - ' . $langs->trans("Dispatched"));
  129. print '<script type="text/javascript">
  130. $(function () {
  131. $(\'#select-all\').click(function(event) {
  132. // Iterate each checkbox
  133. $(\':checkbox\').each(function() {
  134. this.checked = true;
  135. });
  136. });
  137. $(\'#unselect-all\').click(function(event) {
  138. // Iterate each checkbox
  139. $(\':checkbox\').each(function() {
  140. this.checked = false;
  141. });
  142. });
  143. });
  144. </script>';
  145. /*
  146. * Customer Invoice lines
  147. */
  148. $sql = "SELECT f.rowid as facid, f.ref as ref, f.type, f.datef, f.ref_client,";
  149. $sql.= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
  150. $sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
  151. $sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
  152. $sql.= " fd.situation_percent,";
  153. $sql.= " co.code as country_code, co.label as country,";
  154. $sql.= " s.tva_intra";
  155. $parameters=array();
  156. $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
  157. $sql.=$hookmanager->resPrint;
  158. $sql.= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
  159. $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
  160. $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
  161. $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
  162. $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
  163. $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
  164. $sql.= " WHERE fd.fk_code_ventilation > 0";
  165. $sql.= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy
  166. $sql.= " AND f.fk_statut > 0";
  167. if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
  168. $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
  169. } else {
  170. $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
  171. }
  172. if ($search_lineid) {
  173. $sql .= natural_search("fd.rowid", $search_lineid, 1);
  174. }
  175. if (strlen(trim($search_invoice))) {
  176. $sql .= natural_search("f.ref", $search_invoice);
  177. }
  178. if (strlen(trim($search_ref))) {
  179. $sql .= natural_search("p.ref", $search_ref);
  180. }
  181. if (strlen(trim($search_label))) {
  182. $sql .= natural_search("p.label", $search_label);
  183. }
  184. if (strlen(trim($search_desc))) {
  185. $sql .= natural_search("fd.description", $search_desc);
  186. }
  187. if (strlen(trim($search_amount))) {
  188. $sql .= natural_search("fd.total_ht", $search_amount, 1);
  189. }
  190. if (strlen(trim($search_account))) {
  191. $sql .= natural_search("aa.account_number", $search_account);
  192. }
  193. if (strlen(trim($search_vat))) {
  194. $sql .= natural_search("fd.tva_tx", price2num($search_vat), 1);
  195. }
  196. if ($search_month > 0)
  197. {
  198. if ($search_year > 0 && empty($search_day))
  199. $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
  200. elseif ($search_year > 0 && ! empty($search_day))
  201. $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
  202. else
  203. $sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
  204. }
  205. elseif ($search_year > 0)
  206. {
  207. $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
  208. }
  209. if (strlen(trim($search_country))) {
  210. $arrayofcode = getCountriesInEEC();
  211. $country_code_in_EEC = $country_code_in_EEC_without_me = '';
  212. foreach ($arrayofcode as $key => $value)
  213. {
  214. $country_code_in_EEC.=($country_code_in_EEC ? "," : "")."'".$value."'";
  215. if ($value != $mysoc->country_code) $country_code_in_EEC_without_me.=($country_code_in_EEC_without_me ? "," : "")."'".$value."'";
  216. }
  217. if ($search_country == 'special_allnotme') $sql .= " AND co.code <> '".$db->escape($mysoc->country_code)."'";
  218. elseif ($search_country == 'special_eec') $sql .= " AND co.code IN (".$country_code_in_EEC.")";
  219. elseif ($search_country == 'special_eecnotme') $sql .= " AND co.code IN (".$country_code_in_EEC_without_me.")";
  220. elseif ($search_country == 'special_noteec') $sql .= " AND co.code NOT IN (".$country_code_in_EEC.")";
  221. else $sql .= natural_search(array("co.code","co.label"), $search_country);
  222. }
  223. if (strlen(trim($search_tvaintra))) {
  224. $sql .= natural_search("s.tva_intra", $search_tvaintra);
  225. }
  226. $sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy
  227. $sql .= $db->order($sortfield, $sortorder);
  228. // Count total nb of records
  229. $nbtotalofrecords = '';
  230. if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
  231. {
  232. $result = $db->query($sql);
  233. $nbtotalofrecords = $db->num_rows($result);
  234. if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
  235. {
  236. $page = 0;
  237. $offset = 0;
  238. }
  239. }
  240. $sql .= $db->plimit($limit + 1, $offset);
  241. dol_syslog("/accountancy/customer/lines.php", LOG_DEBUG);
  242. $result = $db->query($sql);
  243. if ($result) {
  244. $num_lines = $db->num_rows($result);
  245. $i = 0;
  246. $param='';
  247. if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
  248. if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
  249. if ($search_invoice) $param .= "&search_invoice=" . urlencode($search_invoice);
  250. if ($search_ref) $param .= "&search_ref=" . urlencode($search_ref);
  251. if ($search_label) $param .= "&search_label=" . urlencode($search_label);
  252. if ($search_desc) $param .= "&search_desc=" . urlencode($search_desc);
  253. if ($search_account) $param .= "&search_account=" . urlencode($search_account);
  254. if ($search_vat) $param .= "&search_vat=" . urlencode($search_vat);
  255. if ($search_day) $param .= '&search_day='.urlencode($search_day);
  256. if ($search_month) $param .= '&search_month='.urlencode($search_month);
  257. if ($search_year) $param .= '&search_year='.urlencode($search_year);
  258. if ($search_country) $param .= "&search_country=" . urlencode($search_country);
  259. if ($search_tvaintra) $param .= "&search_tvaintra=" . urlencode($search_tvaintra);
  260. print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
  261. print '<input type="hidden" name="action" value="ventil">';
  262. if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
  263. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  264. print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
  265. print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
  266. print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
  267. print '<input type="hidden" name="page" value="'.$page.'">';
  268. print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
  269. print $langs->trans("DescVentilDoneCustomer") . '<br>';
  270. print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
  271. print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
  272. print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '"/></div>';
  273. $moreforfilter = '';
  274. print '<div class="div-table-responsive">';
  275. print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
  276. print '<tr class="liste_titre_filter">';
  277. print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
  278. print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
  279. print '<td class="liste_titre center nowraponall">';
  280. if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
  281. print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
  282. $formother->select_year($search_year,'search_year',1, 20, 5);
  283. print '</td>';
  284. print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
  285. //print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
  286. print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
  287. print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
  288. print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
  289. print '<td class="liste_titre">';
  290. print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1);
  291. //print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
  292. print '</td>';
  293. print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
  294. print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
  295. print '<td class="liste_titre" align="center">';
  296. $searchpicto=$form->showFilterButtons();
  297. print $searchpicto;
  298. print "</td></tr>\n";
  299. print '<tr class="liste_titre">';
  300. print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "fd.rowid", "", $param, '', $sortfield, $sortorder);
  301. print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
  302. print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, fd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
  303. print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
  304. //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
  305. print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
  306. print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
  307. print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
  308. print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
  309. print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
  310. print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
  311. $clickpicto=$form->showCheckAddButtons();
  312. print_liste_field_titre($clickpicto, '', '', '', '', 'align="center"');
  313. print "</tr>\n";
  314. $facture_static = new Facture($db);
  315. $product_static = new Product($db);
  316. while ( $objp = $db->fetch_object($result) ) {
  317. $codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte;
  318. $facture_static->ref = $objp->ref;
  319. $facture_static->id = $objp->facid;
  320. $facture_static->type = $objp->ftype;
  321. $product_static->ref = $objp->product_ref;
  322. $product_static->id = $objp->product_id;
  323. $product_static->label = $objp->product_label;
  324. $product_static->type = $objp->line_type;
  325. print '<tr class="oddeven">';
  326. // Line id
  327. print '<td>' . $objp->rowid . '</td>';
  328. // Ref Invoice
  329. print '<td class="nowraponall">' . $facture_static->getNomUrl(1) . '</td>';
  330. print '<td align="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
  331. // Ref Product
  332. print '<td>';
  333. if ($product_static->id)
  334. print $product_static->getNomUrl(1);
  335. if ($objp->product_label) print '<br>'.$objp->product_label;
  336. print '</td>';
  337. print '<td class="tdoverflowonsmartphone">';
  338. $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
  339. $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
  340. print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description);
  341. print '</td>';
  342. print '<td class="right">' . price($objp->total_ht) . '</td>';
  343. print '<td class="right">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';
  344. print '<td>' . $langs->trans("Country".$objp->country_code) .' ('.$objp->country_code.')</td>';
  345. print '<td>' . $objp->tva_intra . '</td>';
  346. print '<td align="center">';
  347. print $codecompta . ' <a href="./card.php?id=' . $objp->rowid . '&backtopage='.urlencode($_SERVER["PHP_SELF"].($param?'?'.$param:'')).'">';
  348. print img_edit();
  349. print '</a>';
  350. print '</td>';
  351. print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->rowid . '"/></td>';
  352. print "</tr>";
  353. $i ++;
  354. }
  355. print "</table>";
  356. print "</div>";
  357. if ($nbtotalofrecords > $limit) {
  358. print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);
  359. }
  360. print '</form>';
  361. } else {
  362. print $db->lasterror();
  363. }
  364. // End of page
  365. llxFooter();
  366. $db->close();