[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 2004-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: stats.php,v 1.4 2005/10/31 10:01:36 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/client/stats.php,v $ 20 * 21 */ 22 23 require ("./pre.inc.php"); 24 25 $mesg = ''; 26 27 llxHeader("","Téléphonie - Client"); 28 29 if ($cancel == $langs->trans("Cancel")) 30 { 31 $action = ''; 32 } 33 /* 34 * Affichage 35 * 36 */ 37 38 if ($_GET["id"]) 39 { 40 $soc = new Societe($db); 41 $result = $soc->fetch($_GET["id"], $user); 42 43 if (!$soc->perm_read) 44 { 45 print "Lecture non authorisée"; 46 } 47 48 if ( $result == 1 && $soc->perm_read) 49 { 50 if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') 51 { 52 $h=0; 53 $head[$h][0] = DOL_URL_ROOT."/telephonie/client/fiche.php?id=".$soc->id; 54 $head[$h][1] = $langs->trans("Contrats"); 55 $h++; 56 57 $head[$h][0] = DOL_URL_ROOT."/telephonie/client/lignes.php?id=".$soc->id; 58 $head[$h][1] = $langs->trans("Lignes"); 59 $h++; 60 61 $head[$h][0] = DOL_URL_ROOT."/telephonie/client/factures.php?id=".$soc->id; 62 $head[$h][1] = $langs->trans("Factures"); 63 $h++; 64 65 $head[$h][0] = DOL_URL_ROOT."/telephonie/client/stats.php?id=".$soc->id; 66 $head[$h][1] = $langs->trans("Stats"); 67 $hselected = $h; 68 $h++; 69 70 $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."telephonie_tarif_client"; 71 $sql .= " WHERE fk_client = '".$soc->id."';"; 72 $resql = $db->query($sql); 73 74 if ($resql) 75 { 76 $row = $db->fetch_row($resql); 77 $db->free($resql); 78 } 79 80 $head[$h][0] = DOL_URL_ROOT."/telephonie/client/tarifs.php?id=".$soc->id; 81 $head[$h][1] = $langs->trans("Tarifs (".$row[0].")"); 82 $h++; 83 84 dolibarr_fiche_head($head, $hselected, 'Client : '.$soc->nom); 85 86 print '<table class="border" cellpadding="3" cellspacing="0" width="100%">'; 87 print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td>'; 88 print '<td>'.$soc->code_client.'</td></tr>'; 89 90 print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"2\">".nl2br($soc->adresse)."<br>".$soc->cp." ".$soc->ville." ".$soc->pays."</td></tr>"; 91 92 93 print '</table><br />'; 94 print '<table class="border" cellpadding="3" cellspacing="0" width="100%">'; 95 96 print '<tr><td width="50%" valign="top" align="center">'; 97 98 $mesg_no_graph = 'Nous avons pas assez de données à ce jour pour générer ce graphique.'; 99 100 $img_root = DOL_DATA_ROOT."/graph/".substr($soc->id,-1)."/telephonie/client/"; 101 102 $file = $img_root.$soc->id."/graphca.png"; 103 104 if (file_exists($file)) 105 { 106 print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">'; 107 } 108 else 109 { 110 print $mesg_no_graph; 111 } 112 113 print '</td><td width="50%" valign="top" align="center">'; 114 115 $file = $img_root.$soc->id."/graphgain.png"; 116 if (file_exists($file) && $user->rights->telephonie->ligne->gain) 117 { 118 print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">'; 119 } 120 else 121 { 122 print $mesg_no_graph; 123 } 124 125 print '</td></tr>'; 126 print '<tr><td width="50%" valign="top" align="center">'; 127 128 $file = $img_root.$soc->id."/nb-minutes-mensuel.png"; 129 130 if (file_exists($file)) 131 { 132 print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">'; 133 } 134 else 135 { 136 print $mesg_no_graph; 137 } 138 139 print '</td><td width="50%" valign="top" align="center">'; 140 141 $file = $img_root.$soc->id."/nb-comm-mensuel.png"; 142 143 if (file_exists($file)) 144 { 145 print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">'; 146 } 147 else 148 { 149 print $mesg_no_graph; 150 } 151 print '</td></tr>'; 152 print '<tr><td width="50%" valign="top" align="center">'; 153 154 $file = $img_root.$soc->id."/graphappelsdureemoyenne.png"; 155 156 if (file_exists($file)) 157 { 158 print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="Duree moyenne">'; 159 } 160 else 161 { 162 print $mesg_no_graph; 163 } 164 165 print '</td><td width="50%" valign="top" align="center">'; 166 167 $file = $img_root.$soc->id."/nb-comm-menTOTOsuel.png"; 168 169 if (file_exists($file)) 170 { 171 //print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">'; 172 } 173 else 174 { 175 //print $mesg_no_graph; 176 } 177 print '</td></tr></table>'; 178 } 179 } 180 } 181 else 182 { 183 print "Error"; 184 } 185 186 print '</div>'; 187 188 /* ************************************************************************** */ 189 /* */ 190 /* Barre d'action */ 191 /* */ 192 /* ************************************************************************** */ 193 194 $db->close(); 195 196 llxFooter("<em>Dernière modification $Date: 2005/10/31 10:01:36 $ révision $Revision: 1.4 $</em>"); 197 ?>
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 |
![]() |