From 82494a3598360dc7b05a8b4bc1b79ff1731a2f21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Jan 2005 15:27:01 +0000 Subject: [PATCH] New: Ajout page accueil de l'espace utilisateurs et groupes pour le gestionnaire de menu eldy. --- htdocs/user/home.php | 162 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 htdocs/user/home.php diff --git a/htdocs/user/home.php b/htdocs/user/home.php new file mode 100644 index 00000000000..0e77bf27c6e --- /dev/null +++ b/htdocs/user/home.php @@ -0,0 +1,162 @@ + + * + * 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. + * + * $Id$ + * $Source$ + * + */ + +/** + \file htdocs/user/home.php + \brief Page acceuil de la zone utilisateurs et groupes + \version $Revision$ +*/ + +require("./pre.inc.php"); + +$langs->load("users"); + +$user->getrights('users'); + + + +llxHeader(); + + +print_titre($langs->trans("MenuUsersAndGroups")); + +print ''; + +print ''; +print '
'; + + +/* + * Recherche User + */ + $var=false; + print '
'; + print ''; + print ''; + print ''; + print "
Rechercher un utilisateur
'; + print $langs->trans("Ref").' :  

\n"; + +/* + * Recherche Group + */ + $var=false; + print '
'; + print ''; + print ''; + print ''; + print "
Rechercher un groupe
'; + print $langs->trans("Ref").' :  

\n"; + + +print '
'; + + +/* + * Derniers groupes créés + * + */ +$max=0; + +$sql = "SELECT g.rowid, g.nom, g.note, ".$db->pdate("g.datec")." as datec"; +$sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; +$sql .= " ORDER BY g.datec DESC"; +if ($max) $sql .= " LIMIT $max"; + +if ( $db->query($sql) ) +{ + $num = $db->num_rows(); + print ''; + print ''; + $var = true; + $i = 0; + + while ($i < $num && (! $max || $i < $max)) + { + $obj = $db->fetch_object(); + $var=!$var; + + print ""; + print ""; + print ""; + print ''; + $i++; + } + print "
'.$langs->trans("LastGroupsCreated").'
rowid\">".img_file()." "; + print "rowid\">$obj->nom".dolibarr_print_date($obj->datec,"%d %b %Y")."

"; + + $db->free(); +} +else +{ + dolibarr_print_error($db); +} + + +/* + * Derniers utilisateurs créés + * + */ +$max=5; + +$sql = "SELECT u.rowid, u.login, u.name, u.firstname, ".$db->pdate("u.datec")." as datec"; +$sql .= " FROM ".MAIN_DB_PREFIX."user as u"; +$sql .= " ORDER BY u.datec DESC limit $max"; + +if ( $db->query($sql) ) +{ + $num = $db->num_rows(); + print ''; + print ''; + $var = true; + $i = 0; + + while ($i < $num && $i < $max) + { + $obj = $db->fetch_object(); + $var=!$var; + + print ""; + print ""; + print ""; + print ''; + $i++; + } + print "
'.$langs->trans("LastUsersCreated",min($num,$max)).'
rowid\">".img_file()." "; + print "rowid\">$obj->firstname $obj->name".strftime("%d %b %Y",$obj->datec)."

"; + + $db->free(); +} +else +{ + dolibarr_print_error($db); +} + + + +print '
'; + +$db->close(); + + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?>