From f85c0639542a264dbe54bd39ad2432588eaab07d Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 1 Jun 2005 15:40:25 +0000 Subject: [PATCH] Suppression des commerciaux des distributeurs --- htdocs/telephonie/stats/commerciaux/index.php | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/htdocs/telephonie/stats/commerciaux/index.php b/htdocs/telephonie/stats/commerciaux/index.php index e552ea4a5ee..13803a4aaec 100644 --- a/htdocs/telephonie/stats/commerciaux/index.php +++ b/htdocs/telephonie/stats/commerciaux/index.php @@ -49,24 +49,24 @@ $h++; dolibarr_fiche_head($head, $hselected, "Commerciaux"); print ''; - print '';
'; - - /* */ -print ''; -print ''; -print ''; - $sql = "SELECT count(*) as cc , c.name, c.firstname, c.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; $sql .= " , ".MAIN_DB_PREFIX."user as c"; +$sql .= " LEFT JOIN llx_telephonie_distributeur_commerciaux as dc ON dc.fk_user = c.rowid"; + $sql .= " WHERE c.rowid = l.fk_commercial_suiv"; $sql .= " AND l.statut <> 7"; +$sql .= " AND dc.fk_distributeur IS NULL"; $sql .= " GROUP BY c.name ORDER BY cc DESC"; +print '
Lignes suivies
NomNb Lignes 
'; +print ''; +print ''; + $resql = $db->query($sql); if ($resql) { @@ -74,7 +74,7 @@ if ($resql) $i = 0; $datas = array(); $legends = array(); - + $total = 0; while ($i < $num) { $row = $db->fetch_row($i); @@ -87,6 +87,7 @@ if ($resql) print ''.$row[2]." ". $row[1].''; print ''; + $total += $row[0]; $i++; } $db->free(); @@ -95,6 +96,10 @@ else { print $db->error() . ' ' . $sql; } +$var=!$var; +print ""; +print ''; +print ''; print '
Lignes suivies
NomNb Lignes 
'.$row[0].'Voir
Total'.$total.' 

'; print ''; @@ -104,8 +109,10 @@ print ''; print ''; + $total += $row[0]; $i++; } $db->free(); @@ -136,6 +144,10 @@ else { print $db->error() . ' ' . $sql; } +$var=!$var; +print ""; +print ''; +print ''; print '
Nomquery($sql); @@ -115,7 +122,7 @@ if ($resql) $i = 0; $datas = array(); $legends = array(); - + $total= 0 ; while ($i < $num) { $row = $db->fetch_row($i); @@ -128,6 +135,7 @@ if ($resql) print ''.$row[2]." ". $row[1].''.$row[0].'Voir
Total'.$total.' 
'; print '