expensereport.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. <?php
  2. /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
  5. * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
  6. * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
  7. * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
  8. * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
  9. * Copyright (C) 2011-2022 Philippe Grand <philippe.grand@atoo-net.com>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 3 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  23. */
  24. /**
  25. * \file htdocs/admin/expensereport.php
  26. * \ingroup expensereport
  27. * \brief Setup page of module ExpenseReport
  28. */
  29. // Load Dolibarr environment
  30. require '../main.inc.php';
  31. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  32. require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
  33. require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
  34. require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
  35. // Load translation files required by the page
  36. $langs->loadLangs(array('admin', 'errors', 'trips', 'other'));
  37. if (!$user->admin) {
  38. accessforbidden();
  39. }
  40. $action = GETPOST('action', 'aZ09');
  41. $value = GETPOST('value', 'alpha');
  42. $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
  43. $label = GETPOST('label', 'alpha');
  44. $scandir = GETPOST('scan_dir', 'alpha');
  45. $type = 'expensereport';
  46. /*
  47. * Actions
  48. */
  49. include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
  50. if ($action == 'updateMask') {
  51. $maskconst = GETPOST('maskconst', 'aZ09');
  52. $maskvalue = GETPOST('maskvalue', 'alpha');
  53. if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
  54. $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
  55. }
  56. if (!($res > 0)) {
  57. $error++;
  58. }
  59. if (!$error) {
  60. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  61. } else {
  62. setEventMessages($langs->trans("Error"), null, 'errors');
  63. }
  64. } elseif ($action == 'specimen') { // For fiche expensereport
  65. $modele = GETPOST('module', 'alpha');
  66. $expensespecimen = new ExpenseReport($db);
  67. $expensespecimen->initAsSpecimen();
  68. $expensespecimen->status = 0; // Force statut draft to show watermark
  69. // Search template files
  70. $file = ''; $classname = ''; $filefound = 0;
  71. $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
  72. foreach ($dirmodels as $reldir) {
  73. $file = dol_buildpath($reldir."core/modules/expensereport/doc/pdf_".$modele.".modules.php", 0);
  74. if (file_exists($file)) {
  75. $filefound = 1;
  76. $classname = "pdf_".$modele;
  77. break;
  78. }
  79. }
  80. if ($filefound) {
  81. require_once $file;
  82. $module = new $classname($db);
  83. if ($module->write_file($expensespecimen, $langs) > 0) {
  84. header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expensereport&file=SPECIMEN.pdf");
  85. return;
  86. } else {
  87. setEventMessages($module->error, $module->errors, 'errors');
  88. dol_syslog($module->error, LOG_ERR);
  89. }
  90. } else {
  91. setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
  92. dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
  93. }
  94. } elseif ($action == 'set') {
  95. // Activate a model
  96. $ret = addDocumentModel($value, $type, $label, $scandir);
  97. if ($ret > 0 && !getDolGlobalString('EXPENSEREPORT_ADDON_PDF')) {
  98. dolibarr_set_const($db, 'EXPENSEREPORT_ADDON_PDF', $value, 'chaine', 0, '', $conf->entity);
  99. }
  100. } elseif ($action == 'del') {
  101. $ret = delDocumentModel($value, $type);
  102. if ($ret > 0) {
  103. if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$value") {
  104. dolibarr_del_const($db, 'EXPENSEREPORT_ADDON_PDF', $conf->entity);
  105. }
  106. }
  107. } elseif ($action == 'setdoc') {
  108. // Set default model
  109. if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
  110. // La constante qui a ete lue en avant du nouveau set
  111. // on passe donc par une variable pour avoir un affichage coherent
  112. $conf->global->EXPENSEREPORT_ADDON_PDF = $value;
  113. }
  114. // On active le modele
  115. $ret = delDocumentModel($value, $type);
  116. if ($ret > 0) {
  117. $ret = addDocumentModel($value, $type, $label, $scandir);
  118. }
  119. } elseif ($action == 'setmod') {
  120. // TODO Verifier si module numerotation choisi peut etre active
  121. // par appel methode canBeActivated
  122. dolibarr_set_const($db, "EXPENSEREPORT_ADDON", $value, 'chaine', 0, '', $conf->entity);
  123. } elseif ($action == 'setoptions') {
  124. $db->begin();
  125. $freetext = GETPOST('EXPENSEREPORT_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
  126. $res1 = dolibarr_set_const($db, "EXPENSEREPORT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
  127. $draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
  128. $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
  129. $res3 = 0;
  130. if (isModEnabled('project') && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
  131. $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
  132. }
  133. $dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int');
  134. $res4 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity);
  135. $amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int');
  136. $res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
  137. if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) {
  138. $error++;
  139. }
  140. if (!$error) {
  141. $db->commit();
  142. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  143. } else {
  144. $db->rollback();
  145. setEventMessages($langs->trans("Error"), null, 'errors');
  146. }
  147. }
  148. /*
  149. * View
  150. */
  151. $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
  152. llxHeader('', $langs->trans("ExpenseReportsSetup"));
  153. $form = new Form($db);
  154. $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
  155. print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup');
  156. $head = expensereport_admin_prepare_head();
  157. print dol_get_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'trip');
  158. /*
  159. * Expense report numbering model
  160. */
  161. print load_fiche_titre($langs->trans("ExpenseReportNumberingModules"), '', '');
  162. print '<table class="noborder centpercent">';
  163. print '<tr class="liste_titre">';
  164. print '<td>'.$langs->trans("Name").'</td>';
  165. print '<td>'.$langs->trans("Description").'</td>';
  166. print '<td class="nowrap">'.$langs->trans("Example").'</td>';
  167. print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
  168. print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
  169. print '</tr>'."\n";
  170. clearstatcache();
  171. foreach ($dirmodels as $reldir) {
  172. $dir = dol_buildpath($reldir."core/modules/expensereport/");
  173. if (is_dir($dir)) {
  174. $handle = opendir($dir);
  175. if (is_resource($handle)) {
  176. while (($file = readdir($handle)) !== false) {
  177. if (substr($file, 0, 18) == 'mod_expensereport_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
  178. $file = substr($file, 0, dol_strlen($file) - 4);
  179. require_once $dir.$file.'.php';
  180. $module = new $file($db);
  181. // Show modules according to features level
  182. if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
  183. continue;
  184. }
  185. if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
  186. continue;
  187. }
  188. if ($module->isEnabled()) {
  189. print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
  190. print $module->info($langs);
  191. print '</td>';
  192. // Show example of numbering model
  193. print '<td class="nowrap">';
  194. $tmp = $module->getExample();
  195. if (preg_match('/^Error/', $tmp)) {
  196. $langs->load("errors");
  197. print '<div class="error">'.$langs->trans($tmp).'</div>';
  198. } elseif ($tmp == 'NotConfigured') {
  199. print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
  200. } else {
  201. print $tmp;
  202. }
  203. print '</td>'."\n";
  204. print '<td class="center">';
  205. if ($conf->global->EXPENSEREPORT_ADDON == $file) {
  206. print img_picto($langs->trans("Activated"), 'switch_on');
  207. } else {
  208. print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
  209. print img_picto($langs->trans("Disabled"), 'switch_off');
  210. print '</a>';
  211. }
  212. print '</td>';
  213. $exp = new ExpenseReport($db);
  214. $exp->initAsSpecimen();
  215. // Info
  216. $htmltooltip = '';
  217. $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
  218. $nextval = $module->getNextValue($exp);
  219. if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
  220. $htmltooltip .= ''.$langs->trans("NextValue").': ';
  221. if ($nextval) {
  222. if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
  223. $nextval = $langs->trans($nextval);
  224. }
  225. $htmltooltip .= $nextval.'<br>';
  226. } else {
  227. $htmltooltip .= $langs->trans($module->error).'<br>';
  228. }
  229. }
  230. print '<td class="center">';
  231. print $form->textwithpicto('', $htmltooltip, 1, 0);
  232. print '</td>';
  233. print "</tr>\n";
  234. }
  235. }
  236. }
  237. closedir($handle);
  238. }
  239. }
  240. }
  241. print "</table><br>\n";
  242. /*
  243. * Documents models for ExpenseReport
  244. */
  245. print load_fiche_titre($langs->trans("TemplatePDFExpenseReports"), '', '');
  246. // Defini tableau def des modeles
  247. $type = 'expensereport';
  248. $def = array();
  249. $sql = "SELECT nom";
  250. $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
  251. $sql .= " WHERE type = '".$db->escape($type)."'";
  252. $sql .= " AND entity = ".$conf->entity;
  253. $resql = $db->query($sql);
  254. if ($resql) {
  255. $i = 0;
  256. $num_rows = $db->num_rows($resql);
  257. while ($i < $num_rows) {
  258. $array = $db->fetch_array($resql);
  259. array_push($def, $array[0]);
  260. $i++;
  261. }
  262. } else {
  263. dol_print_error($db);
  264. }
  265. print '<table class="noborder centpercent">';
  266. print '<tr class="liste_titre">';
  267. print '<td>'.$langs->trans("Name").'</td>';
  268. print '<td>'.$langs->trans("Description").'</td>';
  269. print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
  270. print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
  271. print '<td class="center" width="80">'.$langs->trans("ShortInfo").'</td>';
  272. print '<td class="center" width="80">'.$langs->trans("Preview").'</td>';
  273. print "</tr>\n";
  274. clearstatcache();
  275. foreach ($dirmodels as $reldir) {
  276. $dir = dol_buildpath($reldir."core/modules/expensereport/doc");
  277. if (is_dir($dir)) {
  278. $handle = opendir($dir);
  279. if (is_resource($handle)) {
  280. while (($file = readdir($handle)) !== false) {
  281. $filelist[] = $file;
  282. }
  283. closedir($handle);
  284. arsort($filelist);
  285. foreach ($filelist as $file) {
  286. if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
  287. if (file_exists($dir.'/'.$file)) {
  288. $name = substr($file, 4, dol_strlen($file) - 16);
  289. $classname = substr($file, 0, dol_strlen($file) - 12);
  290. require_once $dir.'/'.$file;
  291. $module = new $classname($db);
  292. $modulequalified = 1;
  293. if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
  294. $modulequalified = 0;
  295. }
  296. if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
  297. $modulequalified = 0;
  298. }
  299. if ($modulequalified) {
  300. print '<tr class="oddeven"><td width="100">';
  301. print (empty($module->name) ? $name : $module->name);
  302. print "</td><td>\n";
  303. if (method_exists($module, 'info')) {
  304. print $module->info($langs);
  305. } else {
  306. print $module->description;
  307. }
  308. print '</td>';
  309. // Active
  310. if (in_array($name, $def)) {
  311. print '<td class="center">'."\n";
  312. print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
  313. print img_picto($langs->trans("Enabled"), 'switch_on');
  314. print '</a>';
  315. print "</td>";
  316. } else {
  317. print '<td class="center">'."\n";
  318. print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
  319. print "</td>";
  320. }
  321. // Default
  322. print '<td class="center">';
  323. if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$name") {
  324. print img_picto($langs->trans("Default"), 'on');
  325. } else {
  326. print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
  327. }
  328. print '</td>';
  329. // Info
  330. $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
  331. $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
  332. $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
  333. $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
  334. $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
  335. $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
  336. $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
  337. $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
  338. $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
  339. print '<td class="center">';
  340. print $form->textwithpicto('', $htmltooltip, -1, 0);
  341. print '</td>';
  342. // Preview
  343. print '<td class="center">';
  344. if ($module->type == 'pdf') {
  345. print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
  346. } else {
  347. print img_object($langs->trans("PreviewNotAvailable"), 'generic');
  348. }
  349. print '</td>';
  350. print '</tr>';
  351. }
  352. }
  353. }
  354. }
  355. }
  356. }
  357. }
  358. print '</table>';
  359. print '<br>';
  360. /*
  361. * Other options
  362. */
  363. print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
  364. print '<input type="hidden" name="token" value="'.newToken().'">';
  365. print '<input type="hidden" name="action" value="setoptions">';
  366. print load_fiche_titre($langs->trans("OtherOptions"), '', '');
  367. print '<table class="noborder centpercent">';
  368. print '<tr class="liste_titre">';
  369. print '<td>'.$langs->trans("Parameter").'</td>';
  370. print '<td class="center" width="60"></td>';
  371. print "</tr>\n";
  372. $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
  373. $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
  374. $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
  375. foreach ($substitutionarray as $key => $val) {
  376. $htmltext .= $key.'<br>';
  377. }
  378. $htmltext .= '</i>';
  379. print '<tr class="oddeven"><td colspan="2">';
  380. print $form->textwithpicto($langs->trans("FreeLegalTextOnExpenseReports"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
  381. $variablename = 'EXPENSEREPORT_FREE_TEXT';
  382. if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
  383. print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
  384. } else {
  385. include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
  386. $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
  387. print $doleditor->Create();
  388. }
  389. print '</td></tr>'."\n";
  390. // Use draft Watermark
  391. print '<tr class="oddeven"><td colspan="2">';
  392. print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
  393. print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('EXPENSEREPORT_DRAFT_WATERMARK')).'">';
  394. print '</td></tr>'."\n";
  395. if (isModEnabled('project')) {
  396. print '<tr class="oddeven"><td>';
  397. print $langs->trans('ProjectIsRequiredOnExpenseReports');
  398. print '</td><td class="right">';
  399. print $form->selectyesno('EXPENSEREPORT_PROJECT_IS_REQUIRED', !getDolGlobalString('EXPENSEREPORT_PROJECT_IS_REQUIRED') ? 0 : 1, 1);
  400. print '</td></tr>';
  401. }
  402. print '<tr class="oddeven"><td>';
  403. print $langs->trans('PrefillExpenseReportDatesWithCurrentMonth');
  404. print '</td><td class="right">';
  405. print $form->selectyesno('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', !getDolGlobalString('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH') ? 0 : 1, 1);
  406. print '</td></tr>';
  407. print '<tr class="oddeven"><td>';
  408. print $langs->trans('ForceExpenseReportsLineAmountsIncludingTaxesOnly');
  409. print '</td><td class="right">';
  410. print $form->selectyesno('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', !getDolGlobalString('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY') ? 0 : 1, 1);
  411. print '</td></tr>';
  412. print '</table>';
  413. print $form->buttonsSaveCancel("Save", '');
  414. print '</form>';
  415. print dol_get_fiche_end();
  416. // End of page
  417. llxFooter();
  418. $db->close();