dolibarr/htdocs/main.inc.php3

202 lines
5.4 KiB
PHP
Raw Normal View History

2002-04-30 12:56:25 +02:00
<?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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-26 02:03:47 +02:00
* $Id$
* $Source$
*
2002-04-30 12:56:25 +02:00
*/
require ($GLOBALS["DOCUMENT_ROOT"]."/conf/conf.class.php3");
require ($GLOBALS["DOCUMENT_ROOT"]."/lib/mysql.lib.php3");
require ($GLOBALS["DOCUMENT_ROOT"]."/lib/functions.inc.php3");
2002-06-28 18:09:48 +02:00
require ($GLOBALS["DOCUMENT_ROOT"]."/product.class.php3");
2002-06-26 02:03:47 +02:00
require ($GLOBALS["DOCUMENT_ROOT"]."/user.class.php3");
2002-05-09 16:57:48 +02:00
require ($GLOBALS["DOCUMENT_ROOT"]."/menu.class.php3");
2002-06-26 02:03:47 +02:00
require ($GLOBALS["DOCUMENT_ROOT"]."/societe.class.php3");
2002-12-22 20:37:00 +01:00
require ($GLOBALS["DOCUMENT_ROOT"]."/html.form.class.php");
2002-07-29 12:26:12 +02:00
require ($GLOBALS["DOCUMENT_ROOT"]."/rtplang.class.php");
2002-05-09 16:57:48 +02:00
2002-04-30 12:56:25 +02:00
$conf = new Conf();
$db = new Db();
2002-07-29 12:26:12 +02:00
2002-04-30 12:56:25 +02:00
$user = new User($db);
2002-07-29 12:26:12 +02:00
2002-04-30 12:56:25 +02:00
$user->fetch($GLOBALS["REMOTE_USER"]);
2002-07-29 12:26:12 +02:00
if ($user->limite_liste <> $conf->liste_limit) {
$conf->liste_limit = $user->limite_liste;
}
2002-05-09 16:57:48 +02:00
$db->close();
2002-07-29 12:26:12 +02:00
/*
*/
if(!isset($application_lang))
$application_lang = "fr";
2002-04-30 12:56:25 +02:00
2002-10-01 10:53:09 +02:00
$rtplang = new rtplang($GLOBALS["DOCUMENT_ROOT"]."/langs", "en", "en", $application_lang);
2002-07-29 12:26:12 +02:00
$rtplang->debug=1;
/*
*/
2002-05-06 21:10:48 +02:00
$bc[0]="class=\"impair\"";
$bc[1]="class=\"pair\"";
2002-05-09 16:57:48 +02:00
$a = setlocale("LC_TIME", "FRENCH");
2002-04-30 12:56:25 +02:00
2002-05-04 01:01:45 +02:00
function top_menu($head) {
2002-07-29 12:26:12 +02:00
global $user, $conf, $rtplang;
print $rtplang->lang_header();
2002-05-04 01:01:45 +02:00
print "<HTML><HEAD>";
print $head;
2002-07-29 12:26:12 +02:00
print '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">';
2002-05-04 23:28:42 +02:00
print '<LINK REL="stylesheet" TYPE="text/css" HREF="/'.$conf->css.'">';
2002-07-29 12:26:12 +02:00
print "\n";
2002-05-11 18:15:14 +02:00
print '<title>Dolibarr</title>';
2002-07-29 12:26:12 +02:00
print "\n";
2002-05-04 01:01:45 +02:00
print "</HEAD>\n";
2002-05-09 16:57:48 +02:00
print '<BODY TOPMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">';
2002-05-06 21:10:48 +02:00
/*
* Barre superieure
*
*/
2002-05-04 01:01:45 +02:00
2002-12-30 23:50:00 +01:00
print '<TABLE class="topbarre" width="100%">';
2002-05-04 01:01:45 +02:00
print "<TR>";
2002-05-06 21:10:48 +02:00
print '<TD width="15%" class="menu" align="center"><A class="menu" href="/">Accueil</A></TD>';
2002-05-04 01:01:45 +02:00
2002-05-06 21:10:48 +02:00
print '<TD width="15%" class="menu" align="center">';
2002-12-20 00:13:48 +01:00
if ($user->comm > 0 && $conf->commercial )
{
print '<A class="menu" href="/comm/">Commercial</A></TD>';
}
else
{
print '-';
}
2002-05-04 01:01:45 +02:00
2002-05-06 21:10:48 +02:00
print '<TD width="15%" class="menu" align="center">';
2002-12-12 17:42:08 +01:00
if ($user->compta > 0)
{
print '<A class="menu" href="/compta/">Compta</A></TD>';
}
else
{
print '-';
}
2002-05-04 01:01:45 +02:00
2002-05-09 16:57:48 +02:00
print '<TD width="15%" class="menu" align="center">';
2002-12-20 00:17:19 +01:00
if ($conf->produit->enabled )
{
print '<A class="menu" href="/product/">Produits</a>';
}
else
{
print '-';
}
print '</td><td width="15%" class="menu" align="center">';
2002-05-11 20:25:26 +02:00
if ($conf->webcal->enabled) {
print '<a class="menu" href="'.$conf->webcal->url.'">Calendrier</a>';
};
print '&nbsp;</TD>';
2002-07-03 14:46:00 +02:00
print '<TD width="15%" class="menu" align="center">'.strftime(" %d %B - %H:%M",time()).'</TD>';
2002-05-06 21:10:48 +02:00
2002-12-30 23:50:00 +01:00
print '<TD width="10%" class="menu" align="center">'.$user->login.'</td>';
2002-05-06 21:10:48 +02:00
print '</TR>';
print '</table>';
/*
* Table principale
*
*/
2002-05-09 16:57:48 +02:00
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="3">';
print "<TR><TD valign=\"top\" align=\"right\">";
}
2002-12-12 17:42:08 +01:00
function left_menu($menu)
{
2002-05-09 16:57:48 +02:00
global $conf;
/*
* Colonne de gauche
*
*/
2002-12-30 21:35:06 +01:00
print '<TABLE class="leftmenu" border="0" width="100%" cellspacing="1" cellpadding="4">';
2002-05-09 16:57:48 +02:00
2002-12-12 17:42:08 +01:00
for ($i = 0 ; $i < sizeof($menu) ; $i++)
{
2002-05-09 16:57:48 +02:00
2002-12-12 17:42:08 +01:00
print "<TR><TD class=\"barre\" valign=\"top\">";
2002-12-30 21:35:06 +01:00
print '<A class="leftmenu" href="'.$menu[$i][0].'">'.$menu[$i][1].'</a>';
2002-05-09 16:57:48 +02:00
2002-12-12 17:42:08 +01:00
for ($j = 2 ; $j < sizeof($menu[$i]) - 1 ; $j = $j +2)
{
print '<br>&nbsp;-&nbsp;<a class="submenu" href="'.$menu[$i][$j].'">'.$menu[$i][$j+1].'</A>';
}
print '</td></tr>';
2002-05-09 16:57:48 +02:00
}
print "<TR><TD class=\"barre\" valign=\"top\" align=\"right\">";
2002-05-10 14:28:10 +02:00
print '<A class="menu" href="/comm/clients.php3">Societes</A>';
2002-12-12 17:42:08 +01:00
print '<form action="/comm/clients.php3">';
2002-05-09 16:57:48 +02:00
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="soc">';
print '<input type="text" name="socname" size="8">&nbsp;';
print "<input type=\"submit\" value=\"go\">";
print "</form>";
print '<A class="menu" href="/comm/contact.php3">Contacts</A>';
print '<form action="/comm/contact.php3">';
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="contact">';
print "<input type=\"text\" name=\"contactname\" size=\"8\">&nbsp;";
print "<input type=\"submit\" value=\"go\">";
print '</form>';
print '</td></tr>';
2002-12-30 21:35:06 +01:00
print '</table>';
2002-05-09 16:57:48 +02:00
/*
*
*
*/
print "</TD>\n<TD valign=\"top\" width=\"85%\">\n";
2002-05-04 01:01:45 +02:00
}
2002-04-30 12:56:25 +02:00
2002-12-12 17:42:08 +01:00
function llxFooter($foot='')
{
2002-05-09 16:57:48 +02:00
print "</TD></TR>";
/*
*
*/
print "</TABLE>\n";
2002-07-29 12:26:12 +02:00
print "<div>";
2002-05-09 16:57:48 +02:00
print '[<a href="http://savannah.gnu.org/bugs/?group_id=1915">Bug report</a>]&nbsp;';
2002-07-29 12:26:12 +02:00
print '[<a href="http://savannah.gnu.org/projects/dolibarr/">Source Code</a>]&nbsp;'.$foot.'</div>';
2002-05-09 16:57:48 +02:00
print "</BODY></HTML>";
}
2002-04-30 12:56:25 +02:00
?>