/[dolibarr]/dolibarr/htdocs/telephonie/stats/distributeurs/resultats.php
ViewVC logotype

Diff of /dolibarr/htdocs/telephonie/stats/distributeurs/resultats.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by rodolphe, Wed Nov 16 12:30:24 2005 UTC revision 1.5 by rodolphe, Wed Nov 16 12:33:38 2005 UTC
# Line 43  $h++; Line 43  $h++;
43    
44  $year = strftime("%Y",time());  $year = strftime("%Y",time());
45  $total = 0;  $total = 0;
46    $var = True;
47  dolibarr_fiche_head($head, $hselected, "Distributeurs");  dolibarr_fiche_head($head, $hselected, "Distributeurs");
48    
49  print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';  print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
# Line 88  $sql = "SELECT sum(valeur),legend FROM " Line 89  $sql = "SELECT sum(valeur),legend FROM "
89  $sql .= " WHERE graph = 'distributeur.gain.mensuel'";  $sql .= " WHERE graph = 'distributeur.gain.mensuel'";
90  $sql .= " GROUP BY legend DESC";    $sql .= " GROUP BY legend DESC";  
91  $resql = $db->query($sql);  $resql = $db->query($sql);
92      $total = 0;
93  if ($resql)  if ($resql)
94  {  {
95    while ($row = $db->fetch_row($resql))    while ($row = $db->fetch_row($resql))
96      {      {
       $var=!$var;          
97        print "<tr $bc[$var]><td>".$row[1].'</td>';          print "<tr $bc[$var]><td>".$row[1].'</td>';  
98        print '<td align="right">'.price($row[0]).'</td></tr>';        print '<td align="right">'.price($row[0]).'</td></tr>';
99          $total += $row[0];
100          $var=!$var;
101      }      }
102    $db->free();    $db->free();
103  }  }
# Line 103  else Line 105  else
105  {  {
106    print $db->error() . ' ' . $sql;    print $db->error() . ' ' . $sql;
107  }  }
108    print "<tr $bc[$var]><td>Total</td>";
109    print '<td align="right">'.price($total).'</td></tr>';
110  print '</table>';  print '</table>';
111    
112  print '</td></tr><tr><td valign="top" width="70%">';  print '</td></tr><tr><td valign="top" width="70%">';
# Line 117  $sql = "SELECT valeur,legend FROM ".MAIN Line 121  $sql = "SELECT valeur,legend FROM ".MAIN
121  $sql .= " WHERE graph = 'distributeur.commission.mensuel'";  $sql .= " WHERE graph = 'distributeur.commission.mensuel'";
122  $sql .= " GROUP BY legend DESC";    $sql .= " GROUP BY legend DESC";  
123  $resql = $db->query($sql);  $resql = $db->query($sql);
124      $total = 0;  
125    if ($resql)  if ($resql)
126      {  {
127        while ($row = $db->fetch_row($resql))    while ($row = $db->fetch_row($resql))
         {  
           $var=!$var;      
           print "<tr $bc[$var]><td>".$row[1].'</td>';    
           print '<td align="right">'.price($row[0]).'</td></tr>';  
         }  
       $db->free();  
     }  
   else  
128      {      {
129        print $db->error() . ' ' . $sql;        print "<tr $bc[$var]><td>".$row[1].'</td>';  
130          print '<td align="right">'.price($row[0]).'</td></tr>';
131          $total += $row[0];
132          $var=!$var;
133      }      }
134    print '</table>';    $db->free();
135    }
136    else
137    {
138      print $db->error() . ' ' . $sql;
139    }
140    print "<tr $bc[$var]><td>Total</td>";
141    print '<td align="right">'.price($total).'</td></tr>';
142    print '</table>';
143    
144    
145    print '</td></tr>';
146    print '</table>';
147    
148    print '</td></tr>';  $db->close();
   print '</table>';  
   
  $db->close();  
149    
150    
151  llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");  llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26