[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 * $Id: index.php,v 1.7 2005/08/24 08:55:11 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/clients/index.php,v $ 20 * 21 */ 22 require ("./pre.inc.php"); 23 24 if (!$user->rights->telephonie->lire) accessforbidden(); 25 if (!$user->rights->telephonie->stats->lire) accessforbidden(); 26 27 llxHeader('','Telephonie - Statistiques - Clients'); 28 29 30 $h = 0; 31 32 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/clients/index.php'; 33 $head[$h][1] = "Global"; 34 $hselected = $h; 35 $h++; 36 37 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/clients/gain.php'; 38 $head[$h][1] = "Gain"; 39 $h++; 40 41 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/clients/alerte.php'; 42 $head[$h][1] = "Alerte"; 43 $h++; 44 45 dolibarr_fiche_head($head, $hselected, "Clients"); 46 47 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 48 49 print '<tr><td width="30%" valign="top">'; 50 51 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 52 print '<tr class="liste_titre"><td>Statistiques</td><td valign="center">Nb</td>'; 53 print "</tr>\n"; 54 55 $sql = "SELECT distinct l.fk_client_comm "; 56 $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; 57 $sql .= " WHERE statut = 3"; 58 59 if ($db->query($sql)) 60 { 61 $num = $db->num_rows(); 62 $i = 0; 63 $nbclient = $num; 64 65 $var=True; 66 67 $row = $db->fetch_row(0); 68 69 print "<tr $bc[$var]>"; 70 print "<td>Nombre de clients</td>\n"; 71 print "<td>".$num."</td></tr>\n"; 72 73 $db->free(); 74 } 75 else 76 { 77 print $db->error() . ' ' . $sql; 78 } 79 80 $sql = "SELECT count(*) "; 81 $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; 82 $sql .= " WHERE statut = 3"; 83 84 if ($db->query($sql)) 85 { 86 $num = $db->num_rows(); 87 $i = 0; 88 89 $var=False; 90 91 $row = $db->fetch_row(0); 92 93 $nblignes = $row[0]; 94 95 print "<tr $bc[$var]>"; 96 print "<td>Nombre de lignes</td>\n"; 97 print "<td>".$row[0]."</td>\n"; 98 print "</tr>\n"; 99 100 101 $db->free(); 102 } 103 else 104 { 105 print $db->error() . ' ' . $sql; 106 } 107 108 print "<tr $bc[True]>"; 109 print "<td>Nombre de lignes par clients</td>\n"; 110 print "<td>".round($nblignes / $nbclient, 2)."</td>\n"; 111 print "</tr>\n"; 112 113 print "</table>"; 114 115 /* 116 * 117 * 118 */ 119 120 print '</td><td>'; 121 122 print '<img src="'.DOL_URL_ROOT.'/showgraph.php?graph='.DOL_DATA_ROOT.'/graph/telephonie/commercials/clients.hebdomadaire.png" alt="Nouveaux clients par semaines" title="Nouveaux clients par semaine"><br /><br />'."\n"; 123 124 print '<img src="'.DOL_URL_ROOT.'/showgraph.php?graph='.DOL_DATA_ROOT.'/graph/telephonie/commercials/clients.mensuel.png" alt="Nouveaux clients par mois" title="Nouveaux clients par mois"><br /><br />'."\n"; 125 126 print '</td></tr>'; 127 128 print '</table>'; 129 130 $db->close(); 131 132 llxFooter("<em>Dernière modification $Date: 2005/08/24 08:55:11 $ révision $Revision: 1.7 $</em>"); 133 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |