-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
1080 lines (929 loc) · 46.5 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/index.php
* \brief Dolibarr home page
*/
define('NOCSRFCHECK', 1); // This is main home and login page. We must be able to go on it from another web site.
require 'main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// If not defined, we select menu "home"
$_GET['mainmenu'] = GETPOST('mainmenu', 'aZ09') ?GETPOST('mainmenu', 'aZ09') : 'home';
$action = GETPOST('action', 'aZ09');
$hookmanager->initHooks(array('index'));
/*
* Actions
*/
// Check if company name is defined (first install)
if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_NOM))
{
header("Location: ".DOL_URL_ROOT."/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete");
exit;
}
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled
{
header("Location: ".DOL_URL_ROOT."/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete");
exit;
}
if (GETPOST('addbox')) // Add box (when submit is done from a form when ajax disabled)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
$zone = GETPOST('areacode', 'aZ09');
$userid = GETPOST('userid', 'int');
$boxorder = GETPOST('boxorder', 'aZ09');
$boxorder .= GETPOST('boxcombo', 'aZ09');
$result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid);
if ($result > 0) setEventMessages($langs->trans("BoxAdded"), null);
}
/*
* View
*/
if (!is_object($form)) $form = new Form($db);
// Title
$title = $langs->trans("HomeArea").' - Dolibarr '.DOL_VERSION;
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = $langs->trans("HomeArea").' - '.$conf->global->MAIN_APPLICATION_TITLE;
llxHeader('', $title);
$resultboxes = FormOther::getBoxesArea($user, "0"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
print load_fiche_titre(' ', $resultboxes['selectboxlist'], '', 0, '', 'titleforhome');
if (!empty($conf->global->MAIN_MOTD))
{
$conf->global->MAIN_MOTD = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i', '<br>', $conf->global->MAIN_MOTD);
if (!empty($conf->global->MAIN_MOTD))
{
$substitutionarray = getCommonSubstitutionArray($langs);
complete_substitutions_array($substitutionarray, $langs);
$texttoshow = make_substitutions($conf->global->MAIN_MOTD, $substitutionarray, $langs);
print "\n<!-- Start of welcome text -->\n";
print '<table width="100%" class="notopnoleftnoright"><tr><td>';
print dol_htmlentitiesbr($texttoshow);
print '</td></tr></table><br>';
print "\n<!-- End of welcome text -->\n";
}
}
/*
* Dashboard Dolibarr states (statistics)
* Hidden for external users
*/
$boxstatItems = array();
$boxstatFromHook = '';
// Load translation files required by page
$langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts'));
// Load global statistics of objects
if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
{
$object = new stdClass();
$parameters = array();
$action = '';
$reshook = $hookmanager->executeHooks('addStatisticLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
$boxstatFromHook = $hookmanager->resPrint;
if (empty($reshook))
{
// Cle array returned by the method load_state_board for each line
$keys = array(
'users',
'members',
'expensereports',
'holidays',
'customers',
'prospects',
'suppliers',
'contacts',
'products',
'services',
'projects',
'proposals',
'orders',
'invoices',
'donations',
'supplier_proposals',
'supplier_orders',
'supplier_invoices',
'contracts',
'interventions',
'ticket'
);
// Condition to be checked for each display line dashboard
$conditions = array(
'users' => $user->rights->user->user->lire,
'members' => !empty($conf->adherent->enabled) && $user->rights->adherent->lire,
'customers' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS),
'prospects' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
'suppliers' => !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
'contacts' => !empty($conf->societe->enabled) && $user->rights->societe->contact->lire,
'products' => !empty($conf->product->enabled) && $user->rights->produit->lire,
'services' => !empty($conf->service->enabled) && $user->rights->service->lire,
'proposals' => !empty($conf->propal->enabled) && $user->rights->propale->lire,
'orders' => !empty($conf->commande->enabled) && $user->rights->commande->lire,
'invoices' => !empty($conf->facture->enabled) && $user->rights->facture->lire,
'donations' => !empty($conf->don->enabled) && $user->rights->don->lire,
'contracts' => !empty($conf->contrat->enabled) && $user->rights->contrat->lire,
'interventions' => !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire,
'supplier_orders' => !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
'supplier_invoices' => !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
'supplier_proposals' => !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
'projects' => !empty($conf->projet->enabled) && $user->rights->projet->lire,
'expensereports' => !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire,
'holidays' => !empty($conf->holiday->enabled) && $user->rights->holiday->read,
'ticket' => !empty($conf->ticket->enabled) && $user->rights->ticket->read
);
// Class file containing the method load_state_board for each line
$includes = array(
'users' => DOL_DOCUMENT_ROOT."/user/class/user.class.php",
'members' => DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php",
'customers' => DOL_DOCUMENT_ROOT."/societe/class/client.class.php",
'prospects' => DOL_DOCUMENT_ROOT."/societe/class/client.class.php",
'suppliers' => DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php",
'contacts' => DOL_DOCUMENT_ROOT."/contact/class/contact.class.php",
'products' => DOL_DOCUMENT_ROOT."/product/class/product.class.php",
'services' => DOL_DOCUMENT_ROOT."/product/class/product.class.php",
'proposals' => DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php",
'orders' => DOL_DOCUMENT_ROOT."/commande/class/commande.class.php",
'invoices' => DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php",
'donations' => DOL_DOCUMENT_ROOT."/don/class/don.class.php",
'contracts' => DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php",
'interventions' => DOL_DOCUMENT_ROOT."/fichinter/class/fichinter.class.php",
'supplier_orders' => DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php",
'supplier_invoices' => DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php",
'supplier_proposals' => DOL_DOCUMENT_ROOT."/supplier_proposal/class/supplier_proposal.class.php",
'projects' => DOL_DOCUMENT_ROOT."/projet/class/project.class.php",
'expensereports' => DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php",
'holidays' => DOL_DOCUMENT_ROOT."/holiday/class/holiday.class.php",
'ticket' => DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"
);
// Name class containing the method load_state_board for each line
$classes = array(
'users' => 'User',
'members' => 'Adherent',
'customers' => 'Client',
'prospects' => 'Client',
'suppliers' => 'Fournisseur',
'contacts' => 'Contact',
'products' => 'Product',
'services' => 'ProductService',
'proposals' => 'Propal',
'orders' => 'Commande',
'invoices' => 'Facture',
'donations' => 'Don',
'contracts' => 'Contrat',
'interventions' => 'Fichinter',
'supplier_orders' => 'CommandeFournisseur',
'supplier_invoices' => 'FactureFournisseur',
'supplier_proposals' => 'SupplierProposal',
'projects' => 'Project',
'expensereports' => 'ExpenseReport',
'holidays' => 'Holiday',
'ticket' => 'Ticket',
);
// Translation keyword
$titres = array(
'users' => "Users",
'members' => "Members",
'customers' => "ThirdPartyCustomersStats",
'prospects' => "ThirdPartyProspectsStats",
'suppliers' => "Suppliers",
'contacts' => "Contacts",
'products' => "Products",
'services' => "Services",
'proposals' => "CommercialProposalsShort",
'orders' => "CustomersOrders",
'invoices' => "BillsCustomers",
'donations' => "Donations",
'contracts' => "Contracts",
'interventions' => "Interventions",
'supplier_orders' => "SuppliersOrders",
'supplier_invoices' => "SuppliersInvoices",
'supplier_proposals' => "SupplierProposalShort",
'projects' => "Projects",
'expensereports' => "ExpenseReports",
'holidays' => "Holidays",
'ticket' => "Ticket",
);
// Dashboard Link lines
$links = array(
'users' => DOL_URL_ROOT.'/user/list.php',
'members' => DOL_URL_ROOT.'/adherents/list.php?statut=1&mainmenu=members',
'customers' => DOL_URL_ROOT.'/societe/list.php?type=c&mainmenu=companies',
'prospects' => DOL_URL_ROOT.'/societe/list.php?type=p&mainmenu=companies',
'suppliers' => DOL_URL_ROOT.'/societe/list.php?type=f&mainmenu=companies',
'contacts' => DOL_URL_ROOT.'/contact/list.php?mainmenu=companies',
'products' => DOL_URL_ROOT.'/product/list.php?type=0&mainmenu=products',
'services' => DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products',
'proposals' => DOL_URL_ROOT.'/comm/propal/list.php?mainmenu=commercial&leftmenu=propals',
'orders' => DOL_URL_ROOT.'/commande/list.php?mainmenu=commercial&leftmenu=orders',
'invoices' => DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills',
'donations' => DOL_URL_ROOT.'/don/list.php?leftmenu=donations',
'contracts' => DOL_URL_ROOT.'/contrat/list.php?mainmenu=commercial&leftmenu=contracts',
'interventions' => DOL_URL_ROOT.'/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter',
'supplier_orders' => DOL_URL_ROOT.'/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers',
'supplier_invoices' => DOL_URL_ROOT.'/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills',
'supplier_proposals' => DOL_URL_ROOT.'/supplier_proposal/list.php?mainmenu=commercial&leftmenu=',
'projects' => DOL_URL_ROOT.'/projet/list.php?mainmenu=project',
'expensereports' => DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport',
'holidays' => DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&leftmenu=holiday',
'ticket' => DOL_URL_ROOT.'/ticket/list.php?leftmenu=ticket'
);
// Translation lang files
$langfile = array(
'customers' => "companies",
'contacts' => "companies",
'services' => "products",
'proposals' => "propal",
'invoices' => "bills",
'supplier_orders' => "orders",
'supplier_invoices' => "bills",
'supplier_proposals' => 'supplier_proposal',
'expensereports' => "trips",
'holidays' => "holiday",
);
// Loop and displays each line of table
$boardloaded = array();
foreach ($keys as $val)
{
if ($conditions[$val])
{
$boxstatItem = '';
$class = $classes[$val];
// Search in cache if load_state_board is already realized
if (!isset($boardloaded[$class]) || !is_object($boardloaded[$class]))
{
include_once $includes[$val]; // Loading a class cost around 1Mb
$board = new $class($db);
$board->load_state_board();
$boardloaded[$class] = $board;
}
else
{
$board = $boardloaded[$class];
}
$langs->load(empty($langfile[$val]) ? $val : $langfile[$val]);
$text = $langs->trans($titres[$val]);
$boxstatItem .= '<a href="'.$links[$val].'" class="boxstatsindicator thumbstat nobold nounderline">';
$boxstatItem .= '<div class="boxstats">';
$boxstatItem .= '<span class="boxstatstext" title="'.dol_escape_htmltag($text).'">'.$text.'</span><br>';
$boxstatItem .= '<span class="boxstatsindicator">'.img_object("", $board->picto, 'class="inline-block"').' '.($board->nb[$val] ? $board->nb[$val] : 0).'</span>';
$boxstatItem .= '</div>';
$boxstatItem .= '</a>';
$boxstatItems[$val] = $boxstatItem;
}
}
}
}
// Dolibarr Working Board with weather
if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$showweather = (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0;
//Array that contains all WorkboardResponse classes to process them
$dashboardlines = array();
// Do not include sections without management permission
require_once DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php';
// Number of actions to do (late)
if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->read) {
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$board = new ActionComm($db);
$dashboardlines[$board->element] = $board->load_board($user);
}
// Number of project opened
if (!empty($conf->projet->enabled) && $user->rights->projet->lire) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$board = new Project($db);
$dashboardlines[$board->element] = $board->load_board($user);
}
// Number of tasks to do (late)
if (!empty($conf->projet->enabled) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
$board = new Task($db);
$dashboardlines[$board->element] = $board->load_board($user);
}
// Number of commercial proposals open (expired)
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$board = new Propal($db);
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
// Number of commercial proposals CLOSED signed (billed)
$dashboardlines[$board->element.'_signed'] = $board->load_board($user, "signed");
}
// Number of commercial proposals open (expired)
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
$board = new SupplierProposal($db);
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
// Number of commercial proposals CLOSED signed (billed)
$dashboardlines[$board->element.'_signed'] = $board->load_board($user, "signed");
}
// Number of customer orders a deal
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$board = new Commande($db);
$dashboardlines[$board->element] = $board->load_board($user);
}
// Number of suppliers orders a deal
if (!empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire) {
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$board = new CommandeFournisseur($db);
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
$dashboardlines[$board->element.'_awaiting'] = $board->load_board($user, 'awaiting');
}
// Number of contract / services enabled (delayed)
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$board = new Contrat($db);
$dashboardlines[$board->element.'_inactive'] = $board->load_board($user, "inactive");
// Number of active services (expired)
$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active");
}
// Number of tickets open
if (!empty($conf->ticket->enabled) && $user->rights->ticket->read) {
include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
$board = new Ticket($db);
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
// Number of active services (expired)
//$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active");
}
// Number of invoices customers (paid)
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$board = new Facture($db);
$dashboardlines[$board->element] = $board->load_board($user);
}
// Number of supplier invoices (paid)
if (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->fournisseur->facture->lire)) {
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$board = new FactureFournisseur($db);
$dashboardlines[$board->element] = $board->load_board($user);
}
// Number of transactions to conciliate
if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->socid) {
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$board = new Account($db);
$nb = $board::countAccountToReconcile(); // Get nb of account to reconciliate
if ($nb > 0) {
$dashboardlines[$board->element] = $board->load_board($user);
}
}
// Number of cheque to send
if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->socid && empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) {
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
$board = new RemiseCheque($db);
$dashboardlines[$board->element] = $board->load_board($user);
}
// Number of foundation members
if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire && !$user->socid) {
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$board = new Adherent($db);
$dashboardlines[$board->element.'_shift'] = $board->load_board($user, 'shift');
$dashboardlines[$board->element.'_expired'] = $board->load_board($user, 'expired');
}
// Number of expense reports to approve
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->approve) {
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$board = new ExpenseReport($db);
$dashboardlines[$board->element . '_toapprove'] = $board->load_board($user, 'toapprove');
}
// Number of expense reports to pay
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->to_paid) {
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$board = new ExpenseReport($db);
$dashboardlines[$board->element . '_topay'] = $board->load_board($user, 'topay');
}
// Number of holidays to approve
if (!empty($conf->holiday->enabled) && $user->rights->holiday->approve) {
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$board = new Holiday($db);
$dashboardlines[$board->element] = $board->load_board($user);
}
$object = new stdClass();
$parameters = array();
$action = '';
$reshook = $hookmanager->executeHooks('addOpenElementsDashboardLine', $parameters, $object,
$action); // Note that $action and $object may have been modified by some hooks
if ($reshook == 0) {
$dashboardlines = array_merge($dashboardlines, $hookmanager->resArray);
}
/* Open object dashboard */
$dashboardgroup = array(
'action' =>
array(
'groupName' => 'Agenda',
'stats' => array('action'),
),
'project' =>
array(
'groupName' => 'Projects',
'globalStatsKey' => 'projects',
'stats' => array('project', 'project_task'),
),
'propal' =>
array(
'groupName' => 'Proposals',
'globalStatsKey' => 'proposals',
'stats' =>
array('propal_opened', 'propal_signed'),
),
'commande' =>
array(
'groupName' => 'Orders',
'globalStatsKey' => 'orders',
'stats' =>
array('commande'),
),
'facture' =>
array(
'groupName' => 'Invoices',
'globalStatsKey' => 'invoices',
'stats' =>
array('facture'),
),
'supplier_proposal' =>
array(
'groupName' => 'SupplierProposals',
'globalStatsKey' => 'askprice',
'stats' =>
array('supplier_proposal_opened', 'supplier_proposal_signed'),
),
'order_supplier' =>
array(
'groupName' => 'SuppliersOrders',
'globalStatsKey' => 'supplier_orders',
'stats' =>
array('order_supplier_opened', 'order_supplier_awaiting'),
),
'invoice_supplier' =>
array(
'groupName' => 'BillsSuppliers',
'globalStatsKey' => 'supplier_invoices',
'stats' =>
array('invoice_supplier'),
),
'contrat' =>
array(
'groupName' => 'Contracts',
'globalStatsKey' => 'Contracts',
'stats' =>
array('contrat_inactive', 'contrat_active'),
),
'ticket' =>
array(
'groupName' => 'Tickets',
'globalStatsKey' => 'ticket',
'stats' =>
array('ticket_opened'),
),
'bank_account' =>
array(
'groupName' => 'BankAccount',
'stats' =>
array('bank_account', 'chequereceipt'),
),
'member' =>
array(
'groupName' => 'Members',
'globalStatsKey' => 'members',
'stats' =>
array('member_shift', 'member_expired'),
),
'expensereport' =>
array(
'groupName' => 'ExpenseReport',
'globalStatsKey' => 'expensereports',
'stats' =>
array('expensereport_toapprove', 'expensereport_topay'),
),
'holiday' =>
array(
'groupName' => 'Holidays',
'globalStatsKey' => 'holidays',
'stats' =>
array('holiday'),
),
);
$object = new stdClass();
$parameters = array(
'dashboardgroup' => $dashboardgroup
);
$reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook == 0) {
$dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray);
}
// Calculate total nb of late
$totallate = $totaltodo = 0;
//Remove any invalid response
//load_board can return an integer if failed or WorkboardResponse if OK
$valid_dashboardlines = array();
foreach ($dashboardlines as $infoKey => $tmp) {
if ($tmp instanceof WorkboardResponse) {
$valid_dashboardlines[$infoKey] = $tmp;
}
}
// We calculate $totallate. Must be defined before start of next loop because it is show in first fetch on next loop
foreach ($valid_dashboardlines as $board) {
if ($board->nbtodolate > 0) {
$totaltodo += $board->nbtodo;
$totallate += $board->nbtodolate;
}
}
$openedDashBoardSize = 'info-box-sm'; // use sm by default
foreach ($dashboardgroup as $dashbordelement) {
if (is_array($dashbordelement['stats']) && count($dashbordelement['stats']) > 2) {
$openedDashBoardSize = ''; // use default info box size : big
break;
}
}
$totalLateNumber = $totallate;
$totallatePercentage = ((!empty($totaltodo)) ? round($totallate / $totaltodo * 100, 2) : 0);
if (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
$totallate = $totallatePercentage;
}
$boxwork = '';
$boxwork .= '<div class="box">';
$boxwork .= '<table summary="'.dol_escape_htmltag($langs->trans("WorkingBoard")).'" class="noborder boxtable boxtablenobottom boxworkingboard" width="100%">'."\n";
$boxwork .= '<tr class="liste_titre">';
$boxwork .= '<th class="liste_titre"><div class="inline-block valignmiddle">'.$langs->trans("DolibarrWorkBoard").'</div>';
if ($showweather) {
if ($totallate > 0) {
$text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate",
$totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')';
} else {
$text = $langs->transnoentitiesnoconv("NoItemLate");
}
$text .= '. '.$langs->transnoentitiesnoconv("LateDesc");
//$text.=$form->textwithpicto('',$langs->trans("LateDesc"));
$options = 'height="24px" style="float: right"';
$boxwork .= showWeather($totallate, $text, $options, 'inline-block valignmiddle');
}
$boxwork .= '</th>';
$boxwork .= '</tr>'."\n";
// Show dashboard
$nbworkboardempty = 0;
$isIntopOpenedDashBoard = $globalStatInTopOpenedDashBoard = array();
if (!empty($valid_dashboardlines)) {
$openedDashBoard = '';
$boxwork .= '<tr class="nobottom nohover"><td class="tdboxstats nohover flexcontainer centpercent"><div style="display: flex: flex-wrap: wrap">';
foreach ($dashboardgroup as $groupKey => $groupElement) {
$boards = array();
if (empty($conf->global->MAIN_DISABLE_NEW_OPENED_DASH_BOARD)) {
foreach ($groupElement['stats'] as $infoKey) {
if (!empty($valid_dashboardlines[$infoKey])) {
$boards[] = $valid_dashboardlines[$infoKey];
$isIntopOpenedDashBoard[] = $infoKey;
}
}
}
if (!empty($boards)) {
$groupName = $langs->trans($groupElement['groupName']);
$groupKeyLowerCase = strtolower($groupKey);
$nbTotalForGroup = 0;
// global stats
$globalStatsKey = false;
if (!empty($groupElement['globalStatsKey']) && empty($groupElement['globalStats'])) { // can be filled by hook
$globalStatsKey = $groupElement['globalStatsKey'];
$groupElement['globalStats'] = array();
if (is_array($keys) && in_array($globalStatsKey, $keys))
{
// get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links
$keyIndex = array_search($globalStatsKey, $keys);
$classe = $classes[$keyIndex];
if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe]))
{
$groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0;
$nbTotal = doubleval($groupElement['globalStats']['total']);
if ($nbTotal >= 10000) { $nbTotal = round($nbTotal / 1000, 2).'k'; }
$groupElement['globalStats']['text'] = $langs->trans('Total').' : '.$langs->trans($titres[$keyIndex]).' ('.$groupElement['globalStats']['total'].')';
$groupElement['globalStats']['total'] = $nbTotal;
$groupElement['globalStats']['link'] = $links[$keyIndex];
}
}
}
$openedDashBoard .= '<div class="box-flex-item"><div class="box-flex-item-with-margin">'."\n";
$openedDashBoard .= ' <div class="info-box '.$openedDashBoardSize.'">'."\n";
$openedDashBoard .= ' <span class="info-box-icon bg-infobox-'.$groupKeyLowerCase.'">'."\n";
$openedDashBoard .= ' <i class="fa fa-dol-'.$groupKeyLowerCase.'"></i>'."\n";
// Show the span for the total of record
if (!empty($groupElement['globalStats'])) {
$globalStatInTopOpenedDashBoard[] = $globalStatsKey;
$openedDashBoard .= ' <span class="info-box-icon-text" title="'.$groupElement['globalStats']['text'].'">'.$nbTotal.'</span>'."\n";
}
$openedDashBoard .= ' </span>'."\n";
$openedDashBoard .= ' <div class="info-box-content">'."\n";
$openedDashBoard .= ' <span class="info-box-title" title="'.strip_tags($groupName).'">'.$groupName.'</span>'."\n";
foreach ($boards as $board) {
if (!empty($board->labelShort)) {
$infoName = '<span title="'.$board->label.'">'.$board->labelShort.'</span>';
} else {
$infoName = $board->label;
}
$textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate);
$textLateTitle .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')';
$textLate = '';
if ($board->nbtodolate > 0) {
$textLate .= '<span title="'.dol_htmlentities($textLateTitle).'" class="classfortooltip badge badge-warning">';
$textLate .= '<i class="fa fa-exclamation-triangle"></i> '.$board->nbtodolate;
$textLate .= '</span>';
}
$openedDashBoard .= '<div class="info-box-line">';
$nbtodClass = '';
if ($board->nbtodo > 0) {
$nbtodClass = 'badge badge-info';
}
$openedDashBoard .= ' <a href="'.$board->url.'" class="info-box-text info-box-text-a">'.$infoName.' : <span class="'.$nbtodClass.' classfortooltip" title="'.$board->label.'" >'.$board->nbtodo.'</span>';
if ($textLate) {
if ($board->url_late) {
$openedDashBoard .= '</a>';
$openedDashBoard .= ' <a href="'.$board->url_late.'" class="info-box-text info-box-text-a paddingleft">';
} else {
$openedDashBoard .= ' ';
}
$openedDashBoard .= $textLate;
}
$openedDashBoard .= '</a>'."\n";
if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
$openedDashBoard .= '<a href="'.$board->url.'" class="info-box-text">'.$langs->trans('Total').' : '.price($board->total).'</a>';
}
$openedDashBoard .= '</div>';
}
$openedDashBoard .= ' </div><!-- /.info-box-content -->'."\n";
$openedDashBoard .= ' </div><!-- /.info-box -->'."\n";
$openedDashBoard .= '</div><!-- /.box-flex-item-with-margin -->'."\n";
$openedDashBoard .= '</div><!-- /.box-flex-item -->'."\n";
$openedDashBoard .= "\n";
}
}
if ($showweather && !empty($isIntopOpenedDashBoard)) {
$appendClass = $conf->global->MAIN_DISABLE_METEO == 2 ? ' hideonsmartphone' : '';
$weather = getWeatherStatus($totallate);
$text = '';
if ($totallate > 0) {
$text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate",
$totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')';
} else {
$text = $langs->transnoentitiesnoconv("NoItemLate");
}
$text .= '. '.$langs->transnoentitiesnoconv("LateDesc");
$weatherDashBoard = '<div class="box-flex-item '.$appendClass.'"><div class="box-flex-item-with-margin">'."\n";
$weatherDashBoard .= ' <div class="info-box '.$openedDashBoardSize.' info-box-weather info-box-weather-level'.$weather->level.'">'."\n";
$weatherDashBoard .= ' <span class="info-box-icon">';
$weatherDashBoard .= img_weather('', $weather->level, '', 0, 'valignmiddle width50');
$weatherDashBoard .= ' </span>'."\n";
$weatherDashBoard .= ' <div class="info-box-content">'."\n";
$weatherDashBoard .= ' <span class="info-box-title">'.$langs->trans('GlobalOpenedElemView').'</span>'."\n";
if ($totallatePercentage > 0 && !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
$weatherDashBoard .= ' <span class="info-box-number">'.$langs->transnoentitiesnoconv("NActionsLate",
price($totallatePercentage).'%').'</span>'."\n";
$weatherDashBoard .= ' <span class="progress-description">'.$langs->trans('NActionsLate',
$totalLateNumber).'</span>'."\n";
} else {
$weatherDashBoard .= ' <span class="info-box-number">'.$langs->transnoentitiesnoconv("NActionsLate",
$totalLateNumber).'</span>'."\n";
if ($totallatePercentage > 0) {
$weatherDashBoard .= ' <span class="progress-description">'.$langs->trans('NActionsLate',
price($totallatePercentage).'%').'</span>'."\n";
}
}
$weatherDashBoard .= ' </div><!-- /.info-box-content -->'."\n";
$weatherDashBoard .= ' </div><!-- /.info-box -->'."\n";
$weatherDashBoard .= '</div><!-- /.box-flex-item-with-margin -->'."\n";
$weatherDashBoard .= '</div><!-- /.box-flex-item -->'."\n";
$weatherDashBoard .= "\n";
$openedDashBoard = $weatherDashBoard.$openedDashBoard;
}
if (!empty($isIntopOpenedDashBoard)) {
for ($i = 1; $i <= 10; $i++) {
$openedDashBoard .= '<div class="box-flex-item filler"></div>';
}
}
$nbworkboardcount = 0;
foreach ($valid_dashboardlines as $infoKey => $board) {
if (in_array($infoKey, $isIntopOpenedDashBoard)) {
// skip if info is present on top
continue;
}
if (empty($board->nbtodo)) {
$nbworkboardempty++;
}
$nbworkboardcount++;
$textlate = $langs->trans("NActionsLate", $board->nbtodolate);
$textlate .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')';
$boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats130 boxstatsborder">';
$boxwork .= '<div class="boxstatscontent">';
$boxwork .= '<span class="boxstatstext" title="'.dol_escape_htmltag($board->label).'">'.$board->img.' '.$board->label.'</span><br>';
$boxwork .= '<a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ? ' dashboardlineok' : '').'">'.$board->nbtodo.'</span></a>';
if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
$boxwork .= ' / <a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ? ' dashboardlineok' : '').'">'.price($board->total).'</span></a>';
}
$boxwork .= '</div>';
if ($board->nbtodolate > 0) {
$boxwork .= '<div class="dashboardlinelatecoin nowrap">';
$boxwork .= '<a title="'.dol_escape_htmltag($textlate).'" class="valignmiddle dashboardlineindicatorlate'.($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok').'" href="'.((!$board->url_late) ? $board->url : $board->url_late).'">';
//$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"').'';
$boxwork .= img_picto($textlate, "warning_white",
'class="inline-block hideonsmartphone valigntextbottom"').'';
$boxwork .= '<span class="dashboardlineindicatorlate'.($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok').'">';
$boxwork .= $board->nbtodolate;
$boxwork .= '</span>';
$boxwork .= '</a>';
$boxwork .= '</div>';
}
$boxwork .= '</div></div>';
$boxwork .= "\n";
}
$boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
$boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
$boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
$boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
$boxwork .= '</div>';
$boxwork .= '</td></tr>';
} else {
$boxwork .= '<tr class="nohover">';
$boxwork .= '<td class="nohover valignmiddle opacitymedium">';
$boxwork .= $langs->trans("NoOpenedElementToProcess");
$boxwork .= '</td>';
$boxwork .= '</tr>';
}
$boxwork .= '</td></tr>';
$boxwork .= '</table>'; // End table array of working board
$boxwork .= '</div>';
if (!empty($isIntopOpenedDashBoard)) {
print '<div class="fichecenter">';
print '<div class="opened-dash-board-wrap"><div class="box-flex-container">'.$openedDashBoard.'</div></div>';
print '</div>';
}
}
print '<div class="clearboth"></div>';
print '<div class="fichecenter fichecenterbis">';
/*
* Show boxes
*/
$boxlist .= '<div class="twocolumns">';
$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
if (!empty($nbworkboardcount))
{
$boxlist .= $boxwork;
}
$boxlist .= $resultboxes['boxlista'];
$boxlist .= '</div>';
if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
{
// Remove allready present info in new dash board
if (!empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD) && is_array($boxstatItems) && count($boxstatItems) > 0) {
foreach ($boxstatItems as $boxstatItemKey => $boxstatItemHtml) {
if (in_array($boxstatItemKey, $globalStatInTopOpenedDashBoard)) {
unset($boxstatItems[$boxstatItemKey]);
}
}
}
if (!empty($boxstatFromHook) || !empty($boxstatItems)) {
$boxstat .= '<!-- Database statistics -->'."\n";
$boxstat .= '<div class="box">';
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom nohover widgetstats" width="100%">';
$boxstat .= '<tr class="liste_titre box_titre">';
$boxstat .= '<td class="liste_titre">';
$boxstat .= '<div class="inline-block valignmiddle">'.$langs->trans("DolibarrStateBoard").'</div>';
$boxstat .= '</td>';
$boxstat .= '</tr>';
$boxstat .= '<tr class="nobottom nohover"><td class="tdboxstats nohover flexcontainer">';
$boxstat .= $boxstatFromHook;
if (is_array($boxstatItems) && count($boxstatItems) > 0)
{
$boxstat .= implode('', $boxstatItems);
}
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat .= '</td></tr>';
$boxstat .= '</table>';
$boxstat .= '</div>';
}
}
$boxlist .= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
$boxlist .= $boxstat;
$boxlist .= $resultboxes['boxlistb'];
$boxlist .= '</div>';
$boxlist .= "\n";
$boxlist .= '</div>';
print $boxlist;
print '</div>';
/*
* Show security warnings
*/
// Security warning repertoire install existe (si utilisateur admin)
if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
{
$message = '';
// Check if install lock file is present
$lockfile = DOL_DATA_ROOT.'/install.lock';
if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install"))
{
$langs->load("errors");
//if (! empty($message)) $message.='<br>';
$message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth');
}
// Conf files must be in read only mode
if (is_writable($conffile))
{
$langs->load("errors");
//$langs->load("other");
//if (! empty($message)) $message.='<br>';
$message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth');
}
if ($message)
{
print $message;
//$message.='<br>';
//print info_admin($langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install"));
}
}
//print 'mem='.memory_get_usage().' - '.memory_get_peak_usage();
// End of page
llxFooter();
$db->close();