[ 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: rentabilite.php,v 1.2 2005/02/08 10:05:04 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/communications/rentabilite.php,v $ 20 * 21 */ 22 require ("./pre.inc.php"); 23 24 $page = $_GET["page"]; 25 $sortorder = $_GET["sortorder"]; 26 27 if (!$user->rights->telephonie->lire) 28 accessforbidden(); 29 30 llxHeader('','Telephonie - Statistiques'); 31 32 /* 33 * Sécurité accés client 34 */ 35 if ($user->societe_id > 0) 36 { 37 $action = ''; 38 $socidp = $user->societe_id; 39 } 40 41 $h = 0; 42 43 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/communications/index.php'; 44 $head[$h][1] = "Global"; 45 $h++; 46 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/communications/lastmonth.php'; 47 $head[$h][1] = "Durée"; 48 $h++; 49 50 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/communications/destmonth.php'; 51 $head[$h][1] = "Destinations"; 52 $h++; 53 54 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/communications/rentabilite.php'; 55 $head[$h][1] = "Rentabilite"; 56 $hselected = $h; 57 $h++; 58 59 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/communications/analyse.php'; 60 $head[$h][1] = "Analyse"; 61 $h++; 62 63 dolibarr_fiche_head($head, $hselected, "Communications"); 64 65 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 66 67 print '<tr><td valign="top">'; 68 69 $sql = "SELECT date_format(date, '%Y%m'), avg(cout_vente)"; 70 $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_communications_details"; 71 $sql .= " GROUP BY date_format(date, '%Y%m') DESC"; 72 73 if ($db->query($sql)) 74 { 75 $num = $db->num_rows(); 76 $i = 0; 77 $ligne = new LigneTel($db); 78 79 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 80 print '<tr class="liste_titre"><td>Mois</td><td align="right">Marge</td>'; 81 print "</tr>\n"; 82 $var=True; 83 84 while ($i < $num) 85 { 86 $row = $db->fetch_row(); 87 88 $var=!$var; 89 90 print "<tr $bc[$var]>"; 91 print '<td>'.$row[0].'</td>'."\n"; 92 print '<td align="right">'.round($row[1],4)."</td>\n"; 93 94 95 print "</tr>\n"; 96 $i++; 97 } 98 print "</table>"; 99 $db->free(); 100 } 101 else 102 { 103 print $db->error() . ' ' . $sql; 104 } 105 106 107 print '</td><td valign="top">'; 108 109 110 111 print '</td></tr>'; 112 113 print '</table>'; 114 115 $db->close(); 116 117 llxFooter("<em>Dernière modification $Date: 2005/02/08 10:05:04 $ révision $Revision: 1.2 $</em>"); 118 ?>
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 |
![]() |