[ 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: groupe.php,v 1.1 2005/05/04 13:13:32 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/commerciaux/groupes/groupe.php,v $ 20 * 21 */ 22 require ("./pre.inc.php"); 23 24 if (!$user->rights->telephonie->lire) accessforbidden(); 25 26 llxHeader('','Telephonie - Statistiques - Commerciaux'); 27 28 /* 29 * 30 * 31 * 32 */ 33 34 $h = 0; 35 36 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/commerciaux/index.php'; 37 $head[$h][1] = "Global"; 38 $hselected = $h; 39 $h++; 40 41 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/commerciaux/mensuel.php'; 42 $head[$h][1] = "Mensuel"; 43 $h++; 44 45 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/commerciaux/contrats.php'; 46 $head[$h][1] = "Contrats"; 47 $h++; 48 49 dolibarr_fiche_head($head, $hselected, "Commerciaux"); 50 51 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; 52 53 print '<tr><td width="30%" valign="top">'; 54 55 print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; 56 print '<tr class="liste_titre"><td valign="top">Nom</td></tr>'; 57 58 $sql = "SELECT rowid, nom"; 59 $sql .= " FROM ".MAIN_DB_PREFIX."usergroup"; 60 $sql .= " ORDER BY nom ASC"; 61 62 $resql = $db->query($sql); 63 if ($resql) 64 { 65 $num = $db->num_rows(); 66 $i = 0; 67 while ($i < $num) 68 { 69 $row = $db->fetch_row($resql); 70 71 $var=!$var; 72 73 print "<tr $bc[$var]>"; 74 75 print '<td width="50%" valign="top">'; 76 print '<a href="groupe.php?id='.$row[0]; 77 print '">'.$row[2]." ". $row[1].'</a></td></tr>'; 78 79 $i++; 80 } 81 $db->free(); 82 } 83 else 84 { 85 print $db->error() . ' ' . $sql; 86 } 87 print '</table><br />'; 88 89 /* */ 90 91 print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; 92 print '<tr class="liste_titre"><td width="50%" valign="top">Nom</td><td align="center">Nb Lignes</td></tr>'; 93 94 $sql = "SELECT count(*) as cc , c.name, c.firstname, c.rowid"; 95 $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; 96 $sql .= " , ".MAIN_DB_PREFIX."user as c"; 97 $sql .= " , ".MAIN_DB_PREFIX."usergroup_user as ug"; 98 $sql .= " WHERE c.rowid = l.fk_commercial_sign"; 99 $sql .= " AND ug.fk_usergroup = ".$_GET["id"]; 100 $sql .= " AND ug.fk_user = c.rowid"; 101 $sql .= " AND l.statut <> 7"; 102 $sql .= " GROUP BY c.name ORDER BY cc DESC"; 103 104 $resql = $db->query($sql); 105 if ($resql) 106 { 107 $num = $db->num_rows(); 108 $i = 0; 109 $datas = array(); 110 $legends = array(); 111 112 while ($i < $num) 113 { 114 $row = $db->fetch_row($i); 115 116 $var=!$var; 117 118 print "<tr $bc[$var]>"; 119 120 print '<td width="50%" valign="top">'; 121 print '<a href="../commercial.php?commid='.$row[3]; 122 print '">'.$row[2]." ". $row[1].'</a></td><td align="center">'.$row[0].'</td></tr>'; 123 $i++; 124 } 125 $db->free(); 126 } 127 else 128 { 129 print $db->error() . ' ' . $sql; 130 } 131 print '</table><br />'; 132 133 134 135 print '</td>'; 136 137 print '</td><td valign="top" width="70%">'; 138 139 print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=commerciaux/groupes/'.$_GET["id"].'/gain.mensuel.png"><br /><br />'."\n"; 140 141 142 print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=commerciaux/groupes/'.$_GET["id"].'/ca.mensuel.png"><br /><br />'."\n"; 143 144 print '</td></tr>'; 145 print '</table>'; 146 147 $db->close(); 148 149 llxFooter("<em>Dernière modification $Date: 2005/05/04 13:13:32 $ révision $Revision: 1.1 $</em>"); 150 ?>
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 |
![]() |