1<?php
2/* Copyright (C) 2003-2004	Rodolphe Quiedeville	<rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2017	Laurent Destailleur		<eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2012	Regis Houssin			<regis.houssin@inodbox.com>
5 * Copyright (C) 2019		Nicolas ZABOURI			<info@inovea-conseil.com>
6 * Copyright (C) 2020		Tobias Sekan			<tobias.sekan@startmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22/**
23 *	\file		htdocs/comm/propal/index.php
24 *	\ingroup	propal
25 *	\brief	Home page of proposal area
26 */
27
28require '../../main.inc.php';
29
30// Security check
31$socid = GETPOST('socid', 'int');
32if (isset($user->socid) && $user->socid > 0)
33{
34	$action = '';
35	$socid = $user->socid;
36}
37restrictedArea($user, 'propal');
38
39require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
40require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
41
42// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
43$hookmanager = new HookManager($db);
44$hookmanager->initHooks(array('proposalindex'));
45
46// Load translation files required by the page
47$langs->loadLangs(array('propal', 'companies'));
48
49$now = dol_now();
50$max = 5;
51
52/*
53 * View
54 */
55$propalstatic = new Propal($db);
56$companystatic = new Societe($db);
57$form = new Form($db);
58$formfile = new FormFile($db);
59$help_url = "EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES:Módulo_Presupuestos";
60
61llxHeader("", $langs->trans("ProspectionArea"), $help_url);
62
63print load_fiche_titre($langs->trans("ProspectionArea"), '', 'propal');
64
65print '<div class="fichecenter">';
66print '<div class="fichethirdleft">';
67
68// This is useless due to the global search combo
69if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS))
70{
71	print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
72	print '<div class="div-table-responsive-no-min">';
73	print '<input type="hidden" name="token" value="'.newToken().'">';
74	print '<table class="noborder nohover centpercent">';
75
76	print '<tr class="liste_titre">';
77	print '<td colspan="3">'.$langs->trans("Search").'</td>';
78	print '</tr>';
79
80	print '<tr class="oddeven">';
81	print '<td>'.$langs->trans("Proposal").':</td>';
82	print '<td><input type="text" class="flat" name="sall" size=18></td>';
83	print '<td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
84	print '</tr>';
85
86	print '</table>';
87	print '</div>';
88	print '</form>';
89	print '<br>';
90}
91
92/*
93 * Statistics
94 */
95$listofstatus = array(Propal::STATUS_DRAFT, Propal::STATUS_VALIDATED, Propal::STATUS_SIGNED, Propal::STATUS_NOTSIGNED, Propal::STATUS_BILLED);
96
97$sql = "SELECT count(p.rowid) as nb, p.fk_statut as status";
98$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
99$sql .= ", ".MAIN_DB_PREFIX."propal as p";
100if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
101$sql .= " WHERE p.entity IN (".getEntity($propalstatic->element).")";
102$sql .= " AND p.fk_soc = s.rowid";
103if ($user->socid) $sql .= ' AND p.fk_soc = '.$user->socid;
104if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
105$sql .= " AND p.fk_statut IN (".implode(" ,", $listofstatus).")";
106$sql .= " GROUP BY p.fk_statut";
107$resql = $db->query($sql);
108if ($resql)
109{
110	$num = $db->num_rows($resql);
111	$i = 0;
112	$total = 0;
113	$totalinprocess = 0;
114	$dataseries = array();
115	$colorseries = array();
116	$vals = array();
117
118	while ($i < $num)
119	{
120		$obj = $db->fetch_object($resql);
121		if ($obj)
122		{
123			$vals[$obj->status] = $obj->nb;
124			$totalinprocess += $obj->nb;
125
126			$total += $obj->nb;
127		}
128		$i++;
129	}
130	$db->free($resql);
131
132	include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
133
134	print '<div class="div-table-responsive-no-min">';
135	print '<table class="noborder nohover centpercent">';
136
137	print '<tr class="liste_titre">';
138	print '<td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td>';
139	print '</tr>';
140
141	foreach ($listofstatus as $status) {
142		$dataseries[] = array($propalstatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
143		if ($status == Propal::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
144		if ($status == Propal::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1;
145		if ($status == Propal::STATUS_SIGNED) $colorseries[$status] = $badgeStatus4;
146		if ($status == Propal::STATUS_NOTSIGNED) $colorseries[$status] = $badgeStatus9;
147		if ($status == Propal::STATUS_BILLED) $colorseries[$status] = $badgeStatus6;
148
149		if (empty($conf->use_javascript_ajax)) {
150			print '<tr class="oddeven">';
151			print '<td>'.$propalstatic->LibStatut($status, 0).'</td>';
152			print '<td class="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status]) ? $vals[$status] : 0).'</a></td>';
153			print "</tr>\n";
154		}
155	}
156
157	if ($conf->use_javascript_ajax) {
158		print '<tr>';
159		print '<td align="center" colspan="2">';
160
161		include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
162		$dolgraph = new DolGraph();
163		$dolgraph->SetData($dataseries);
164		$dolgraph->SetDataColor(array_values($colorseries));
165		$dolgraph->setShowLegend(2);
166		$dolgraph->setShowPercent(1);
167		$dolgraph->SetType(array('pie'));
168		$dolgraph->setHeight('200');
169		$dolgraph->draw('idgraphthirdparties');
170		print $dolgraph->show($total ? 0 : 1);
171
172		print '</td>';
173		print '</tr>';
174	}
175
176	//if ($totalinprocess != $total)
177	//{
178	//	print '<tr class="liste_total">';
179	//	print '<td>'.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')</td>';
180	//	print '<td class="right">'.$totalinprocess.'</td>';
181	//	print '</tr>';
182	//}
183
184	print '<tr class="liste_total">';
185	print '<td>'.$langs->trans("Total").'</td>';
186	print '<td class="right">'.$total.'</td>';
187	print '</tr>';
188
189	print '</table>';
190	print '</div>';
191	print '<br>';
192} else {
193	dol_print_error($db);
194}
195
196
197/*
198 * Draft proposals
199 */
200if (!empty($conf->propal->enabled)) {
201	$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc";
202	$sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta";
203	$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
204	$sql .= ", ".MAIN_DB_PREFIX."societe as s";
205	if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
206	$sql .= " WHERE p.entity IN (".getEntity($propalstatic->element).")";
207	$sql .= " AND p.fk_soc = s.rowid";
208	$sql .= " AND p.fk_statut =".Propal::STATUS_DRAFT;
209	if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
210	if ($socid) $sql .= " AND p.fk_soc = ".$socid;
211
212	$resql = $db->query($sql);
213	if ($resql) {
214		$num = $db->num_rows($resql);
215		$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
216		startSimpleTable("DraftPropals", "comm/propal/list.php", "search_status=".Propal::STATUS_DRAFT, 2, $num);
217
218		if ($num) {
219			$total = 0;
220			$i = 0;
221
222			while ($i < $nbofloop) {
223				$obj = $db->fetch_object($resql);
224
225				$propalstatic->id = $obj->rowid;
226				$propalstatic->ref = $obj->ref;
227				$propalstatic->ref_client = $obj->ref_client;
228				$propalstatic->total_ht = $obj->total_ht;
229				$propalstatic->total_tva = $obj->total_tva;
230				$propalstatic->total_ttc = $obj->total_ttc;
231
232				$companystatic->id = $obj->socid;
233				$companystatic->name = $obj->name;
234				$companystatic->client = $obj->client;
235				$companystatic->code_client = $obj->code_client;
236				$companystatic->code_fournisseur = $obj->code_fournisseur;
237				$companystatic->canvas = $obj->canvas;
238				$companystatic->entity = $obj->entity;
239				$companystatic->email = $obj->email;
240				$companystatic->code_compta = $obj->code_compta;
241
242				print '<tr class="oddeven">';
243				print '<td class="nowrap">'.$propalstatic->getNomUrl(1).'</td>';
244				print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 16).'</td>';
245				print '<td class="nowrap right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
246				print '</tr>';
247
248				$i++;
249				$total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
250			}
251		}
252
253		addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
254		finishSimpleTable(true);
255		$db->free($resql);
256	} else {
257		dol_print_error($db);
258	}
259}
260
261print '</div>';
262
263print '<div class="fichetwothirdright">';
264print '<div class="ficheaddleft">';
265
266/*
267 * Last modified proposals
268 */
269
270$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, date_cloture as datec";
271$sql .= ", s.nom as socname, s.rowid as socid, s.canvas, s.client";
272$sql .= " FROM ".MAIN_DB_PREFIX."propal as c";
273$sql .= ", ".MAIN_DB_PREFIX."societe as s";
274if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
275$sql .= " WHERE c.entity IN (".getEntity($propalstatic->element).")";
276$sql .= " AND c.fk_soc = s.rowid";
277//$sql.= " AND c.fk_statut > 2";
278if ($socid) $sql .= " AND c.fk_soc = ".$socid;
279if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
280$sql .= " ORDER BY c.tms DESC";
281$sql .= $db->plimit($max, 0);
282
283$resql = $db->query($sql);
284if ($resql) {
285	$num = $db->num_rows($resql);
286	startSimpleTable($langs->trans("LastModifiedProposals", $max), "", "", 3);
287
288	if ($num) {
289		$i = 0;
290		while ($i < $num) {
291			$obj = $db->fetch_object($resql);
292
293			$propalstatic->id = $obj->rowid;
294			$propalstatic->ref = $obj->ref;
295
296			$companystatic->id = $obj->socid;
297			$companystatic->name = $obj->socname;
298			$companystatic->client = $obj->client;
299			$companystatic->canvas = $obj->canvas;
300
301			$filename = dol_sanitizeFileName($obj->ref);
302			$filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
303			$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
304
305			print '<tr class="oddeven">';
306
307			print '<td width="20%" class="nowrap">';
308			print '<table class="nobordernopadding">';
309			print '<tr class="nocellnopadd">';
310			print '<td width="96" class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).'</td>';
311			print '<td width="16" class="nobordernopadding nowrap"></td>';
312			print '<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).'</td>';
313			print '</tr>';
314			print '</table>';
315			print '</td>';
316
317			print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
318			print '<td>'.dol_print_date($db->jdate($obj->datec), 'day').'</td>';
319			print '<td class="right">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>';
320
321			print '</tr>';
322
323			$i++;
324		}
325	}
326
327	finishSimpleTable(true);
328	$db->free($resql);
329} else {
330	dol_print_error($db);
331}
332
333
334/*
335 * Open (validated) proposals
336 */
337if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
338	$sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client";
339	$sql .= ", p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
340	$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
341	$sql .= ", ".MAIN_DB_PREFIX."propal as p";
342	if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
343	$sql .= " WHERE p.fk_soc = s.rowid";
344	$sql .= " AND p.entity IN (".getEntity($propalstatic->element).")";
345	$sql .= " AND p.fk_statut = ".Propal::STATUS_VALIDATED;
346	if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
347	if ($socid) $sql .= " AND s.rowid = ".$socid;
348	$sql .= " ORDER BY p.rowid DESC";
349
350	$resql = $db->query($sql);
351	if ($resql) {
352		$total = 0;
353		$num = $db->num_rows($resql);
354		$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
355		startSimpleTable("ProposalsOpened", "comm/propal/list.php", "search_status=".Propal::STATUS_VALIDATED, 4, $num);
356
357		if ($num > 0) {
358			$i = 0;
359			while ($i < $nbofloop) {
360				$obj = $db->fetch_object($resql);
361
362				$propalstatic->id = $obj->propalid;
363				$propalstatic->ref = $obj->ref;
364
365				$companystatic->id = $obj->socid;
366				$companystatic->name = $obj->socname;
367				$companystatic->client = $obj->client;
368				$companystatic->canvas = $obj->canvas;
369
370				$filename = dol_sanitizeFileName($obj->ref);
371				$filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
372				$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
373
374				$warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ? img_warning($langs->trans("Late")) : '';
375
376				print '<tr class="oddeven">';
377
378				// Ref
379				print '<td class="nowrap" width="140">';
380				print '<table class="nobordernopadding">';
381				print '<tr class="nocellnopadd">';
382				print '<td class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).'</td>';
383				print '<td width="18" class="nobordernopadding nowrap">'.$warning.'</td>';
384				print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).'</td>';
385				print '</tr>';
386				print '</table>';
387				print '</td>';
388
389				print '<td class="left">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
390				print '<td class="right">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>';
391				print '<td class="right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
392				print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>';
393
394				print '</tr>';
395
396				$i++;
397				$total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
398			}
399		}
400
401		addSummaryTableLine(5, $num, $nbofloop, $total, "None", true);
402		finishSimpleTable(true);
403		$db->free($resql);
404	} else {
405		dol_print_error($db);
406	}
407}
408
409/*
410 * Proposals to process
411 */
412
413/*
414if (! empty($conf->propal->enabled))
415{
416	$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid";
417	$sql.=" FROM ".MAIN_DB_PREFIX."propal as c";
418	$sql.= ", ".MAIN_DB_PREFIX."societe as s";
419	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
420	$sql.= " WHERE c.fk_soc = s.rowid";
421	$sql.= " AND c.entity = ".$conf->entity;
422	$sql.= " AND c.fk_statut = 1";
423	if ($socid) $sql.= " AND c.fk_soc = ".$socid;
424	if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
425	$sql.= " ORDER BY c.rowid DESC";
426
427	$resql=$db->query($sql);
428	if ($resql)
429	{
430		$num = $db->num_rows($resql);
431
432		print '<div class="div-table-responsive-no-min">';
433		print '<table class="noborder centpercent">';
434		print '<tr class="liste_titre">';
435		print '<td colspan="3">'.$langs->trans("ProposalsToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status=1"><span class="badge">'.$num.'</span></a></td></tr>';
436
437		if ($num)
438		{
439			$i = 0;
440			while ($i < $num)
441			{
442
443				$obj = $db->fetch_object($resql);
444				print '<tr class="oddeven">';
445				print '<td class="nowrap">';
446
447				$propalstatic->id=$obj->rowid;
448				$propalstatic->ref=$obj->ref;
449
450				print '<table class="nobordernopadding"><tr class="nocellnopadd">';
451				print '<td width="96" class="nobordernopadding nowrap">';
452				print $propalstatic->getNomUrl(1);
453				print '</td>';
454
455				print '<td width="16" class="nobordernopadding nowrap">';
456				print '&nbsp;';
457				print '</td>';
458
459				print '<td width="16" class="nobordernopadding right">';
460				$filename=dol_sanitizeFileName($obj->ref);
461				$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
462				$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
463				print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
464				print '</td></tr></table>';
465
466				print '</td>';
467
468				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td>';
469
470				print '<td class="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
471
472				print '</tr>';
473				$i++;
474			}
475		}
476
477		print "</table>";
478		print "</div><br>";
479	}
480	else dol_print_error($db);
481}
482*/
483
484/*
485 * Proposal that are in a shipping process
486 */
487
488/*
489if (! empty($conf->propal->enabled))
490{
491	$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
492	$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
493	$sql.= ", ".MAIN_DB_PREFIX."societe as s";
494	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
495	$sql.= " WHERE c.fk_soc = s.rowid";
496	$sql.= " AND c.entity = ".$conf->entity;
497	$sql.= " AND c.fk_statut = 2 ";
498	if ($socid) $sql.= " AND c.fk_soc = ".$socid;
499	if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
500	$sql.= " ORDER BY c.rowid DESC";
501
502	$resql=$db->query($sql);
503	if ($resql)
504	{
505		$num = $db->num_rows($resql);
506
507		print '<div class="div-table-responsive-no-min">';
508		print '<table class="noborder centpercent">';
509		print '<tr class="liste_titre">';
510		print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status=2"><span class="badge">'.$num.'</span></a></td></tr>';
511
512		if ($num)
513		{
514			$i = 0;
515			while ($i < $num)
516			{
517
518				$obj = $db->fetch_object($resql);
519				print '<tr class="oddeven">';
520				print '<td width="20%" class="nowrap">';
521
522				$propalstatic->id=$obj->rowid;
523				$propalstatic->ref=$obj->ref;
524
525				print '<table class="nobordernopadding"><tr class="nocellnopadd">';
526				print '<td width="96" class="nobordernopadding nowrap">';
527				print $propalstatic->getNomUrl(1);
528				print '</td>';
529
530				print '<td width="16" class="nobordernopadding nowrap">';
531				print '&nbsp;';
532				print '</td>';
533
534				print '<td width="16" class="nobordernopadding right">';
535				$filename=dol_sanitizeFileName($obj->ref);
536				$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
537				$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
538				print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
539				print '</td></tr></table>';
540
541				print '</td>';
542
543				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
544
545				print '<td class="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
546
547				print '</tr>';
548				$i++;
549			}
550		}
551		print "</table>";
552		print "</div><br>";
553	}
554	else dol_print_error($db);
555}
556*/
557
558print '</div>';
559print '</div>';
560print '</div>';
561
562$parameters = array('user' => $user);
563$reshook = $hookmanager->executeHooks('dashboardPropals', $parameters, $object); // Note that $action and $object may have been modified by hook
564
565// End of page
566llxFooter();
567$db->close();
568