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

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

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

revision 1.7 by rodolphe, Tue Nov 22 18:26:28 2005 UTC revision 1.8 by rodolphe, Wed Nov 23 14:28:11 2005 UTC
# Line 146  $sql .= " WHERE l.fk_client_comm = s.idp Line 146  $sql .= " WHERE l.fk_client_comm = s.idp
146  $sql .= " AND s.idp = sp.fk_soc";  $sql .= " AND s.idp = sp.fk_soc";
147  $sql .= " AND sp.fk_user = ".$user->id." AND sp.pread = 1";  $sql .= " AND sp.fk_user = ".$user->id." AND sp.pread = 1";
148  $sql .= " GROUP BY s.idp";  $sql .= " GROUP BY s.idp";
149  $sql .= " ORDER BY s.datec DESC LIMIT 15";  $sql .= " ORDER BY s.datec DESC LIMIT 10";
150    
151  $resql = $db->query($sql);  $resql = $db->query($sql);
152  if ($resql)  if ($resql)
# Line 155  if ($resql) Line 155  if ($resql)
155    $i = 0;    $i = 0;
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>'.min(15,$num).' derniers nouveaux clients</td>';    print '<tr class="liste_titre"><td>'.min(10,$num).' derniers nouveaux clients</td>';
159    print '<td width="25%" align="center">Nb Lignes';    print '<td width="25%" align="center">Nb Lignes';
160    print "</td></tr>\n";    print "</td></tr>\n";
161    
# Line 188  else Line 188  else
188    print $db->error() . ' ' . $sql;    print $db->error() . ' ' . $sql;
189  }  }
190    
191    print "<br />";
192    /* Commentaires */
193    
194  print '</td></tr>';  $sql = "SELECT s.idp as socidp, s.nom, c.commentaire";
195    $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."telephonie_societe_commentaire as c";
196    $sql .= ",".MAIN_DB_PREFIX."societe_perms as sp";
197    
198    $sql .= " WHERE c.fk_soc = s.idp ";
199    $sql .= " AND s.idp = sp.fk_soc";
200    $sql .= " AND sp.fk_user = ".$user->id." AND sp.pread = 1";
201    $sql .= " ORDER BY c.datec DESC LIMIT 10";
202    
203  print '</table>';  $resql = $db->query($sql);
204    if ($resql)
205    {
206      print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
207      print '<tr class="liste_titre"><td>'.min(10,$num).' derniers commentaires</td>';
208      print '<td width="75%">Commentaire</td></tr>'."\n";
209      $var=True;
210    
211      while ($obj = $db->fetch_object($resql))
212        {
213          $var=!$var;
214          print "<tr $bc[$var]><td>";
215          print '<a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$obj->socidp.'">';
216          print img_file();      
217          print '</a>&nbsp;';
218          $nom = $obj->nom;
219          if (strlen($obj->nom) > 33)
220            $nom = substr($obj->nom,0,30)."...";
221          print '<a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$obj->socidp.'">'.stripslashes($nom).'</a></td>';
222          print '<td>'.stripslashes($obj->commentaire)."</td>\n";
223          print "</tr>\n";
224        }
225      print "</table>";
226      $db->free($resql);
227    }
228    else
229    {
230      print $db->error() . ' ' . $sql;
231    }
232    
233    print '</td></tr>';
234    print '</table>';
235    
236  $db->close();  $db->close();
237    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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