[ 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/ -> fiche.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: fiche.php,v 1.3 2005/09/05 14:37:15 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/distributeurs/fiche.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  if (!$user->rights->telephonie->lire) accessforbidden();
  25  
  26  $distri = new DistributeurTelephonie($db);
  27  $commercial = new CommercialTelephonie($db);
  28  
  29  if($_POST["action"] == 'add')
  30  {
  31    $distri->nom = $_POST["nom"];
  32    $distri->avance = $_POST["avance"];
  33    $distri->duree = $_POST["duree"];
  34    $distri->prelev = $_POST["prelev"];
  35    $distri->autre = $_POST["autre"];
  36  
  37    if ($distri->create() <> 0)
  38      {
  39        $_GET["action"] = "create";
  40      }
  41    else
  42      {
  43        Header("Location: index.php");
  44      }
  45  }
  46  
  47  if($_POST["action"] == 'add_commercial' && $user->admin)
  48  {
  49    $commercial->nom = $_POST["nom"];
  50    $commercial->prenom = $_POST["prenom"];
  51    $commercial->distri = $_GET["distri"];
  52    $commercial->email = $_POST["email"];
  53    
  54    if ($commercial->create() <> 0)
  55      {
  56        $_GET["action"] = "create_commercial";
  57      }
  58    else
  59      {
  60        Header("Location: distributeur.php?id=".$_GET["distri"]);
  61      }
  62  }
  63  
  64  llxHeader('','Telephonie - Statistiques - Distributeurs');
  65  
  66  /*
  67   *
  68   *
  69   *
  70   */
  71  
  72  $h = 0;
  73  
  74  
  75  if ($_GET["action"] == 'create_commercial')
  76  {
  77    $distri = new DistributeurTelephonie($db);
  78    $distri->fetch($_GET["distri"]);
  79  
  80  
  81    $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/fiche.php?action=create';
  82    $head[$h][1] = "Nouveau commercial";
  83    $hselected = $h;
  84    $h++;
  85    
  86    dolibarr_fiche_head($head, $hselected, $distri->nom);
  87  
  88    print '<form method="POST" action="fiche.php?distri='.$_GET["distri"].'">';
  89    print '<input type="hidden" name="action" value="add_commercial"></td></tr>';
  90  
  91    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  92  
  93    print '<tr><td width="20%">Prénom</td>';
  94    print '<td><input type="text" size="20" maxlength="20" name="prenom" value="'.$commercial->prenom.'"></td>';
  95    print '<td>'.$commercial->error_string["prenom"].'</td></tr>';
  96    print '<tr><td width="20%">Nom</td>';
  97    print '<td><input type="text" size="30" maxlength="30" name="nom" value="'.$commercial->nom.'"></td>';
  98    print '<td>'.$commercial->error_string["nom"].'</td></tr>';
  99   
 100    print '<tr><td width="20%">Email</td>';
 101    print '<td><input type="text" size="50" maxlength="70" name="email" value="'.$commercial->email.'"></td>';
 102    print '<td>'.$commercial->error_string["email"].'</td></tr>';
 103  
 104    print '<tr><td colspan="2"><input type="submit"></td></tr>';
 105  
 106    print '</table><br />';
 107  
 108    print "</form>";
 109  
 110  }
 111  
 112  if ($_GET["action"] == 'create')
 113  {
 114  
 115  $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/fiche.php?action=create';
 116  $head[$h][1] = "Nouveau distributeur";
 117  $hselected = $h;
 118  $h++;
 119  
 120  dolibarr_fiche_head($head, $hselected, "Distributeurs");
 121  
 122    print '<form method="POST" action="fiche.php">';
 123    print '<input type="hidden" name="action" value="add"></td></tr>';
 124  
 125    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 126  
 127    print '<tr><td width="20%">Nom</td>';
 128    print '<td><input type="text" size="30" name="nom" value="'.$distri->nom.'"></td>';
 129    print '<td>'.$distri->error_string["nom"].'</td></tr>';
 130    
 131    print '<tr><td width="20%">% avance</td>';
 132    print '<td><input type="text" size="3" maxlength="2" name="avance" value="'.$distri->avance.'"> %</td>';
 133    print '<td>'.$distri->error_string["avance"].'</td></tr>';
 134    
 135    print '<tr><td width="20%">Durée de l\'avance</td>';
 136    print '<td><input type="text" size="3" maxlength="2" name="duree" value="'.$distri->duree.'"> mois</td>';
 137    print '<td>'.$distri->error_string["duree"].'</td></tr>';
 138  
 139    print '<tr><td width="20%">% prélèvement</td>';
 140    print '<td><input type="text" size="3" maxlength="2" name="prelev" value="'.$distri->prelev.'"> %</td>';
 141    print '<td>'.$distri->error_string["prelev"].'</td></tr>';
 142  
 143    print '<tr><td width="20%">% autre</td>';
 144    print '<td width="25%"><input type="text" size="3" maxlength="2" name="autre" value="'.$distri->autre.'"> %</td>';
 145  
 146    print '<td>'.$distri->error_string["autre"].'</td></tr>';
 147    
 148    print '<tr><td colspan="2"><input type="submit"></td></tr>';
 149  
 150    print '</table><br />';
 151  
 152    print "</form>";
 153  
 154  }
 155  
 156  $db->close();
 157  
 158  llxFooter("<em>Derni&egrave;re modification $Date: 2005/09/05 14:37:15 $ r&eacute;vision $Revision: 1.3 $</em>");
 159  ?>


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