2004-10-20 23:06:45 +02:00
|
|
|
|
<?php
|
2004-07-05 14:46:12 +02:00
|
|
|
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2005-01-03 20:21:51 +01:00
|
|
|
|
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
2002-04-29 21:47:03 +02:00
|
|
|
|
*
|
|
|
|
|
|
* 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 2 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, write to the Free Software
|
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
*
|
2002-06-20 21:25:15 +02:00
|
|
|
|
* $Id$
|
|
|
|
|
|
* $Source$
|
|
|
|
|
|
*
|
2002-04-29 19:53:37 +02:00
|
|
|
|
*/
|
2005-01-03 20:21:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
\file htdocs/index.php
|
|
|
|
|
|
\brief Page accueil par defaut
|
|
|
|
|
|
\version $Revision$
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2003-09-11 22:18:51 +02:00
|
|
|
|
require("./pre.inc.php");
|
2002-04-29 19:53:37 +02:00
|
|
|
|
|
2005-01-03 20:21:51 +01:00
|
|
|
|
|
|
|
|
|
|
// Simule le menu par d<>faut sur Home
|
|
|
|
|
|
$_GET["mainmenu"]="home";
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-04-29 19:53:37 +02:00
|
|
|
|
llxHeader();
|
2003-02-11 14:24:02 +01:00
|
|
|
|
|
2004-07-25 17:31:16 +02:00
|
|
|
|
$userstring=$user->prenom . ' ' . $user->nom .' ['.$user->code.']';
|
|
|
|
|
|
print_fiche_titre($langs->trans("WelcomeString",dolibarr_print_date(mktime(),"%A %d %B %Y"),$userstring), '<a href="about.php">'.$langs->trans("About").'</a>');
|
|
|
|
|
|
|
2004-07-26 16:38:34 +02:00
|
|
|
|
if (defined("MAIN_MOTD") && strlen(trim(MAIN_MOTD)))
|
|
|
|
|
|
{
|
|
|
|
|
|
print "<br>".nl2br(MAIN_MOTD);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2004-06-26 19:43:07 +02:00
|
|
|
|
print "<br>\n";
|
2002-04-29 19:53:37 +02:00
|
|
|
|
|
2005-01-03 20:21:51 +01:00
|
|
|
|
|
2003-02-13 17:58:48 +01:00
|
|
|
|
/*
|
|
|
|
|
|
* Boites
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
2003-08-06 11:12:47 +02:00
|
|
|
|
$user->getrights('');
|
2003-02-13 17:58:48 +01:00
|
|
|
|
|
2005-01-18 22:51:04 +01:00
|
|
|
|
$sql = "SELECT b.rowid, b.box_id, d.file";
|
|
|
|
|
|
$sql .= " FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as d";
|
|
|
|
|
|
$sql .= " WHERE b.box_id = d.rowid";
|
|
|
|
|
|
$sql .= " AND position = 0"; // 0 = valeur pour la page accueil
|
|
|
|
|
|
$sql .= " ORDER BY box_order";
|
2003-02-13 17:58:48 +01:00
|
|
|
|
$result = $db->query($sql);
|
|
|
|
|
|
if ($result)
|
|
|
|
|
|
{
|
|
|
|
|
|
$num = $db->num_rows();
|
2003-02-13 18:15:40 +01:00
|
|
|
|
$j = 0;
|
2003-02-13 17:58:48 +01:00
|
|
|
|
|
2003-02-13 18:15:40 +01:00
|
|
|
|
while ($j < $num)
|
2003-02-13 17:58:48 +01:00
|
|
|
|
{
|
2004-10-23 23:02:56 +02:00
|
|
|
|
$obj = $db->fetch_object($result);
|
2003-02-13 18:15:40 +01:00
|
|
|
|
$boxes[$j] = "includes/boxes/".$obj->file;
|
|
|
|
|
|
$j++;
|
2003-02-13 17:58:48 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2005-01-18 22:51:04 +01:00
|
|
|
|
else {
|
|
|
|
|
|
dolibarr_print_error($db);
|
|
|
|
|
|
}
|
2003-06-17 18:00:53 +02:00
|
|
|
|
|
|
|
|
|
|
print '<table width="100%">';
|
2003-02-13 18:15:40 +01:00
|
|
|
|
|
|
|
|
|
|
for ($ii=0, $ni=sizeof($boxes); $ii<$ni; $ii++)
|
|
|
|
|
|
{
|
2003-07-24 13:56:55 +02:00
|
|
|
|
if ($ii % 2 == 0)
|
2003-06-17 18:00:53 +02:00
|
|
|
|
{
|
|
|
|
|
|
print "<tr>\n";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2003-11-09 18:24:14 +01:00
|
|
|
|
print '<td valign="top" width="50%">';
|
2003-02-13 18:15:40 +01:00
|
|
|
|
include($boxes[$ii]);
|
2003-06-17 18:00:53 +02:00
|
|
|
|
print "</td>";
|
|
|
|
|
|
|
|
|
|
|
|
if ( ($ii -1) / 3 == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
}
|
2003-02-13 18:15:40 +01:00
|
|
|
|
}
|
2003-02-13 17:58:48 +01:00
|
|
|
|
|
2003-06-17 18:00:53 +02:00
|
|
|
|
print "</table>";
|
|
|
|
|
|
|
2003-02-13 17:58:48 +01:00
|
|
|
|
$db->close();
|
2002-04-29 19:53:37 +02:00
|
|
|
|
|
2002-05-10 14:04:12 +02:00
|
|
|
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
2002-04-29 19:53:37 +02:00
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|