[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/telephonie/distributeurs/ -> contrat.php (source)

   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: contrat.php,v 1.5 2005/09/14 14:24:47 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/distributeurs/contrat.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  if (!$user->rights->telephonie->lire) accessforbidden();
  25  
  26  if ($user->distributeur_id && $user->responsable_distributeur_id == 0)
  27  {
  28    accessforbidden();
  29  }
  30  
  31  llxHeader('','Telephonie - Statistiques - Distributeurs');
  32  
  33  /*
  34   *
  35   *
  36   *
  37   */
  38  
  39  $did = $_GET["id"];
  40  
  41  if ($user->distributeur_id)
  42  {
  43    $did = $user->distributeur_id;
  44  }
  45  
  46  $h = 0;
  47  
  48    $distri = new DistributeurTelephonie($db);
  49    $distri->fetch($did);
  50  
  51    $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/distributeur.php?id='.$distri->id;
  52    $head[$h][1] = $distri->nom;
  53    $h++;
  54  
  55    $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/contrat.php?id='.$distri->id;
  56    $head[$h][1] = "Contrat";
  57    $hselected = $h;
  58    $h++;
  59  
  60    $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/remuneration.php?id='.$distri->id;
  61    $head[$h][1] = "Rémunérations";
  62    $h++;
  63  
  64    $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/po.php?id='.$distri->id;
  65    $head[$h][1] = "Prises d'ordre";
  66    $h++;
  67  
  68    $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/stats.php?id='.$distri->id;
  69    $head[$h][1] = "Statistiques";
  70    $h++;
  71  
  72  
  73  dolibarr_fiche_head($head, $hselected, "Distributeurs");
  74  
  75  print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  76  
  77  print '<tr><td width="50%" valign="top">';
  78  
  79  print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
  80  print '<tr class="liste_titre">';
  81  print '<td>Distributeur</td><td>Durée avan.</td><td>% Avance</td><td>% Prélèv</td><td>% Autre</td></tr>';
  82  
  83  $sql = "SELECT d.nom, d.rowid, d.avance_pourcent, d.rem_pour_prev, d.rem_pour_autr, d.avance_duree";
  84  
  85  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_distributeur as d";
  86  $sql .= " WHERE d.rowid = ".$did;
  87  $sql .= " ORDER BY d.rowid ASC";
  88  
  89  $resql = $db->query($sql);
  90  
  91  if ($resql)
  92  {
  93    $num = $db->num_rows();
  94    $i = 0;
  95    $total = 0;
  96  
  97    while ($i < $num)
  98      {
  99        $row = $db->fetch_row($i);    
 100  
 101        $var=!$var;
 102  
 103        print "<tr $bc[$var]>";
 104  
 105        print '<td><a href="distributeur.php?id='.$row[1].'">'.$row[0].'</a></td>';
 106        print '<td>'.$row[5].'</td>';
 107        print '<td>'.$row[2].'</td>';
 108        print '<td>'.$row[3].'</td>';
 109        print '<td>'.$row[4].'</td>';
 110        print '</tr>';
 111        $i++;
 112      }
 113    $db->free();
 114  }
 115  else 
 116  {
 117    print $db->error() . ' ' . $sql;
 118  }
 119  print '</table><br />';
 120  
 121  print '</td><td width="50%" valign="top">&nbsp;</td></tr>';
 122  print '</table></div>';
 123  
 124  $db->close();
 125  
 126  llxFooter("<em>Derni&egrave;re modification $Date: 2005/09/14 14:24:47 $ r&eacute;vision $Revision: 1.5 $</em>");
 127  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics