dolibarr/htdocs/index.php

114 lines
2.4 KiB
PHP
Raw Normal View History

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
$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);
}
print "<br>\n";
2002-04-29 19:53:37 +02:00
2005-01-03 20:21:51 +01:00
/*
* Boites
*
*/
2003-08-06 11:12:47 +02:00
$user->getrights('');
$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";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
2003-02-13 18:15:40 +01:00
$j = 0;
2003-02-13 18:15:40 +01:00
while ($j < $num)
{
$obj = $db->fetch_object($result);
2003-02-13 18:15:40 +01:00
$boxes[$j] = "includes/boxes/".$obj->file;
$j++;
}
}
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";
}
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-06-17 18:00:53 +02:00
print "</table>";
$db->close();
2002-04-29 19:53:37 +02:00
2002-05-10 14:04:12 +02:00
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
2002-04-29 19:53:37 +02:00
?>