[ 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: index.php,v 1.5 2005/08/24 08:55:11 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/contrats/index.php,v $ 20 * 21 */ 22 require ("./pre.inc.php"); 23 24 if (!$user->rights->telephonie->lire) accessforbidden(); 25 if (!$user->rights->telephonie->stats->lire) accessforbidden(); 26 27 llxHeader('','Telephonie - Statistiques - Contrats'); 28 29 /* 30 * 31 * 32 */ 33 34 include "./onglets.php"; 35 dolibarr_fiche_head($head, $hselected, "Contrats"); 36 37 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 38 39 print '<tr><td valign="top" width="50%">'; 40 41 print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=contrats/modereglement.png" alt="Mode de réglement" title="Mode de réglement"><br /><br />'."\n"; 42 43 print '</td><td valign="top" width="50%">'; 44 45 $sql = "SELECT date_format(f.date, '%Y%m'), sum(f.cout_vente), c.mode_paiement"; 46 47 $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_facture as f"; 48 $sql .= " , ".MAIN_DB_PREFIX."telephonie_contrat as c"; 49 $sql .= " , ".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; 50 51 $sql .= " WHERE f.fk_ligne = l.rowid"; 52 $sql .= " AND l.fk_contrat = c.rowid"; 53 $sql .= " AND c.isfacturable = 'oui'"; 54 $sql .= " GROUP BY date_format(f.date, '%Y%m'), c.mode_paiement"; 55 $sql .= " ORDER BY date_format(f.date, '%Y%m') DESC"; 56 $sql .= " LIMIT 10"; 57 $resql = $db->query($sql); 58 59 print '<table class="border" width="100%">'; 60 print '<tr><td>Mois</td><td align="right">Montant</td><td align="center">Mode</td></tr>'; 61 if ($resql) 62 { 63 $num = $db->num_rows(); 64 $i = 0; 65 66 while ($i < $num) 67 { 68 $row = $db->fetch_row($resql); 69 70 print '<tr><td>'.$row[0].'</td>'; 71 print '<td align="right">'.sprintf("%01.2f",$row[1]).'</td>'; 72 print '<td align="center">'.$row[2].'</td></tr>'; 73 74 $i++; 75 } 76 } 77 print '</table>'; 78 79 /* 80 * 81 * 82 */ 83 84 print '</td></tr>'; 85 print '</table>'; 86 87 $db->close(); 88 89 llxFooter("<em>Dernière modification $Date: 2005/08/24 08:55:11 $ révision $Revision: 1.5 $</em>"); 90 ?>
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 |
![]() |