[ 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: stat.php,v 1.6 2005/10/06 09:02:09 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/ligne/stat.php,v $ 20 * 21 */ 22 23 require ("./pre.inc.php"); 24 25 llxHeader("","","Fiche Ligne"); 26 27 if ($_GET["id"] or $_GET["numero"]) 28 { 29 $ligne = new LigneTel($db); 30 if ($_GET["id"]) 31 { 32 $result = $ligne->fetch_by_id($_GET["id"]); 33 } 34 if ($_GET["numero"]) 35 { 36 $result = $ligne->fetch($_GET["numero"]); 37 } 38 39 if ($result == 1) 40 { 41 $client_comm = new Societe($db); 42 $client_comm->fetch($ligne->client_comm_id, $user); 43 } 44 45 if (!$client_comm->perm_read) 46 { 47 print "Lecture non authorisée"; 48 } 49 50 51 if ($result == 1 && $client_comm->perm_read) 52 { 53 if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') 54 { 55 56 $h=0; 57 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/fiche.php?id=".$ligne->id; 58 $head[$h][1] = $langs->trans("Ligne"); 59 $h++; 60 61 if ($user->rights->telephonie->facture->lire) 62 { 63 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/factures.php?id=".$ligne->id; 64 $head[$h][1] = $langs->trans('Factures'); 65 $h++; 66 } 67 68 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/infoc.php?id=".$ligne->id; 69 $head[$h][1] = $langs->trans('Infos'); 70 $h++; 71 72 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/history.php?id=".$ligne->id; 73 $head[$h][1] = $langs->trans('Historique'); 74 $h++; 75 76 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/conso.php?id=".$ligne->id; 77 $head[$h][1] = $langs->trans('Conso'); 78 $h++; 79 80 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/stat.php?id=".$ligne->id; 81 $head[$h][1] = $langs->trans('Stats'); 82 $hselected = $h; 83 $h++; 84 85 dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero); 86 87 print_fiche_titre('Fiche Ligne', $mesg); 88 89 print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; 90 91 print '<tr><td width="25%">Numéro</td><td>'.dolibarr_print_phone($ligne->numero).'</td>'; 92 print '<td>Facturée : '.$ligne->facturable.'</td><td> </td></tr>'; 93 94 $client = new Societe($db, $ligne->client_id); 95 $client->fetch($ligne->client_id); 96 97 print '<tr><td width="25%">Client</td><td>'; 98 99 print '<a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$ligne->client_id.'">'; 100 print $client->nom.'</a></td>'; 101 102 $client_facture = new Societe($db); 103 $client_facture->fetch($ligne->client_facture_id); 104 105 print '<td width="25%">Client Facturé</td><td>'.$client_facture->nom.'</td></tr>'; 106 107 print '<tr><td width="25%">Statut</td><td colspan="3">'; 108 print '<img src="./graph'.$ligne->statut.'.png"> '; 109 print $ligne->statuts[$ligne->statut]; 110 print "</td></tr></table>"; 111 112 /* 113 * 114 * 115 */ 116 117 print '<table class="border" cellpadding="3" cellspacing="0" width="100%">'; 118 119 print '<tr><td width="50%" valign="top" align="center">'; 120 121 $mesg_no_graph = 'Nous avons pas assez de données à ce jour pour générer ce graphique.'; 122 123 $img_root = DOL_DATA_ROOT."/graph/".substr($ligne->id,-1)."/telephonie/ligne/"; 124 125 $file = $img_root.$ligne->id."/graphca.png"; 126 127 if (file_exists($file)) 128 { 129 print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">'; 130 } 131 else 132 { 133 print $mesg_no_graph; 134 } 135 136 print '</td><td width="50%" valign="top" align="center">'; 137 138 $file = $img_root.$ligne->id."/graphgain.png"; 139 if (file_exists($file) && $user->rights->telephonie->ligne->gain) 140 { 141 print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">'; 142 } 143 else 144 { 145 print $mesg_no_graph; 146 } 147 148 print '</td></tr>'; 149 150 print '<tr><td width="50%" valign="top" align="center">'; 151 152 $file = $img_root.$ligne->id."/graphappelsdureemoyenne.png"; 153 154 if (file_exists($file)) 155 { 156 print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">'; 157 } 158 else 159 { 160 print $mesg_no_graph; 161 } 162 163 print '</td><td width="50%" valign="top" align="center">'; 164 print " "; 165 print '</td></tr>'; 166 print '<tr><td width="50%" valign="top" align="center">'; 167 168 $file = $img_root.$ligne->id."/nb-comm-mensuel.png"; 169 170 if (file_exists($file)) 171 { 172 print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">'; 173 } 174 else 175 { 176 print $mesg_no_graph; 177 } 178 179 print '</td><td width="50%" valign="top" align="center">'; 180 181 $file = $img_root.$ligne->id."/nb-minutes-mensuel.png"; 182 183 if (file_exists($file)) 184 { 185 print '<img src="'.DOL_URL_ROOT.'/telephonie/showgraph.php?graph='.$file.'" alt="CA Mensuel">'; 186 } 187 else 188 { 189 print $mesg_no_graph; 190 } 191 192 print '</td></tr></table>'; 193 194 } 195 } 196 197 } 198 else 199 { 200 print "Error"; 201 } 202 203 204 /* ************************************************************************** */ 205 /* */ 206 /* Barre d'action */ 207 /* */ 208 /* ************************************************************************** */ 209 210 211 $db->close(); 212 213 llxFooter("<em>Dernière modification $Date: 2005/10/06 09:02:09 $ révision $Revision: 1.6 $</em>"); 214 ?>
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 |
![]() |