diff --git a/htdocs/comm/clients.php b/htdocs/comm/clients.php index 415cc7a0c02..43e0e6d34ba 100644 --- a/htdocs/comm/clients.php +++ b/htdocs/comm/clients.php @@ -21,7 +21,8 @@ * */ -/** \file htdocs/comm/clients.php +/** + \file htdocs/comm/clients.php \ingroup commercial, societe \brief Liste des clients \version $Revision$ @@ -80,14 +81,8 @@ if ($socname) $sortorder = "ASC"; } -if ($sortorder == "") -{ - $sortorder="ASC"; -} -if ($sortfield == "") -{ - $sortfield="s.nom"; -} +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="s.nom"; $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset); @@ -95,7 +90,7 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $result = $db->query($sql); if ($result) { - $num = $db->num_rows(); + $num = $db->num_rows($result); llxHeader(); @@ -107,14 +102,16 @@ if ($result) print ''; print ''; print_liste_field_titre($langs->trans("Company"),"clients.php","s.nom",$addu,"","",$sortfield); - print_liste_field_titre($langs->trans("CustomerCode"),"clients.php","s.code_client",$addu,"","",$sortfield); print_liste_field_titre($langs->trans("Town"),"clients.php","s.ville",$addu,"","",$sortfield); + print_liste_field_titre($langs->trans("CustomerCode"),"clients.php","s.code_client",$addu,"","",$sortfield); + print_liste_field_titre($langs->trans("DateCreation"),"clients.php","datec",$addu,"","",$sortfield); print "\n"; print ''; print ''; print ''; - print "\n"; - print "\n"; + print ''; + print ''; + print ''; print '
 
'; print ''; + print ' '; print ''; print ''; print ' '; @@ -133,8 +130,9 @@ if ($result) print ''; print img_object($langs->trans("ShowCustomer"),"company"); print ' '.stripslashes($obj->nom).'".$obj->code_client." ".$obj->ville." '.$obj->ville.''.$obj->code_client.''.dolibarr_print_date($obj->datec).''; if (defined("MAIN_MODULE_DOSSIER") && MAIN_MODULE_DOSSIER == 1) { @@ -150,7 +148,7 @@ if ($result) $i++; } print "
"; - $db->free(); + $db->free($result); } else {