/[dolibarr]/dolibarr/htdocs/telephonie/index.php
ViewVC logotype

Diff of /dolibarr/htdocs/telephonie/index.php

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

revision 1.10 by rodolphe, Tue Sep 6 14:17:02 2005 UTC revision 1.11 by rodolphe, Tue Oct 18 12:48:05 2005 UTC
# Line 60  print '</table></form>'; Line 60  print '</table></form>';
60    
61  print '<br />';  print '<br />';
62    
63    
64    
65    
66    print '</td><td width="30%" valign="top">';
67    
68  $sql = "SELECT distinct statut, count(*) as cc";  $sql = "SELECT distinct statut, count(*) as cc";
69  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l";  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
70  $sql .= ",".MAIN_DB_PREFIX."societe_perms as sp";  $sql .= ",".MAIN_DB_PREFIX."societe_perms as sp";
# Line 101  else Line 106  else
106    print $db->error() . ' ' . $sql;    print $db->error() . ' ' . $sql;
107  }  }
108    
109    print '</td><td width="40%" valign="top">';
110    
111    print '</td></tr>';
112    
113    print '<tr><td colspan="3">';
114    
115  if ($user->rights->telephonie->fournisseur->lire)  if ($user->rights->telephonie->fournisseur->lire)
116  {  {
117    print '<br />';    print '<br />';
# Line 109  if ($user->rights->telephonie->fournisse Line 120  if ($user->rights->telephonie->fournisse
120     * Fournisseurs     * Fournisseurs
121     *     *
122     */     */
123        $statuts = array();
124      $sql = "SELECT count(*), l.fk_fournisseur, l.statut";
125      $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
126      $sql .= " ,".MAIN_DB_PREFIX."societe_perms as sp";
127      $sql .= " WHERE l.fk_client_comm = sp.fk_soc";
128      $sql .= " AND sp.fk_user = ".$user->id." AND sp.pread = 1";
129      $sql .= " GROUP BY l.fk_fournisseur, l.statut";
130      $resql = $db->query($sql);
131    
132      if ($resql)
133        {
134          while ($row = $db->fetch_row($resql))
135            {
136              $statuts[$row[1]][$row[2]] = $row[0];
137            }
138        }
139    
140    $sql = "SELECT distinct f.nom as fournisseur, f.rowid, count(*) as cc";    $sql = "SELECT distinct f.nom as fournisseur, f.rowid, count(*) as cc";
141    $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";    $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
142    $sql .= " ,".MAIN_DB_PREFIX."telephonie_societe_ligne as l";    $sql .= " ,".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
# Line 129  if ($user->rights->telephonie->fournisse Line 156  if ($user->rights->telephonie->fournisse
156                
157        print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';        print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
158        print '<tr class="liste_titre"><td>Fournisseur</td><td align="center">Nb lignes</td>';        print '<tr class="liste_titre"><td>Fournisseur</td><td align="center">Nb lignes</td>';
159          for ($j = -1 ; $j < 8 ; $j++)
160            {
161              print '<td align="center"><img border="0" src="./ligne/graph'.$j.'.png"></td>';
162            }
163        print "</tr>\n";        print "</tr>\n";
164        $var=True;        $var=True;
165                
166        while ($i < min($num,$conf->liste_limit))        while ($i < min($num,$conf->liste_limit))
167          {          {
168            $obj = $db->fetch_object($resql);                $obj = $db->fetch_object($resql);
169            $var=!$var;            $var=!$var;
170                        
171            print "<tr $bc[$var]>";            print "<tr $bc[$var]>";
172            print '<td><a href="'.DOL_URL_ROOT.'/telephonie/ligne/liste.php?fournisseur='.$obj->rowid.'">';            print '<td><a href="'.DOL_URL_ROOT.'/telephonie/ligne/liste.php?fournisseur='.$obj->rowid.'">';
173            print $obj->fournisseur.'</a></td>';            print $obj->fournisseur.'</a></td>';
174            print '<td align="center">'.$obj->cc."</td>\n";            print '<td align="center">'.$obj->cc."</td>\n";
175              
176              for ($k = -1 ; $k < 8 ; $k++)
177                {
178                  print '<td align="center">'.$statuts[$obj->rowid][$k].'</td>';
179                }
180    
181            print "</tr>\n";            print "</tr>\n";
182            $i++;            $i++;
183          }          }
# Line 152  if ($user->rights->telephonie->fournisse Line 189  if ($user->rights->telephonie->fournisse
189        print $db->error() . ' ' . $sql;        print $db->error() . ' ' . $sql;
190      }      }
191  }  }
 print '</td><td width="70%" valign="top">';  
192    
193  print '</td></tr>';  print '</td></tr>';
194  print '</table>';  print '</table>';

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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