From 8c5d7a92488e04215dacbb157b3e1d74c025db20 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 27 Jan 2005 16:53:41 +0000 Subject: [PATCH] Modif affichage --- htdocs/telephonie/ca/gain.php | 37 ++++++++++++++++------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/htdocs/telephonie/ca/gain.php b/htdocs/telephonie/ca/gain.php index 6b9d6eb637f..79df434008d 100644 --- a/htdocs/telephonie/ca/gain.php +++ b/htdocs/telephonie/ca/gain.php @@ -21,9 +21,6 @@ */ require("./pre.inc.php"); -$page = $_GET["page"]; -$sortorder = $_GET["sortorder"]; - /* * Sécurité accés client */ @@ -33,7 +30,6 @@ if ($user->societe_id > 0) accessforbidden(); llxHeader('','Telephonie - CA par client'); - /* * * @@ -46,11 +42,20 @@ print ''; print '
'; -$sql = "SELECT nom, ca, gain"; + +$page = $_GET["page"]; +$sortorder = $_GET["sortorder"]; +$sortfield = $_GET["sortfield"]; + +if ($sortorder == "") $sortorder="DESC"; +if ($sortfield == "") $sortfield="ca"; + +$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 .= " GROUP BY gain DESC"; +$sql .= " ORDER BY $sortfield $sortorder "; +$sql .= " LIMIT 30"; if ($db->query($sql)) { @@ -61,10 +66,13 @@ if ($db->query($sql)) print ''; print ''; print ''; + + print_liste_field_titre("Marge","gain.php","marge"); + print "\n"; $var=True; - while ($i < min($num,$conf->liste_limit)) + while ($i < $num) { $row = $db->fetch_row($i); $var=!$var; @@ -73,6 +81,7 @@ if ($db->query($sql)) print "\n"; print '\n"; print '\n"; + print '\n"; print "\n"; $i++; } @@ -84,23 +93,11 @@ else print $db->error() . ' ' . $sql; } -print ''; - -print ''; - print '
ClientChiffre d\'affaireGain
".$row[0]."'.price($row[1])." HT'.price($row[2])." HT'.round($row[4])." %
'; - -print 'GraphCa
'; - +//print 'Gain moyen par client

'; print '
'; - - - -print '
'; - - $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$");