list.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <?php
  2. /* Copyright (C) 2014-2023 Alexandre Spangaro <aspangaro@open-dsi.fr>
  3. * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
  4. * Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
  5. * Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file htdocs/loan/list.php
  22. * \ingroup loan
  23. * \brief Page to list all loans
  24. */
  25. // Load Dolibarr environment
  26. require '../main.inc.php';
  27. require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
  28. // Load translation files required by the page
  29. $langs->loadLangs(array("banks", "bills", "compta", "loan"));
  30. // Get parameters
  31. $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
  32. $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
  33. $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
  34. $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
  35. $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
  36. $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
  37. $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
  38. $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
  39. $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
  40. $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
  41. $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
  42. $sortfield = GETPOST('sortfield', 'aZ09comma');
  43. $sortorder = GETPOST('sortorder', 'aZ09comma');
  44. $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
  45. if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
  46. // If $page is not defined, or '' or -1 or if we click on clear filters
  47. $page = 0;
  48. }
  49. $offset = $limit * $page;
  50. $pageprev = $page - 1;
  51. $pagenext = $page + 1;
  52. // Initialize technical objects
  53. $object = new Loan($db);
  54. $extrafields = new ExtraFields($db);
  55. $diroutputmassaction = $conf->loan->dir_output.'/temp/massgeneration/'.$user->id;
  56. $hookmanager->initHooks(array($contextpage));
  57. // Fetch optionals attributes and labels
  58. $extrafields->fetch_name_optionals_label($object->table_element);
  59. //$extrafields->fetch_name_optionals_label($object->table_element_line);
  60. $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
  61. // Default sort order (if not yet defined by previous GETPOST)
  62. if (!$sortfield) {
  63. $sortfield = "l.rowid";
  64. }
  65. if (!$sortorder) {
  66. $sortorder = "DESC";
  67. }
  68. // Definition of array of fields for columns
  69. $arrayfields = array();
  70. foreach ($object->fields as $key => $val) {
  71. // If $val['visible']==0, then we never show the field
  72. if (!empty($val['visible'])) {
  73. $visible = (int) dol_eval($val['visible'], 1);
  74. $arrayfields['t.'.$key] = array(
  75. 'label'=>$val['label'],
  76. 'checked'=>(($visible < 0) ? 0 : 1),
  77. 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)),
  78. 'position'=>$val['position'],
  79. 'help'=> isset($val['help']) ? $val['help'] : ''
  80. );
  81. }
  82. }
  83. // Extra fields
  84. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
  85. $object->fields = dol_sort_array($object->fields, 'position');
  86. //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
  87. $arrayfields = dol_sort_array($arrayfields, 'position');
  88. $search_ref = GETPOST('search_ref', 'int');
  89. $search_label = GETPOST('search_label', 'alpha');
  90. $search_amount = GETPOST('search_amount', 'alpha');
  91. $permissiontoadd = $user->hasRight('loan', 'write');
  92. // Security check
  93. $socid = GETPOST('socid', 'int');
  94. if ($user->socid) {
  95. $socid = $user->socid;
  96. }
  97. $result = restrictedArea($user, 'loan', '', '', '');
  98. /*
  99. * Actions
  100. */
  101. if (GETPOST('cancel', 'alpha')) {
  102. $action = 'list';
  103. $massaction = '';
  104. }
  105. if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
  106. $massaction = '';
  107. }
  108. $parameters = array();
  109. $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
  110. if ($reshook < 0) {
  111. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  112. }
  113. if (empty($reshook)) {
  114. // Purge search criteria
  115. 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
  116. $search_ref = "";
  117. $search_label = "";
  118. $search_amount = "";
  119. }
  120. }
  121. /*
  122. * View
  123. */
  124. $form = new Form($db);
  125. $now = dol_now();
  126. $help_url="EN:Module_Loan|FR:Module_Emprunt";
  127. $help_url = '';
  128. $title = $langs->trans('Loans');
  129. // Build and execute select
  130. // --------------------------------------------------------------------
  131. $sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.paid,";
  132. $sql .= " SUM(pl.amount_capital) as alreadypaid";
  133. $sqlfields = $sql; // $sql fields to remove for count total
  134. $sql .= " FROM ".MAIN_DB_PREFIX."loan as l";
  135. $linktopl = " LEFT JOIN ".MAIN_DB_PREFIX."payment_loan AS pl ON l.rowid = pl.fk_loan";
  136. $sql .= $linktopl;
  137. $sql .= " WHERE l.entity = ".$conf->entity;
  138. if ($search_amount) {
  139. $sql .= natural_search("l.capital", $search_amount, 1);
  140. }
  141. if ($search_ref) {
  142. $sql .= " AND l.rowid = ".((int) $search_ref);
  143. }
  144. if ($search_label) {
  145. $sql .= natural_search("l.label", $search_label);
  146. }
  147. $sql .= " GROUP BY l.rowid, l.label, l.capital, l.paid, l.datestart, l.dateend";
  148. // Count total nb of records
  149. $nbtotalofrecords = '';
  150. if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
  151. /* The fast and low memory method to get and count full list converts the sql into a sql count */
  152. $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
  153. $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
  154. $resql = $db->query($sqlforcount);
  155. if ($resql) {
  156. $objforcount = $db->fetch_object($resql);
  157. $nbtotalofrecords = $objforcount->nbtotalofrecords;
  158. } else {
  159. dol_print_error($db);
  160. }
  161. if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
  162. $page = 0;
  163. $offset = 0;
  164. }
  165. $db->free($resql);
  166. }
  167. // Complete request and execute it with limit
  168. $sql .= $db->order($sortfield, $sortorder);
  169. if ($limit) {
  170. $sql .= $db->plimit($limit + 1, $offset);
  171. }
  172. $resql = $db->query($sql);
  173. if (!$resql) {
  174. dol_print_error($db);
  175. exit;
  176. }
  177. $num = $db->num_rows($resql);
  178. // Direct jump if only one record found
  179. if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
  180. $obj = $db->fetch_object($resql);
  181. $id = $obj->rowid;
  182. header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.((int) $id));
  183. exit;
  184. }
  185. // Output page
  186. // --------------------------------------------------------------------
  187. llxHeader('', $title, $help_url);
  188. $arrayofselected = is_array($toselect) ? $toselect : array();
  189. $param = '';
  190. if (!empty($mode)) {
  191. $param .= '&mode='.urlencode($mode);
  192. }
  193. if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
  194. $param .= '&contextpage='.urlencode($contextpage);
  195. }
  196. if ($limit > 0 && $limit != $conf->liste_limit) {
  197. $param .= '&limit='.((int) $limit);
  198. }
  199. if ($optioncss != '') {
  200. $param .= '&optioncss='.urlencode($optioncss);
  201. }
  202. if ($search_ref) {
  203. $param .= "&search_ref=".urlencode($search_ref);
  204. }
  205. if ($search_label) {
  206. $param .= "&search_label=".urlencode($search_label);
  207. }
  208. if ($search_amount) {
  209. $param .= "&search_amount=".urlencode($search_amount);
  210. }
  211. // Add $param from extra fields
  212. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
  213. // Add $param from hooks
  214. $parameters = array();
  215. $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  216. $param .= $hookmanager->resPrint;
  217. // List of mass actions available
  218. $arrayofmassactions = array();
  219. if (!empty($permissiontodelete)) {
  220. $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
  221. }
  222. if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
  223. $arrayofmassactions = array();
  224. }
  225. $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
  226. $url = DOL_URL_ROOT.'/loan/card.php?action=create';
  227. if (!empty($socid)) {
  228. $url .= '&socid='.$socid;
  229. }
  230. $newcardbutton = '';
  231. $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
  232. $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
  233. $newcardbutton .= dolGetButtonTitleSeparator();
  234. $newcardbutton .= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
  235. $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
  236. print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
  237. if ($optioncss != '') {
  238. print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
  239. }
  240. print '<input type="hidden" name="token" value="'.newToken().'">';
  241. print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
  242. print '<input type="hidden" name="action" value="list">';
  243. print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
  244. print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
  245. print '<input type="hidden" name="page" value="'.$page.'">';
  246. print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
  247. print '<input type="hidden" name="page_y" value="">';
  248. print '<input type="hidden" name="mode" value="'.$mode.'">';
  249. $newcardbutton = '';
  250. $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
  251. $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
  252. $newcardbutton .= dolGetButtonTitleSeparator();
  253. $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/loan/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
  254. print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'money-bill-alt', 0, $newcardbutton, '', $limit, 0, 0, 1);
  255. $moreforfilter = '';
  256. $parameters = array();
  257. $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  258. if (empty($reshook)) {
  259. $moreforfilter .= $hookmanager->resPrint;
  260. } else {
  261. $moreforfilter = $hookmanager->resPrint;
  262. }
  263. if (!empty($moreforfilter)) {
  264. print '<div class="liste_titre liste_titre_bydiv centpercent">';
  265. print $moreforfilter;
  266. $parameters = array();
  267. $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  268. print $hookmanager->resPrint;
  269. print '</div>';
  270. }
  271. $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
  272. $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
  273. $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
  274. print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
  275. print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
  276. // Fields title search
  277. // --------------------------------------------------------------------
  278. print '<tr class="liste_titre_filter">';
  279. // Action column
  280. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  281. print '<td class="liste_titre center maxwidthsearch">';
  282. $searchpicto = $form->showFilterButtons('left');
  283. print $searchpicto;
  284. print '</td>';
  285. }
  286. // Filter: Ref
  287. print '<td class="liste_titre"><input class="flat" size="4" type="text" name="search_ref" value="'.$search_ref.'"></td>';
  288. // Filter: Label
  289. print '<td class="liste_titre"><input class="flat" size="12" type="text" name="search_label" value="'.$search_label.'"></td>';
  290. // Filter: Amount
  291. print '<td class="liste_titre right" ><input class="flat" size="8" type="text" name="search_amount" value="'.$search_amount.'"></td>';
  292. // No filter: Date start
  293. print '<td class="liste_titre">&nbsp;</td>';
  294. // No filter: Date end
  295. print '<td class="liste_titre">&nbsp;</td>';
  296. // No filter: Status
  297. print '<td class="liste_titre"></td>';
  298. // Action column
  299. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  300. print '<td class="liste_titre center maxwidthsearch">';
  301. $searchpicto = $form->showFilterButtons();
  302. print $searchpicto;
  303. print '</td>';
  304. }
  305. print '</tr>'."\n";
  306. $totalarray = array();
  307. $totalarray['nbfield'] = 0;
  308. // Fields title label
  309. // --------------------------------------------------------------------
  310. print '<tr class="liste_titre">';
  311. // Action column
  312. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  313. print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
  314. $totalarray['nbfield']++;
  315. }
  316. print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "l.rowid", "", $param, "", $sortfield, $sortorder);
  317. $totalarray['nbfield']++;
  318. print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "l.label", "", $param, '', $sortfield, $sortorder, 'left ');
  319. $totalarray['nbfield']++;
  320. print_liste_field_titre("LoanCapital", $_SERVER["PHP_SELF"], "l.capital", "", $param, '', $sortfield, $sortorder, 'right ');
  321. $totalarray['nbfield']++;
  322. print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, '', $sortfield, $sortorder, 'center ');
  323. $totalarray['nbfield']++;
  324. print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, '', $sortfield, $sortorder, 'center ');
  325. $totalarray['nbfield']++;
  326. print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, '', $sortfield, $sortorder, 'right ');
  327. $totalarray['nbfield']++;
  328. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  329. print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
  330. $totalarray['nbfield']++;
  331. }
  332. print "</tr>\n";
  333. // Loop on record
  334. // --------------------------------------------------------------------
  335. $i = 0;
  336. $savnbfield = $totalarray['nbfield'];
  337. $totalarray = array();
  338. $totalarray['nbfield'] = 0;
  339. $imaxinloop = ($limit ? min($num, $limit) : $num);
  340. while ($i < $imaxinloop) {
  341. $obj = $db->fetch_object($resql);
  342. if (empty($obj)) {
  343. break; // Should not happen
  344. }
  345. $object->id = $obj->rowid;
  346. $object->ref = $obj->rowid;
  347. $object->label = $obj->label;
  348. $object->paid = $obj->paid;
  349. if ($mode == 'kanban') {
  350. if ($i == 0) {
  351. print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
  352. print '<div class="box-flex-container kanban">';
  353. }
  354. // Output Kanban
  355. $object->datestart= $obj->datestart;
  356. $object->dateend = $obj->dateend;
  357. $object->capital = $obj->capital;
  358. $object->totalpaid = $obj->paid;
  359. // Output Kanban
  360. $selected = -1;
  361. if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
  362. $selected = 0;
  363. if (in_array($object->id, $arrayofselected)) {
  364. $selected = 1;
  365. }
  366. }
  367. print $object->getKanbanView('', array('selected' => $selected));
  368. if ($i == ($imaxinloop - 1)) {
  369. print '</div>';
  370. print '</td></tr>';
  371. }
  372. } else {
  373. // Show line of result
  374. $j = 0;
  375. print '<tr data-rowid="'.$object->id.'" class="oddeven">';
  376. // Action column
  377. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  378. print '<td></td>';
  379. }
  380. // Ref
  381. print '<td>'.$object->getNomUrl(1).'</td>';
  382. // Label
  383. print '<td>'.dol_trunc($obj->label, 42).'</td>';
  384. // Capital
  385. print '<td class="right maxwidth100"><span class="amount">'.price($obj->capital).'</span></td>';
  386. // Date start
  387. print '<td class="center width100">'.dol_print_date($db->jdate($obj->datestart), 'day').'</td>';
  388. // Date end
  389. print '<td class="center width100">'.dol_print_date($db->jdate($obj->dateend), 'day').'</td>';
  390. print '<td class="right nowrap">';
  391. print $object->LibStatut($obj->paid, 5, $obj->alreadypaid);
  392. print '</td>';
  393. // Action column
  394. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  395. print '<td></td>';
  396. }
  397. print '</tr>'."\n";
  398. }
  399. $i++;
  400. }
  401. // If no record found
  402. if ($num == 0) {
  403. $colspan = 7;
  404. //foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
  405. print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
  406. }
  407. $db->free($resql);
  408. $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
  409. $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  410. print $hookmanager->resPrint;
  411. print '</table>'."\n";
  412. print '</div>'."\n";
  413. print '</form>'."\n";
  414. // End of page
  415. llxFooter();
  416. $db->close();