diff --git a/htdocs/comm/contact.php3 b/htdocs/comm/contact.php3 index ae33808e36a..33188ef22f3 100644 --- a/htdocs/comm/contact.php3 +++ b/htdocs/comm/contact.php3 @@ -48,36 +48,45 @@ print_barre_liste("Liste des contacts",$page, $PHP_SELF); $sql = "SELECT s.idp, s.nom, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email, p.phone "; $sql .= "FROM societe as s, socpeople as p, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.idp = p.fk_soc"; -if (strlen($stcomm)) { +if (strlen($stcomm)) // statut commercial +{ $sql .= " AND s.fk_stcomm=$stcomm"; } -if (strlen($begin)) { +if (strlen($begin)) // filtre sur la premiere lettre du nom +{ $sql .= " AND upper(p.name) like '$begin%'"; } -if ($contactname) { - $sql .= " AND lower(p.name) like '%".strtolower($contactname)."%'"; +if ($contactname) // acces a partir du module de recherche +{ + $sql .= " AND ( lower(p.name) like '%".strtolower($contactname)."%' OR lower(p.firstname) like '%".strtolower($contactname)."%') "; $sortfield = "lower(p.name)"; $sortorder = "ASC"; } -if ($socid) { +if ($socid) +{ $sql .= " AND s.idp = $socid"; } $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset); $result = $db->query($sql); -if ($result) { + +if ($result) +{ $num = $db->num_rows(); $i = 0; - if ($sortorder == "DESC") { - $sortorder="ASC"; - } else { - $sortorder="DESC"; - } + if ($sortorder == "DESC") + { + $sortorder="ASC"; + } + else + { + $sortorder="DESC"; + } print "

"; print ""; print ""; @@ -87,27 +96,28 @@ if ($result) { print ''; print "\n"; $var=True; - while ($i < $num) { - $obj = $db->fetch_object( $i); + while ($i < $num) + { + $obj = $db->fetch_object( $i); - $var=!$var; + $var=!$var; - print ""; + print ""; - print ""; - print ""; - - print '\n"; - - print ''; - - print ''; - - print "\n"; - print "\n"; - $i++; - } + print ""; + print ""; + + print '\n"; + + print ''; + + print ''; + + print "\n"; + print "\n"; + $i++; + } print "
NomTéléphone 
$obj->name$obj->firstname '; - print "idp\">$obj->nom'.$obj->email.' '.$obj->phone.' idp&setcontact=$obj->cidp&action=create\">[Propal]
$obj->name$obj->firstname '; + print "idp\">$obj->nom'.$obj->email.' '.$obj->phone.' idp&setcontact=$obj->cidp&action=create\">[Propal]
"; $db->free(); } else { diff --git a/htdocs/main.inc.php3 b/htdocs/main.inc.php3 index 7c3fa3f47b6..6efd7b74b91 100644 --- a/htdocs/main.inc.php3 +++ b/htdocs/main.inc.php3 @@ -93,11 +93,14 @@ function top_menu($head) { } print ''; - if ($user->compta > 0) { - print 'Compta'; - } else { - print '-'; - } + if ($user->compta > 0) + { + print 'Compta'; + } + else + { + print '-'; + } print ''; @@ -123,7 +126,8 @@ function top_menu($head) { print ""; } -function left_menu($menu) { +function left_menu($menu) +{ global $conf; /* * Colonne de gauche @@ -134,21 +138,23 @@ function left_menu($menu) { print ''; - for ($i = 0 ; $i < sizeof($menu) ; $i++) { + for ($i = 0 ; $i < sizeof($menu) ; $i++) + { - print "'; + } - print ''; - - } print ""; /* *
"; - print ''.$menu[$i][1].''; + print "
"; + print ''.$menu[$i][1].''; - for ($j = 2 ; $j < sizeof($menu[$i]) - 1 ; $j = $j +2) { - print '
 - '.$menu[$i][$j+1].''; + for ($j = 2 ; $j < sizeof($menu[$i]) - 1 ; $j = $j +2) + { + print '
 - '.$menu[$i][$j+1].''; + } + print '
"; print 'Societes'; - print '
'; + print ''; print ''; print ''; print ' '; @@ -174,7 +180,8 @@ function left_menu($menu) { } -function llxFooter($foot='') { +function llxFooter($foot='') +{ print "