[ 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: commercial.php,v 1.3 2005/05/30 08:39:02 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/distributeurs/commercial.php,v $ 20 * 21 */ 22 require ("./pre.inc.php"); 23 24 if (!$user->rights->telephonie->lire) accessforbidden(); 25 26 llxHeader('','Telephonie - Statistiques - Distributeurs'); 27 28 /* 29 * 30 * 31 * 32 */ 33 34 $h = 0; 35 36 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/distributeurs/index.php'; 37 $head[$h][1] = "Global"; 38 $h++; 39 40 if ($_GET["id"]) 41 { 42 $comm = new User($db, $_GET["id"]); 43 $comm->fetch(); 44 45 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/distributeurs/commercial.php?id='.$comm->id; 46 $head[$h][1] = $comm->fullname; 47 $hselected = $h; 48 $h++; 49 50 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/distributeurs/commercialca.php?id='.$comm->id; 51 $head[$h][1] = "CA"; 52 $h++; 53 54 dolibarr_fiche_head($head, $hselected, "Distributeurs"); 55 56 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 57 58 print '<tr><td width="30%" valign="top">'; 59 60 61 /* 62 * 63 * 64 */ 65 print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; 66 print '<tr class="liste_titre">'; 67 print '<td>Date</td><td align="right">Prise d\'ordre</td></tr>'; 68 69 $sql = "SELECT sum(p.montant), date_format(p.datepo, '%m/%Y')"; 70 $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat_priseordre as p"; 71 72 $sql .= " WHERE p.fk_commercial = ".$_GET["id"]; 73 $sql .= " GROUP BY date_format(p.datepo, '%y%m') DESC"; 74 75 $resql = $db->query($sql); 76 77 if ($resql) 78 { 79 $num = $db->num_rows(); 80 $i = 0; 81 $total = 0; 82 83 while ($i < $num) 84 { 85 $row = $db->fetch_row($i); 86 $var=!$var; 87 print "<tr $bc[$var]>"; 88 print '<td>'.$row[1].'</a></td>'; 89 print '<td align="right">'.price($row[0]).'</td></tr>'; 90 $i++; 91 } 92 $db->free(); 93 } 94 else 95 { 96 print $db->error() . ' ' . $sql; 97 } 98 99 100 101 print '</table><br />'; 102 103 104 /* 105 * 106 */ 107 print '</td><td valign="top" width="70%">'; 108 109 print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=commercials/'.$comm->id.'/clients.hebdomadaire.png" alt="Commandes de lignes par semaine" title="Lignes Actives"><br /><br />'."\n"; 110 111 print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=commercials/'.$comm->id.'/clientsmoyenne.hebdomadaire.png" alt="Commandes de lignes par semaine" title="Lignes Actives"><br /><br />'."\n"; 112 113 print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=commercials/'.$comm->id.'/lignes.commandes.hebdomadaire.png" alt="Commandes de lignes par semaine" title="Lignes Actives"><br /><br />'."\n"; 114 115 print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=commercials/'.$comm->id.'/lignes.commandes.mensuels.png" alt="Commandes de ligne par mois" title="Lignes Actives"><br /><br />'."\n"; 116 117 print '</td></tr>'; 118 print '</table>'; 119 120 $db->close(); 121 } 122 123 llxFooter("<em>Dernière modification $Date: 2005/05/30 08:39:02 $ révision $Revision: 1.3 $</em>"); 124 ?>
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 |
![]() |