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