lines.php 19 KB

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