diff --git a/htdocs/telephonie/ca/gain.php b/htdocs/telephonie/ca/gain.php index 61f7d1ee7c2..934a251d2b0 100644 --- a/htdocs/telephonie/ca/gain.php +++ b/htdocs/telephonie/ca/gain.php @@ -35,17 +35,16 @@ llxHeader('','Telephonie - CA par client'); * * */ - -print_titre("CA par client cumulé"); - print ''; print '
'; - $page = $_GET["page"]; $sortorder = $_GET["sortorder"]; $sortfield = $_GET["sortfield"]; +$offset = $conf->liste_limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; if ($sortorder == "") $sortorder="DESC"; if ($sortfield == "") $sortfield="ca"; @@ -54,25 +53,24 @@ $sql = "SELECT nom, ca, gain, cout, marge"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_client_stats"; $sql .= " , " .MAIN_DB_PREFIX."societe"; $sql .= " WHERE idp = fk_client_comm"; -$sql .= " ORDER BY $sortfield $sortorder "; -$sql .= " LIMIT 30"; +$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); if ($db->query($sql)) { $num = $db->num_rows(); $i = 0; - $ligne = new LigneTel($db); + + print_barre_liste("CA cumulé par client", $page, "gain.php", $urladd, $sortfield, $sortorder, '', $num); print ''; print ''; print ''; - print_liste_field_titre("Marge","gain.php","marge"); - + print_liste_field_titre("Marge","gain.php","marge",'','','align="right"'); print "\n"; $var=True; - while ($i < $num) + while ($i < min($num,$conf->liste_limit)) { $row = $db->fetch_row($i); $var=!$var;
ClientChiffre d\'affaireGain