Modif du tri par défaut
This commit is contained in:
parent
f6812904d2
commit
96e5927a2b
@ -159,15 +159,12 @@ $offset = $conf->liste_limit * $page ;
|
|||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mode Liste
|
* Mode Liste
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
print_barre_liste("Liste des clients", $page, $PHP_SELF,"",$sortfield,$sortorder);
|
|
||||||
|
|
||||||
$sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm FROM llx_societe as s, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.client=1";
|
$sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm FROM llx_societe as s, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.client=1";
|
||||||
|
|
||||||
@ -189,16 +186,18 @@ if ($user->societe_id)
|
|||||||
if ($socname)
|
if ($socname)
|
||||||
{
|
{
|
||||||
$sql .= " AND lower(s.nom) like '%".strtolower($socname)."%'";
|
$sql .= " AND lower(s.nom) like '%".strtolower($socname)."%'";
|
||||||
$sortfield = "lower(s.nom)";
|
$sortfield = "s.datec";
|
||||||
$sortorder = "ASC";
|
$sortorder = "DESC";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
|
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
|
print_barre_liste("Liste des clients", $page, $PHP_SELF,"",$sortfield,$sortorder,'',$num);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if ($sortorder == "DESC")
|
if ($sortorder == "DESC")
|
||||||
@ -218,7 +217,7 @@ if ($result)
|
|||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
$var=True;
|
$var=True;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < min($num,$conf->liste_limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object( $i);
|
$obj = $db->fetch_object( $i);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user