list.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. <?php
  2. /* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
  3. * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
  4. * Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
  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 <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. /**
  22. * \file htdocs/accountancy/bookkeeping/list.php
  23. * \ingroup Advanced accountancy
  24. * \brief List operation of book keeping
  25. */
  26. require '../../main.inc.php';
  27. // Class
  28. require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
  29. require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
  30. require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
  31. require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
  32. require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
  33. // Langs
  34. $langs->load("accountancy");
  35. $page = GETPOST("page");
  36. $sortorder = GETPOST("sortorder");
  37. $sortfield = GETPOST("sortfield");
  38. $action = GETPOST('action', 'alpha');
  39. $search_mvt_num = GETPOST('search_mvt_num', 'int');
  40. $search_doc_type = GETPOST("search_doc_type");
  41. $search_doc_ref = GETPOST("search_doc_ref");
  42. $search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
  43. $search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
  44. $search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
  45. if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt")) {
  46. $action = 'delbookkeepingyear';
  47. }
  48. if (GETPOST("button_export_csv_x") || GETPOST("button_export_csv")) {
  49. $action = 'export_csv';
  50. }
  51. $search_accountancy_code = GETPOST("search_accountancy_code");
  52. $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
  53. if ($search_accountancy_code_start == - 1) {
  54. $search_accountancy_code_start = '';
  55. }
  56. $search_accountancy_code_end = GETPOST('search_accountancy_code_end', 'alpha');
  57. if ($search_accountancy_code_end == - 1) {
  58. $search_accountancy_code_end = '';
  59. }
  60. $search_accountancy_aux_code = GETPOST("search_accountancy_aux_code");
  61. $search_accountancy_aux_code_start = GETPOST('search_accountancy_aux_code_start', 'alpha');
  62. if ($search_accountancy_aux_code_start == - 1) {
  63. $search_accountancy_aux_code_start = '';
  64. }
  65. $search_accountancy_aux_code_end = GETPOST('search_accountancy_aux_code_end', 'alpha');
  66. if ($search_accountancy_aux_code_end == - 1) {
  67. $search_accountancy_aux_code_end = '';
  68. }
  69. $search_mvt_label = GETPOST('search_mvt_label', 'alpha');
  70. $search_direction = GETPOST('search_direction', 'alpha');
  71. $search_ledger_code = GETPOST('search_ledger_code', 'alpha');
  72. // Load variable for pagination
  73. $limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
  74. $sortfield = GETPOST('sortfield', 'alpha');
  75. $sortorder = GETPOST('sortorder', 'alpha');
  76. $page = GETPOST('page','int');
  77. if ($page < 0) { $page = 0; }
  78. $offset = $limit * $page;
  79. $pageprev = $page - 1;
  80. $pagenext = $page + 1;
  81. if ($sortorder == "") $sortorder = "ASC";
  82. if ($sortfield == "") $sortfield = "t.rowid";
  83. $object = new BookKeeping($db);
  84. $formaccounting = new FormAccounting($db);
  85. $formother = new FormOther($db);
  86. $form = new Form($db);
  87. if ($action != 'export_csv' && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction'])) {
  88. $search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
  89. $search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));
  90. }
  91. /*
  92. * Action
  93. */
  94. if (GETPOST('cancel')) { $action='list'; $massaction=''; }
  95. if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
  96. if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
  97. {
  98. $search_mvt_num = '';
  99. $search_doc_type = '';
  100. $search_doc_ref = '';
  101. $search_doc_date = '';
  102. $search_accountancy_code = '';
  103. $search_accountancy_code_start = '';
  104. $search_accountancy_code_end = '';
  105. $search_accountancy_aux_code = '';
  106. $search_accountancy_aux_code_start = '';
  107. $search_accountancy_aux_code_end = '';
  108. $search_mvt_label = '';
  109. $search_direction = '';
  110. $search_ledger_code = '';
  111. $search_date_start = '';
  112. $search_date_end = '';
  113. }
  114. // Must be after the remove filter action, before the export.
  115. $param = '';
  116. $filter = array ();
  117. if (! empty($search_date_start)) {
  118. $filter['t.doc_date>='] = $search_date_start;
  119. $tmp=dol_getdate($search_date_start);
  120. $param .= '&date_startmonth=' . $tmp['mon'] . '&date_startday=' . $tmp['mday'] . '&date_startyear=' . $tmp['year'];
  121. }
  122. if (! empty($search_date_end)) {
  123. $filter['t.doc_date<='] = $search_date_end;
  124. $tmp=dol_getdate($search_date_end);
  125. $param .= '&date_endmonth=' . $tmp['mon'] . '&date_endday=' . $tmp['mday'] . '&date_endyear=' . $tmp['year'];
  126. }
  127. if (! empty($search_doc_date)) {
  128. $filter['t.doc_date'] = $search_doc_date;
  129. $tmp=dol_getdate($search_doc_date);
  130. $param .= '&doc_datemonth=' . $tmp['mon'] . '&doc_dateday=' . $tmp['mday'] . '&doc_dateyear=' . $tmp['year'];
  131. }
  132. if (! empty($search_doc_type)) {
  133. $filter['t.doc_type'] = $search_doc_type;
  134. $param .= '&search_doc_type=' . $search_doc_type;
  135. }
  136. if (! empty($search_doc_ref)) {
  137. $filter['t.doc_ref'] = $search_doc_ref;
  138. $param .= '&search_doc_ref=' . $search_doc_ref;
  139. }
  140. if (! empty($search_accountancy_code)) {
  141. $filter['t.numero_compte'] = $search_accountancy_code;
  142. $param .= '&search_accountancy_code=' . $search_accountancy_code;
  143. }
  144. if (! empty($search_accountancy_code_start)) {
  145. $filter['t.numero_compte>='] = $search_accountancy_code_start;
  146. $param .= '&search_accountancy_code_start=' . $search_accountancy_code_start;
  147. }
  148. if (! empty($search_accountancy_code_end)) {
  149. $filter['t.numero_compte<='] = $search_accountancy_code_end;
  150. $param .= '&search_accountancy_code_end=' . $search_accountancy_code_end;
  151. }
  152. if (! empty($search_accountancy_aux_code)) {
  153. $filter['t.code_tiers'] = $search_accountancy_aux_code;
  154. $param .= '&search_accountancy_aux_code=' . $search_accountancy_aux_code;
  155. }
  156. if (! empty($search_accountancy_aux_code_start)) {
  157. $filter['t.code_tiers>='] = $search_accountancy_aux_code_start;
  158. $param .= '&search_accountancy_aux_code_start=' . $search_accountancy_aux_code_start;
  159. }
  160. if (! empty($search_accountancy_aux_code_end)) {
  161. $filter['t.code_tiers<='] = $search_accountancy_aux_code_end;
  162. $param .= '&search_accountancy_aux_code_end=' . $search_accountancy_aux_code_end;
  163. }
  164. if (! empty($search_mvt_label)) {
  165. $filter['t.label_compte'] = $search_mvt_label;
  166. $param .= '&search_mvt_label=' . $search_mvt_label;
  167. }
  168. if (! empty($search_direction)) {
  169. $filter['t.sens'] = $search_direction;
  170. $param .= '&search_direction=' . $search_direction;
  171. }
  172. if (! empty($search_ledger_code)) {
  173. $filter['t.code_journal'] = $search_ledger_code;
  174. $param .= '&search_ledger_code=' . $search_ledger_code;
  175. }
  176. if (! empty($search_mvt_num)) {
  177. $filter['t.piece_num'] = $search_mvt_num;
  178. $param .= '&search_mvt_num=' . $search_mvt_num;
  179. }
  180. if ($action == 'delbookkeeping') {
  181. $import_key = GETPOST('importkey', 'alpha');
  182. if (! empty($import_key)) {
  183. $result = $object->deleteByImportkey($import_key);
  184. if ($result < 0) {
  185. setEventMessages($object->error, $object->errors, 'errors');
  186. }
  187. Header("Location: list.php");
  188. exit();
  189. }
  190. }
  191. if ($action == 'delbookkeepingyearconfirm') {
  192. $delyear = GETPOST('delyear', 'int');
  193. if ($delyear==-1) {
  194. $delyear=0;
  195. }
  196. $deljournal = GETPOST('deljournal','alpha');
  197. if ($deljournal==-1) {
  198. $deljournal=0;
  199. }
  200. if (! empty($delyear) || ! empty($deljournal))
  201. {
  202. $result = $object->deleteByYearAndJournal($delyear,$deljournal);
  203. if ($result < 0) {
  204. setEventMessages($object->error, $object->errors, 'errors');
  205. }
  206. else
  207. {
  208. setEventMessages("RecordDeleted", null, 'mesgs');
  209. }
  210. Header("Location: list.php");
  211. exit;
  212. }
  213. else
  214. {
  215. setEventMessages("NoRecordDeleted", null, 'warnings');
  216. Header("Location: list.php");
  217. exit;
  218. }
  219. }
  220. if ($action == 'delmouvconfirm') {
  221. $mvt_num = GETPOST('mvt_num', 'int');
  222. if (! empty($mvt_num)) {
  223. $result = $object->deleteMvtNum($mvt_num);
  224. if ($result < 0) {
  225. setEventMessages($object->error, $object->errors, 'errors');
  226. }
  227. else
  228. {
  229. setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
  230. }
  231. Header("Location: list.php");
  232. exit;
  233. }
  234. }
  235. if ($action == 'export_csv') {
  236. include DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
  237. $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
  238. if ($result < 0)
  239. {
  240. setEventMessages($object->error, $object->errors, 'errors');
  241. }
  242. else
  243. {
  244. $accountancyexport = new AccountancyExport($db);
  245. $accountancyexport->export($object->lines);
  246. if (!empty($accountancyexport->errors)) {
  247. setEventMessages('', $accountancyexport->errors, 'errors');
  248. }
  249. exit;
  250. }
  251. }
  252. /*
  253. * View
  254. */
  255. $title_page = $langs->trans("Bookkeeping");
  256. llxHeader('', $title_page);
  257. // List
  258. $nbtotalofrecords = '';
  259. if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
  260. $nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
  261. if ($nbtotalofrecords < 0) {
  262. setEventMessages($object->error, $object->errors, 'errors');
  263. }
  264. }
  265. // TODO Do not use this
  266. $result = $object->fetchAll($sortorder, $sortfield, $limit, $offset, $filter);
  267. if ($result < 0) {
  268. setEventMessages($object->error, $object->errors, 'errors');
  269. }
  270. $num=count($object->lines);
  271. if ($action == 'delmouv') {
  272. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?mvt_num=' . GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1);
  273. print $formconfirm;
  274. }
  275. if ($action == 'delbookkeepingyear') {
  276. $form_question = array ();
  277. $delyear = GETPOST('delyear');
  278. $deljournal = GETPOST('deljournal');
  279. if (empty($delyear)) {
  280. $delyear = dol_print_date(dol_now(), '%Y');
  281. }
  282. $year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
  283. $journal_array = $formaccounting->selectjournal($deljournal, 'deljournal', '', 1, 'array', 1, 1);
  284. $form_question['delyear'] = array (
  285. 'name' => 'delyear',
  286. 'type' => 'select',
  287. 'label' => $langs->trans('DelYear'),
  288. 'values' => $year_array,
  289. 'default' => $delyear
  290. );
  291. $form_question['deljournal'] = array (
  292. 'name' => 'deljournal',
  293. 'type' => 'select',
  294. 'label' => $langs->trans('DelJournal'),
  295. 'values' => $journal_array,
  296. 'default' => $deljournal
  297. );
  298. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250);
  299. print $formconfirm;
  300. }
  301. //$param=''; param started before
  302. if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
  303. if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
  304. print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
  305. print '<input type="hidden" name="action" value="list">';
  306. if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
  307. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  308. print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
  309. print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
  310. print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
  311. print '<input type="hidden" name="page" value="'.$page.'">';
  312. $button = '<a class="butAction" name="button_export_csv" href="'.$_SERVER["PHP_SELF"].'?action=export_csv'.($param?'&'.$param:'').'">';
  313. if (count($filter)) $button.= $langs->trans("ExportFilteredList");
  314. else $button.= $langs->trans("ExportList");
  315. $button.= '</a>';
  316. $groupby = ' <a class="nohover" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php"">' . $langs->trans("GroupByAccountAccounting") . '</a>';
  317. print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby, '', $limit);
  318. print '<div class="tabsAction">' . "\n";
  319. print '<div class="inline-block divButAction"><a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a></div>';
  320. print '<div class="inline-block divButAction"><a class="butActionDelete" name="button_delmvt" href="'.$_SERVER["PHP_SELF"].'?action=delbookkeepingyear'.($param?'&'.$param:'').'">' . $langs->trans("DelBookKeeping") . '</a></div>';
  321. print '</div>';
  322. print '<table class="noborder" width="100%">';
  323. print '<tr class="liste_titre_filter">';
  324. print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="' . dol_escape_htmltag($search_mvt_num) . '"></td>';
  325. print '<td class="liste_titre center">';
  326. print $langs->trans('From') . ': ';
  327. print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
  328. print '<br>';
  329. print $langs->trans('to') . ': ';
  330. print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
  331. print '</td>';
  332. print '<td class="liste_titre"><input type="text" name="search_doc_ref" size="8" value="' . dol_escape_htmltag($search_doc_ref) . '"></td>';
  333. print '<td class="liste_titre">';
  334. print $langs->trans('From');
  335. print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '');
  336. print '<br>';
  337. print $langs->trans('to');
  338. print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, '');
  339. print '</td>';
  340. print '<td class="liste_titre">';
  341. print $langs->trans('From');
  342. print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
  343. print '<br>';
  344. print $langs->trans('to');
  345. print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1);
  346. print '</td>';
  347. print '<td class="liste_titre">';
  348. print '<input type="text" size="7" class="flat" name="search_mvt_label" value="' . $search_mvt_label . '"/>';
  349. print '</td>';
  350. print '<td class="liste_titre center">&nbsp;</td>';
  351. print '<td class="liste_titre center">&nbsp;</td>';
  352. print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
  353. print '<td class="liste_titre center">';
  354. $searchpicto=$form->showFilterButtons();
  355. print $searchpicto;
  356. print '</td>';
  357. print '</tr>';
  358. print '<tr class="liste_titre">';
  359. print_liste_field_titre($langs->trans("TransactionNumShort"), $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder);
  360. print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder);
  361. print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
  362. print_liste_field_titre($langs->trans("AccountAccountingShort"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
  363. print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "t.code_tiers", "", $param, "", $sortfield, $sortorder);
  364. print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_compte", "", $param, "", $sortfield, $sortorder);
  365. print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
  366. print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
  367. print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder);
  368. $checkpicto='';
  369. if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
  370. print_liste_field_titre($checkpicto, $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
  371. print "</tr>\n";
  372. $total_debit = 0;
  373. $total_credit = 0;
  374. foreach ($object->lines as $line ) {
  375. $var = ! $var;
  376. $total_debit += $line->debit;
  377. $total_credit += $line->credit;
  378. print '<tr class="oddeven">';
  379. print '<td><a href="./card.php?piece_num=' . $line->piece_num . '">' . $line->piece_num . '</a></td>';
  380. print '<td align="center">' . dol_print_date($line->doc_date, 'day') . '</td>';
  381. print '<td class="nowrap">' . $line->doc_ref . '</td>';
  382. print '<td>' . length_accountg($line->numero_compte) . '</td>';
  383. print '<td>' . length_accounta($line->code_tiers) . '</td>';
  384. print '<td>' . $line->label_compte . '</td>';
  385. print '<td align="right">' . price($line->debit) . '</td>';
  386. print '<td align="right">' . price($line->credit) . '</td>';
  387. $accountingjournal = new AccountingJournal($db);
  388. $accountingjournal->fetch('',$line->code_journal);
  389. print '<td align="center">' . $accountingjournal->getNomUrl(0,0,0,'',0) . '</td>';
  390. print '<td align="center">';
  391. print '<a href="./card.php?piece_num=' . $line->piece_num . '">' . img_edit() . '</a>&nbsp;';
  392. print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $param . '&page=' . $page . '">' . img_delete() . '</a>';
  393. print '</td>';
  394. print "</tr>\n";
  395. }
  396. print '<tr class="liste_total">';
  397. if ($num < $limit) print '<td align="left" colspan="6">'.$langs->trans("Total").'</td>';
  398. else print '<td align="left" colspan="6">'.$langs->trans("Totalforthispage").'</td>';
  399. print '</td>';
  400. print '<td align="right">';
  401. print price($total_debit);
  402. print '</td>';
  403. print '<td align="right">';
  404. print price($total_credit);
  405. print '</td>';
  406. print '<td></td>';
  407. print '</tr>';
  408. print "</table>";
  409. print '</form>';
  410. llxFooter();
  411. $db->close();