[ 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/script/ -> tarifs-commerciaux-grille.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: tarifs-commerciaux-grille.php,v 1.1 2005/10/17 08:07:24 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/script/tarifs-commerciaux-grille.php,v $
  20   *
  21   * Affecte aux contrats la grille de tarif spécifiaque a un
  22   * commercial
  23   *
  24   */
  25  require  ("../../master.inc.php");
  26  $error = 0;
  27  
  28  /*
  29   * Lecture des lignes
  30   *
  31   */
  32  $comms = array();
  33  
  34  $sql = "SELECT fk_grille, fk_commercial";
  35  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_tarif_grille_commerciaux";
  36    
  37  if ($db->query($sql))
  38  {
  39    while($row = $db->fetch_row($resql))
  40      {
  41        $comms[$row[0]] = $row[1];
  42      }
  43    $db->free($resql);
  44  }
  45  
  46  foreach ($comms as $key => $value)
  47  {
  48    $sql = "UPDATE ".MAIN_DB_PREFIX."telephonie_contrat";
  49    $sql .= " SET grille_tarif = '".$key."'";
  50    $sql .= " WHERE fk_commercial_sign = '".$value."';";
  51  
  52    $resql = $db->query($sql);
  53    
  54    if (!$resql)
  55      {
  56        print "Erreur";
  57      }
  58  }
  59  ?>


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