Deprecated: Function set_magic_quotes_runtime() is deprecated in /sda/6/b/data110/forum/include/common.php on line 58

Warning: Cannot modify header information - headers already sent by (output started at /sda/6/b/data110/forum/include/common.php:58) in /sda/6/b/data110/forum/header.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /sda/6/b/data110/forum/include/common.php:58) in /sda/6/b/data110/forum/header.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /sda/6/b/data110/forum/include/common.php:58) in /sda/6/b/data110/forum/header.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /sda/6/b/data110/forum/include/common.php:58) in /sda/6/b/data110/forum/header.php on line 34
Le forum de l'ex TD1! / Meurs Harold!!!

Le forum de l'ex TD1!

Forum officiel de la glandouille!

Vous n'êtes pas identifié.


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 363

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 363

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 497

#1 03-04-2008 09:11:50

DaTa
Administrateur
Lieu: Maltot
Date d'inscription: 19-09-2007
Messages: 986

Meurs Harold!!!

Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title>Gestion des étiquettes Rechange</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="generator" content="HAPedit 3.1">
<script language="javascript">
  function ChgEtiq(TypEtiq)
  {
    parent.frames["Show"].window.location="ShowImg.php?&Etiq=" + TypEtiq;
    document.forms['Main'].submit();
  }

  function LoadEtiq(TypEtiq)
  {
    parent.frames["Show"].window.location="ShowImg.php?&Etiq=" + TypEtiq;
  }

   function Prev(Chx)
  {
    if (Chx=='Start')
    {
      document.forms['Main'].elements['Choix'].value = 'Start';
      document.forms['Main'].elements['Etiq'].value = 'nul';
    }
    if (Chx=='Action0')
    {
      document.forms['Main'].elements['Choix'].value = 'Action';
      document.forms['Main'].elements['Act'].value = '0';
      document.forms['Main'].elements['Etiq'].value = 'nul';
    }
    if (Chx=='Action1')
    {
      document.forms['Main'].elements['Choix'].value = 'Action';
      document.forms['Main'].elements['Act'].value = '1';
      document.forms['Main'].elements['Etiq'].value = 'nul';
    }
    if (Chx=='Action2')
    {
      document.forms['Main'].elements['Choix'].value = 'Action';
      document.forms['Main'].elements['Act'].value = '2';
      document.forms['Main'].elements['Etiq'].value = 'nul';
    }
    if (Chx=='Action3')
    {
      document.forms['Main'].elements['Choix'].value = 'Action';
      document.forms['Main'].elements['Act'].value = '3';
      document.forms['Main'].elements['Etiq'].value = 'nul';
    }
  }
  
  function Copie(Chx2)
  {
    if (Chx2=='Action2')
    {
      document.forms['Main'].elements['Act'].value = '2';
    }
    if (Chx2=='Action3')
    {
      document.forms['Main'].elements['Act'].value = '3';
    }
  }

  function ChgPict(Nom,Nbre)
  {
    Val=document.forms['Maj'].elements[Nom].value;
    for (i=1; i<Nbre; i++) {
      Nam=Val.substr(i-1, 1)
      if (Nam!='') {
        src="Picto/" + Nam + ".jpg";
      } else {
        src="Picto/Blanc.jpg";
      }
      Img="I" + Nom + "_" + i;
      document.images[Img].src=src;
    }
  }

  function CtrlForm()
  {
    n=document.forms['Maj'].elements['NbChp'].value
    for (i=2; i<=n; i++) {
      if (i<10) {
        NomChamp="Chp0" + i;
      } else {
        NomChamp="Chp0" + i;
      }
      TstChamp="O" + NomChamp;
      LibChamp="L" + NomChamp;
      if (document.forms['Maj'].elements[TstChamp].value == "O")  {
        if (document.forms['Maj'].elements[NomChamp].value == "")  {
          alert(document.forms['Maj'].elements[LibChamp].value + " est obligatoire");
          document.forms['Maj'].elements[NomChamp].focus();
          return false;
        }
      }
    }
  }
</script>

</head>
<body bgcolor="#FFFFFF">
<?php
  // Recupère les paramètres :
  if (isset($_POST["Choix"])) {
    $Chx = $_POST["Choix"];         // Type d'acces
  } else {
    $Chx = "Start";
  }
  if (isset($_POST["Act"])) {
    $Act = $_POST["Act"];           // Type d'action
  } else {
    $Act = "nul";
  }
  if (isset($_POST["Ref"])) {
    $Ref = $_POST["Ref"];           // Ref Client
  } else {
    $Ref = "";
  }
  
    if (isset($_POST["Ref2"])) {
    $Ref2 = $_POST["Ref2"];           // Ref à entrer
  } else {
    $Ref2 = "";
  }
  
  if (isset($_POST["Etiq"])) {
    $Etq = $_POST["Etiq"];          // Type d'étiquette
  } else {
    $Etq = "nul";
  }

  echo "Chx : ".$Chx." - Act : ".$Act." - Ref : ".$Ref." - Etq : ".$Etq." - Ref2 : ".$Ref2."<br>";    // Debug

  // Contrôle coherence des paramètres :
  $Mess = '';
  if ($Chx == 'Mod' or $Chx == 'Ajt' or $Chx == 'Sup') {
    if ($Act == '0') {
      if ($Etq == 'nul') {
        if ($Chx == 'Sup') $Act='3';
        if ($Chx == 'Mod') $Act='1';
        if ($Chx == 'Ajt') $Act='0';
        $Chx = 'Action';
        $Mess = "Vous devez selectionner un type d'étiquette";
      }
      
    } else {
      if ($Ref == '') {
        $Act='0';
        if ($Chx == 'Ajt') $Mess = "Vous devez saisir une référence client";
        if ($Chx == 'Mod' or $Chx == 'Sup') $Mess = "Vous devez selectionner une référence client";
      } else {
        if ($Chx == 'Ajt') {
            if ($Act!='3'){
          // Controle que la référence n'existe pas déja dans la base
          // Connexion et sélection de la base
          $link = mysql_connect("localhost", "rechange", "rechange") or die("Impossible de se connecter");
          mysql_select_db("rechange_etiq") or die("Impossible de trouver la base de données");
          // Accès aux Etiquettes
          $query = "SELECT * FROM ref_type where RefCli='".$Ref."' and TypeEtiq='".$Etq."'";
          $result = mysql_query($query) or die("Query failed");
          $nrows = mysql_num_rows($result);
          if ($nrows>0){
            $Mess = "La référence existe déjà";
            $Act='0';
            }
          }
        }
      }
    }
  }
  if ($Chx == 'Cns') {
    if ($Ref == '') {
      $Act=2;
      $Chx = 'Action';
      $Mess = "Vous devez renseigner une référence client";
    }
  }

//---------------------------------------------------------------------------------------

  // 1er accès --> Demande type d'action
  if ($Chx == 'Start') {
    echo "<p align=center style='font-size:100%;'>\n";
      echo "<form method='post' action='MajData_new.php' enctype='multipart/form-data'>\n";
        echo "<input type='hidden' name='Choix' value='Action'>\n";
        echo "<TABLE BORDER='0' CELLSPACING='0' WIDTH='600px'>\n";
          echo "<colgroup>\n";
            echo "<col width='180'>\n";
            echo "<col width='180'>\n";
            echo "<col width='180'>\n";
            echo "<col width='180'>\n";
            echo "<col width='60'>\n";
          echo "</colgroup>\n";
          echo "<TR>\n";
            echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='4'>\n";
              echo "Que voulez-vous faire ?\n";
            echo "</TD>\n";
          echo "</TR>\n";
          echo "<TR>\n";
            echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
              echo "<input type='radio' name='Act' value='0'>Ajouter une référence\n";
            echo "</TD>\n";
            echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
              echo "<input type='radio' name='Act' value='1'>Modifier une référence\n";
            echo "</TD>\n";
            echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
              echo "<input type='radio' checked name='Act' value='2'>Consulter une référence\n";
            echo "</TD>\n";
            echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
              echo "<input type='radio' checked name='Act' value='3'>Supprimer une référence\n";
            echo "</TD>\n";
            echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
              echo "<input type='submit' value='Suivant'>";
            echo "</TD>\n";
          echo "</TR>\n";
        echo "</TABLE>\n";
      echo "</form>\n";
    echo "</p>\n";
  }
  
//---------------------------------------------------------------------------------------

  // Action selectionnée -->
  if ($Chx == 'Action') {
    //  En cas de consultation : Selection de la référence
    if ($Act == '2') {
      echo "<p align=center style='font-size:100%;'>\n";
        echo "<form name='Main' method='post' action='MajData_new.php' enctype='multipart/form-data'>\n";
          echo "<input type='hidden' name='Choix' value='Cns'>\n";
          echo "<TABLE BORDER='0' CELLSPACING='0' WIDTH='500px'>\n";
            echo "<colgroup>\n";
              echo "<col width='100'>\n";
              echo "<col width='300'>\n";
              echo "<col width='100'>\n";
            echo "</colgroup>\n";
            echo "<TR style='font-weight:bold; font-size:120%;'>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='3'>\n";
                echo "CONSULTATION\n";
              echo "</TD>\n";
            echo "</TR>\n";
            echo "<TR>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='3'>\n";
                echo "Entrez la référence client\n";
              echo "</TD>\n";
            echo "</TR>\n";
            echo "<TR>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                $prv='Prev("Start")';
                echo "<input type='submit' onclick='".$prv."' value='Précédent'>";
              echo "</TD>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                echo "<input type='text' name='Ref'\n";
              echo "</TD>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                echo "<input type='submit' value='Suivant'>";
              echo "</TD>\n";
            echo "</TR>\n";
            echo "<TR style='font-weight:bold; font-size:130%; color:#FF0000; vertical-align:top;'>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                echo $Mess."\n";
              echo "</TD>\n";
            echo "</TR>\n";
          echo "</TABLE>\n";
        echo "</form>\n";
      echo "</p>\n";
    }
    //  En cas de Modification ou d'ajout ou de suppression : Selection du type d'étiquette
    if ($Act == '3' or $Act == '1' or $Act == '0') {

      // Connexion et sélection de la base
      $link = mysql_connect("localhost", "rechange", "rechange") or die("Impossible de se connecter");
      mysql_select_db("rechange_etiq") or die("Impossible de trouver la base de données");
      // Accès aux type d'étiquettes
      $query = "SELECT * FROM type_lab ORDER BY RefEtiq, TypeEtiq";
      $result = mysql_query($query) or die("Query failed");
      $nrows = mysql_num_rows($result);
    
      echo "<p align=center style='font-size:100%;'>\n";
        echo "<form method='post' name='Main' action='MajData_new.php' enctype='multipart/form-data'>\n";
          if ($Act == '0') {
            echo "<input type='hidden' name='Choix' value='Ajt'>\n";
            echo "<input type='hidden' name='Act' value='0'>\n";
          }
          if ($Act == '1') {
            echo "<input type='hidden' name='Choix' value='Mod'>\n";
            echo "<input type='hidden' name='Act' value='0'>\n";
          }
          if ($Act == '3') {
            echo "<input type='hidden' name='Choix' value='Sup'>\n";
            echo "<input type='hidden' name='Act' value='0'>\n";
          }
          echo "<TABLE BORDER='0' CELLSPACING='0' WIDTH='500px'>\n";
            echo "<colgroup>\n";
              echo "<col width='100'>\n";
              echo "<col width='300'>\n";
              echo "<col width='100'>\n";
            echo "</colgroup>\n";
            echo "<TR style='font-weight:bold; font-size:120%;'>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='3'>\n";
                  if ($Act == '0') {
                  echo "AJOUT\n";
                }
                if ($Act == '1') {
                  echo "MODIFICATION\n";
                } 
                if ($Act == '3') {
                  echo "SUPPRESSION\n";
                }
              echo "</TD>\n";
            echo "</TR>\n";
            echo "<TR>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='3'>\n";
                echo "Selectionnez le type d'étiquette\n";
              echo "</TD>\n";
            echo "</TR>\n";
            echo "<TR>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                $prv='Prev("Start")';
                echo "<input type='submit' onclick='".$prv."' value='Précédent'>";
              echo "</TD>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                $onclick='javascript:parent.frames["Show"].window.location="ShowImg.php?&Etiq=" + this.options[this.selectedIndex].value';
                echo "<select name='Etiq' size='1' style='width:250px' onchange='".$onclick.";'>\n";
                echo("<option value=nul></option>\n");
                while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                  $Etiq_W = $row["TypeEtiq"];
                  if ($row["RefEtiq"]=='999') {
                    $Etiq_WC = "Non utilisée ->".$row["TypeEtiq"];
                  } else {
                    $Etiq_WC = $row["RefEtiq"]."->".$row["TypeEtiq"];
                  }
                  echo("<option value=".$Etiq_W.">".$Etiq_WC."</option>\n");
                }
                echo"</select>\n";
              echo "</TD>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                echo "<input type='submit' value='Suivant'>";
              echo "</TD>\n";
            echo "</TR>\n";
            echo "<TR style='font-weight:bold; font-size:130%; color:#FF0000; vertical-align:top;'>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                echo $Mess."\n";
              echo "</TD>\n";
            echo "</TR>\n";
          echo "</TABLE>\n";
        echo "</form>\n";
      echo "</p>\n";
    }
  }
  
//---------------------------------------------------------------------------------------

  // Suppression
  if ($Chx == 'Sup') {
    // Connexion et sélection de la base
    $link = mysql_connect("localhost", "rechange", "rechange") or die("Impossible de se connecter");
    mysql_select_db("rechange_etiq") or die("Impossible de trouver la base de données");

    // etape 1 selection de la ref à modifier
    if ($Act == '0') {
      // Accès aux type d'étiquettes pour récupérer les références
      $query = "SELECT * FROM ref_type where TypeEtiq = '".$Etq."' ORDER BY RefCli";
      $result = mysql_query($query) or die("Query failed");
      $nrows = mysql_num_rows($result);
      echo "<p align=center style='font-size:100%;'>\n";
        echo "<form method='post' name='Main' action='MajData_new.php' enctype='multipart/form-data'>\n";
          echo "<input type='hidden' name='Choix' value='Sup'>\n";
          echo "<input type='hidden' name='Act' value='1'>\n";
          echo "<input type='hidden' name='Etiq' value='".$Etq."'>\n";
          echo "<TABLE BORDER='1' CELLSPACING='0' WIDTH='600px'>\n";
            echo "<colgroup>\n";
              echo "<col width='200'>\n";
              echo "<col width='400'>\n";
            echo "</colgroup>\n";
            echo "<TR style='font-weight:bold; font-size:120%;'>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                echo "Suppression\n";
              echo "</TD>\n";
            echo "</TR>\n";
            echo "<TR>\n";
              echo "<TD STYLE='border-style:none' align='Left' valign='top' colspan='2'>\n";
                  $prv='Prev("Action3")';
                  echo "<input type='submit' onclick='".$prv."' value='Précédent'>";
                echo "</TD>\n";
              echo "</TR>\n";
              echo "<TR>\n";
              $Err = 0;
              $i=0;
              //   Affiche la liste des refs
              if ($nrows > 0) {
                // Texte "Séléctionnez la référence à supprimer" à gauche
                echo "<TD STYLE='border-style:none' align='left' valign='top'>\n";
                  echo "Séléctionnez la référence à supprimer\n";
                echo "</TD>\n";
                echo "<TD STYLE='border-style:none' align='left' valign='top'>\n";
                  echo "Il existe ".$nrows." références\n";
                echo "</TD>\n";
                echo "<TD STYLE='border-style:none' align='right' valign='top'>\n";
                  echo "<select name='Ref' size='1' style='width:150px'>";
                    echo("<option value='' Selected></option>\n");
                    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                      $i++;
                      $Ref_W = $row["RefCli"];
                      echo("<option value=".$Ref_W.">".$Ref_W."</option>\n");
                    }
                  echo"</select>";
                echo "</TD>\n";
                echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                  echo "<input type='submit' value='Supprimer'>";
                echo "</TD>\n";
              } else {
                echo "<TD STYLE='border-style:none' align='left' valign='top'>\n";
                  echo "Pas de référence pour ce type d'étiquette\n";
                echo "</TD>\n";
              }
            echo "</TR>\n";
            echo "<TR style='font-weight:bold; font-size:130%; color:#FF0000; vertical-align:top;'>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                echo $Mess."\n";
              echo "</TD>\n";
            echo "</TR>\n";
          echo "</TABLE>\n";
        echo "</form>\n";
      echo "</p>\n";
    }
}

//---------------------------------------------------------------------------------------

  // Consultation d'une ref
  if ($Chx == 'Cns') {
    // Connexion et sélection de la base
    $link = mysql_connect("localhost", "rechange", "rechange") or die("Impossible de se connecter");
    mysql_select_db("rechange_etiq") or die("Impossible de trouver la base de données");

    // Accès à la réference pour récupérer le type d'étiquette
    $query = "SELECT * FROM ref_type where RefCli = '".$Ref."' ORDER BY Defaut Desc";
    $result = mysql_query($query) or die("Query failed");
    $nrows = mysql_num_rows($result);
    echo "<p align=center style='font-size:100%;'>\n";
      echo "<form method='post' name='Main' action='MajData_new.php' enctype='multipart/form-data'>\n";
        echo "<input type='hidden' name='Choix' value='Cns'>\n";
        echo "<input type='hidden' name='Act' value='2'>\n";
        echo "<input type='hidden' name='Ref' value='".$Ref."'>\n";
        echo "<TABLE BORDER='1' CELLSPACING='0' WIDTH='600px'>\n";
          echo "<colgroup>\n";
            echo "<col width='200'>\n";
            echo "<col width='400'>\n";
          echo "</colgroup>\n";
          echo "<TR style='font-weight:bold; font-size:120%;'>\n";
            echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
              echo "CONSULTATION\n";
            echo "</TD>\n";
          echo "</TR>\n";
          echo "<TR>\n";
            echo "<TD STYLE='border-style:none' align='Left' valign='top' colspan='2'>\n";
                $prv='Prev("Action2")';
                echo "<input type='submit' onclick='".$prv."' value='Précédent'>";
              echo "</TD>\n";
            echo "</TR>\n";
            echo "<TR>\n";
            $i=0;
            $Err = 0;
            if ($nrows > 1) {
              // Si plusieurs type d'étiquette possible :
              //   Affiche la liste possible
              //   Affichage de celle par défaut au 1er accès ou celle selectionnée
              echo "<TD STYLE='border-style:none' align='left' valign='top'>\n";
                echo "Il existe ".$nrows." alternatives\n";
              echo "</TD>\n";
              echo "<TD STYLE='border-style:none' align='right' valign='top'>\n";
                echo "<select name='Etiq' size='1' style='width:200px' onchange='ChgEtiq(this.options[this.selectedIndex].value)'>";
                while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                  $i++;
                  $Etiq_W = $row["TypeEtiq"];
                  if ($Etiq_W == $Etq) {
                    echo("<option value=".$Etiq_W." Selected>".$Etiq_W."</option>\n");
                    $Etiq = $Etiq_W;
                  } else {
                    if ($i==1){
                      echo("<option value=".$Etiq_W." Selected>".$Etiq_W."</option>\n");
                      $Etiq = $Etiq_W;
                    } else {
                      echo("<option value=".$Etiq_W.">".$Etiq_W."</option>\n");
                    }
                  }
                }
                echo"</select>";
                $Etq=$Etiq;
              echo "</TD>\n";
            } else {
              if ($nrows == 1) {
                $row = mysql_fetch_array($result, MYSQL_ASSOC);
                $Etiq = $row["TypeEtiq"];
                echo "<input type='hidden' name='Etiq' value='".$Etiq."'>";
                echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                  echo "Type d'étiquette : ".$Etiq;
                  $Etq=$Etiq;
                echo "</TD>\n";
              } else {
                // Référence inexistante
                $Err = 1;
                echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                  echo "Référence inexistante\n";
                  $Etq='nul';
                echo "</TD>\n";
              }
            }
            if ($Err != 1) {
              echo "</TR>\n";
              echo "<TR style='font-weight:bold; font-size:80%; color:#AAAAAA;'>\n";
                echo "<TD STYLE='border-style:none;border-top-style:solid;' align='center' valign='top' colspan='2'>\n";
                  echo "Les champs marqués d'un * sont modifiables à l'impression";
                echo "</TD>\n";
              echo "</TR>\n";

              // Récupération des données de structure de l'étiquette
              // 1 - Libellés utilisateurs des champs : Clé Map = 'NomChampUser'
              $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'NomChampUser'";
              $result = mysql_query($query) or die("Query failed");
              $nrows = mysql_num_rows($result);
              $rowNom = mysql_fetch_array($result, MYSQL_ASSOC);
              // 2 - Pictogrammes : Clé Map = 'Picto'
              $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'Picto'";
              $result = mysql_query($query) or die("Query failed");
              $nrows = mysql_num_rows($result);
              $rowPict = mysql_fetch_array($result, MYSQL_ASSOC);
              // 3 - Données Modifiables : Clé Map = 'ChampModif'
              $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'ChampModif'";
              $result = mysql_query($query) or die("Query failed");
              $nrows = mysql_num_rows($result);
              $rowMod = mysql_fetch_array($result, MYSQL_ASSOC);

              // Récupération des Datas
              $query = "SELECT * FROM ".strtolower($Etiq)." where Chp01 = '".$Ref."'";
              $result = mysql_query($query) or die("Query failed");
              $nrows = mysql_num_rows($result);
              $row = mysql_fetch_array($result, MYSQL_ASSOC);
              $Indice=0;
              foreach($rowNom as $Ind => $dat) {
                if ($Ind != 'Map') {
                  $Indice++;
                  echo "<TR>\n";
                    if (!is_null($rowNom[$Ind])) {
                      echo "<TD STYLE='border-style:none;border-top-style:solid;' align='left' valign='top'>\n";
                        echo "<b>".$rowNom[$Ind]."</b>";
                      echo "</TD>\n";
                    } else {
                      echo "<TD STYLE='border-style:none;border-top-style:none;' align='left' valign='top'>\n";
                        echo "&nbsp;";
                      echo "</TD>\n";
                    }
                    echo "<TD STYLE='border-style:none;border-left-style:solid;border-top-style:solid;' align='left' valign='top'>\n";
                      if ($rowPict[$Ind] == 'X') {
                        $PictList=str_split($row[$Ind]);
                        foreach($PictList as $y => $dat) {
                          if ($PictList[$y]!='') {
                            echo "<img src='picto/".$PictList[$y].".jpg' border=0>\n";
                          } else {
                            echo "&nbsp;";
                          }
                        }
                      } else {
                        if (trim($row[$Ind])!='') {
                          echo $row[$Ind];
                        } else {
                          echo "&nbsp;";
                        }
                        if (trim($rowMod[$Ind])=='O') {
                          echo "*";
                        }
                      }
                    echo "</TD>\n";
                  echo "</TR>\n";
                }
              }
            } else {
              echo "</TR>\n";
            }
        echo "</TABLE>\n";
      echo "</form>\n";
    echo "</p>\n";
  }

//---------------------------------------------------------------------------------------

  // Modification
  if ($Chx == 'Mod') {
    // Connexion et sélection de la base
    $link = mysql_connect("localhost", "rechange", "rechange") or die("Impossible de se connecter");
    mysql_select_db("rechange_etiq") or die("Impossible de trouver la base de données");

    // etape 1 selection de la ref à modifier
    if ($Act == '0') {
      // Accès aux type d'étiquettes pour récupérer les références
      $query = "SELECT * FROM ref_type where TypeEtiq = '".$Etq."' ORDER BY RefCli";
      $result = mysql_query($query) or die("Query failed");
      $nrows = mysql_num_rows($result);
      echo "<p align=center style='font-size:100%;'>\n";
        echo "<form method='post' name='Main' action='MajData_new.php' enctype='multipart/form-data'>\n";
          echo "<input type='hidden' name='Choix' value='Mod'>\n";
          echo "<input type='hidden' name='Act' value='1'>\n";
          echo "<input type='hidden' name='Etiq' value='".$Etq."'>\n";
          echo "<TABLE BORDER='1' CELLSPACING='0' WIDTH='600px'>\n";
            echo "<colgroup>\n";
              echo "<col width='200'>\n";
              echo "<col width='400'>\n";
            echo "</colgroup>\n";
            echo "<TR style='font-weight:bold; font-size:120%;'>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                echo "MODIFICATION\n";
              echo "</TD>\n";
            echo "</TR>\n";
            echo "<TR>\n";
              echo "<TD STYLE='border-style:none' align='Left' valign='top' colspan='2'>\n";
                  $prv='Prev("Action1")';
                  echo "<input type='submit' onclick='".$prv."' value='Précédent'>";
                echo "</TD>\n";
              echo "</TR>\n";
              echo "<TR>\n";
              $Err = 0;
              $i=0;
              //   Affiche la liste des refs
              if ($nrows > 0) {
                // Texte "Séléctionnez la référence à modifier" à gauche
                echo "<TD STYLE='border-style:none' align='left' valign='top'>\n";
                  echo "Séléctionnez la référence à modifier\n";
                echo "</TD>\n";
                echo "<TD STYLE='border-style:none' align='left' valign='top'>\n";
                  echo "Il existe ".$nrows." références\n";
                echo "</TD>\n";
                echo "<TD STYLE='border-style:none' align='right' valign='top'>\n";
                  echo "<select name='Ref' size='1' style='width:150px'>";
                    echo("<option value='' Selected></option>\n");
                    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                      $i++;
                      $Ref_W = $row["RefCli"];
                      echo("<option value=".$Ref_W.">".$Ref_W."</option>\n");
                    }
                  echo"</select>";
                echo "</TD>\n";
                echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                  echo "<input type='submit' value='Suivant'>";
                echo "</TD>\n";
              } else {
                echo "<TD STYLE='border-style:none' align='left' valign='top'>\n";
                  echo "Pas de référence pour ce type d'étiquette\n";
                echo "</TD>\n";
              }
            echo "</TR>\n";
            echo "<TR style='font-weight:bold; font-size:130%; color:#FF0000; vertical-align:top;'>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                echo $Mess."\n";
              echo "</TD>\n";
            echo "</TR>\n";
          echo "</TABLE>\n";
        echo "</form>\n";
      echo "</p>\n";
    }

    // etape 2 Modification de la ref
    if ($Act == '1') {
      echo "<p align=center style='font-size:100%;'>\n";
        echo "<TABLE BORDER='1' CELLSPACING='0' WIDTH='600px'>\n";
          echo "<colgroup>\n";
            echo "<col width='200'>\n";
            echo "<col width='400'>\n";
          echo "</colgroup>\n";
          echo "<TR style='font-weight:bold; font-size:120%;'>\n";
            echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
              echo "MODIFICATION\n";
            echo "</TD>\n";
          echo "</TR>\n";
          echo "<TR>\n";
            echo "<TD STYLE='border-style:none' align='Left' valign='top' colspan='2'>\n";
              echo "<form method='post' name='Main' action='MajData_new.php' enctype='multipart/form-data'>\n";
                echo "<input type='hidden' name='Choix' value='Mod'>\n";
                echo "<input type='hidden' name='Act' value='0'>\n";
                echo "<input type='hidden' name='Etiq' value='".$Etq."'>\n";
                //$prv='Prev("Mod0")';
                echo "<input type='submit' value='Précédent'>";
              echo "</form>\n";
            echo "</TD>\n";
          echo "</TR>\n";
          echo "<TR style='font-weight:bold; font-size:80%; color:#AAAAAA;'>\n";
            echo "<TD STYLE='border-style:none;border-top-style:solid;' align='center' valign='top' colspan='2'>\n";
              echo "(*) champs modifiable à l'impression - (O) champs obligatoire";
            echo "</TD>\n";
           echo "</TR>\n";
          echo "<form method='post' name='Maj' action='MajBdd_new.php' onSubmit='return CtrlForm()' enctype='multipart/form-data'>\n";
            echo "<input type='hidden' name='Choix' value='Mod'>\n";
            echo "<input type='hidden' name='Act' value='0'>\n";
            echo "<input type='hidden' name='Etiq' value='".$Etq."'>\n";
            $i=0;
            $Etiq=$Etq;
            // Récupération des données de structure de l'étiquette
            // 1 - Libellés utilisateurs des champs : Clé Map = 'NomChampUser'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'NomChampUser'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowNom = mysql_fetch_array($result, MYSQL_ASSOC);
            // 2 - Pictogrammes : Clé Map = 'Picto'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'Picto'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowPict = mysql_fetch_array($result, MYSQL_ASSOC);
            // 3 - Données Modifiables : Clé Map = 'ChampModif'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'ChampModif'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowMod = mysql_fetch_array($result, MYSQL_ASSOC);
            // 4 - Longueur des Chamsp : Clé Map = 'LongChampLab'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'LongChampLab'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowLabLong = mysql_fetch_array($result, MYSQL_ASSOC);
            // 5 - Champs obligatoire : Clé Map = 'ChampObligatoire'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'ChampObligatoire'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowOblig = mysql_fetch_array($result, MYSQL_ASSOC);

            // Récupération des Datas
            $query = "SELECT * FROM ".strtolower($Etiq)." where Chp01 = '".$Ref."'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $row = mysql_fetch_array($result, MYSQL_ASSOC);
            $Indice=0;
            foreach($rowNom as $Ind => $dat) {
              if ($Ind != 'Map') {
                $Indice++;
                echo "<TR>\n";
                  if (!is_null($rowNom[$Ind])) {
                    echo "<TD STYLE='border-style:none;border-top-style:solid;' align='left' valign='top'>\n";
                      echo "<b>".$rowNom[$Ind]."</b>";
                      echo "<input type='hidden' name='L".$Ind."' value='".$rowNom[$Ind]."'>\n";
                    echo "</TD>\n";
                  } else {
                    echo "<TD STYLE='border-style:none;border-top-style:none;' align='left' valign='top'>\n";
                      echo "&nbsp;";
                      echo "<input type='hidden' name='L".$Ind."' value='Pas de nom'>\n";
                    echo "</TD>\n";
                  }
                  echo "<TD STYLE='border-style:none;border-left-style:solid;border-top-style:solid;' align='left' valign='top'>\n";
                    $Siz=$rowLabLong[$Ind] + 1;
                    if ($Ind == 'Chp01') { // La clé n'est pas modifiable
                      echo "<input type='hidden' name='".$Ind."' value='".trim($row[$Ind])."'>\n";
                      echo "<b>".trim($row[$Ind])."</b>\n";
                    } else {
                      if ($rowPict[$Ind] == 'X') {
                        $ChgPict='ChgPict("'.$Ind.'","'.$Siz.'")';
                        echo "<input type='text' name='".$Ind."' value='".trim($row[$Ind])."' size='".$Siz."' maxlength='".$rowLabLong[$Ind]."' onchange='".$ChgPict."'>\n";
                        for ($ii=1; $ii<$Siz; $ii++) {
                          echo "<img name='I".$Ind."_".$ii."' src='Picto/Blanc.jpg' border=0>\n";
                        }
                        echo "<script language='JavaScript'>toto=ChgPict('".$Ind."','".$Siz."');</script>\n";
                      } else {
                       echo "<input type='text' name='".$Ind."' value='".trim($row[$Ind])."' size='".$Siz."' maxlength='".$rowLabLong[$Ind]."'>\n";
                      }
                      if (trim($rowMod[$Ind])=='O') {
                        echo " *";
                      }
                    }
                    if (trim($rowOblig[$Ind])=='O') {
                      echo " O";
                      echo "<input type='hidden' name='O".$Ind."' value='O'>\n";
                    } else {
                      echo "<input type='hidden' name='O".$Ind."' value='N'>\n";
                    }
                  echo "</TD>\n";
                echo "</TR>\n";
              }
            }
            echo "<TR>\n";
              echo "<TD STYLE='border-style:none' align='Right' valign='top' colspan='2'>\n";
                echo "<input type='hidden' name='NbChp' value='".$Indice."'>\n";
                echo "<input type='submit' value='Mise à Jour'>";
              echo "</TD>\n";
            echo "</TR>\n";
          echo "</form>\n";
        echo "</TABLE>\n";
      echo "</p>\n";
    }
  }

//---------------------------------------------------------------------------------------

  // Ajout
  if ($Chx == 'Ajt') {
    // Connexion et sélection de la base
    $link = mysql_connect("localhost", "rechange", "rechange") or die("Impossible de se connecter");
    mysql_select_db("rechange_etiq") or die("Impossible de trouver la base de données");

    // etape 1 selection de la ref à Ajouter et contrôles qu'elle n'existe pas
    if ($Act == '0') {
      // Recupération de la longueur du champ clé :
      // Longueur des Chamsp : Clé Map = 'LongChampLab'
      $query = "SELECT * FROM ".strtolower($Etq)." where Map = 'LongChampLab'";
      $result = mysql_query($query) or die("Query failed");
      $nrows = mysql_num_rows($result);
      $rowLabLong = mysql_fetch_array($result, MYSQL_ASSOC);
      $Siz=$rowLabLong['Chp01'] + 1;
      $Max=$rowLabLong['Chp01'];
      echo "<p align=center style='font-size:100%;'>\n";
        echo "<form method='post' name='Main' action='MajData_new.php' enctype='multipart/form-data'>\n";
          echo "<input type='hidden' name='Choix' value='Ajt'>\n";
          echo "<input type='hidden' name='Act' value='1'>\n";
          echo "<input type='hidden' name='Etiq' value='".$Etq."'>\n";
          echo "<TABLE BORDER='1' CELLSPACING='0' WIDTH='600px'>\n";
            echo "<colgroup>\n";
              echo "<col width='200'>\n";
              echo "<col width='400'>\n";
            echo "</colgroup>\n";
            echo "<TR style='font-weight:bold; font-size:120%;'>\n";
            // Texte "AJOUT" centré
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                echo "AJOUT\n";
              echo "</TD>\n";
            echo "</TR>\n";
            echo "<TR>\n";
              // Bouton "Précédent" à droite
              echo "<TD STYLE='border-style:none' align='Left' valign='top' colspan='2'>\n";
                  $prv='Prev("Action0")';
                  echo "<input type='submit' onclick='".$prv."' value='Précédent'>";
                echo "</TD>\n";
              echo "</TR>\n";
              echo "<TR>\n";
                // Texte "Saisissez la référence client" à gauche
                echo "<TD STYLE='border-style:none' align='left' valign='top'>\n";
                  echo "Saisissez la référence client\n";
                echo "</TD>\n";
                // Champs d'insertion de la référence centré
                echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                  echo "<input type=text name='Ref' size='".$Siz."' maxlength='".$Max."'>";
                echo "</TD>\n";
                // Bouton "Copier de" à ...
                echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                  $copie='Copie("Action2")';
                  echo "<input type='submit' onclick='".$copie."' value='Copier de'>";
                echo "</TD>\n";
                // Bouton "Suivant" à ...
                echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                  echo "<input type='submit' value='Suivant'>";
                echo "</TD>\n";
              echo "</TR>\n";
            // Message d'erreur ou non
            echo "<TR style='font-weight:bold; font-size:130%; color:#FF0000; vertical-align:top;'>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                echo $Mess."\n";
              echo "</TD>\n";
            echo "</TR>\n";
          echo "</TABLE>\n";
        echo "</form>\n";
      echo "</p>\n";
    }

    // etape 2 Saisie des données
    if ($Act == '1') {
      echo "<p align=center style='font-size:100%;'>\n";
        echo "<TABLE BORDER='1' CELLSPACING='0' WIDTH='600px'>\n";
          echo "<colgroup>\n";
            echo "<col width='200'>\n";
            echo "<col width='400'>\n";
          echo "</colgroup>\n";
          echo "<TR style='font-weight:bold; font-size:120%;'>\n";
            echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
              echo "AJOUT\n";
            echo "</TD>\n";
          echo "</TR>\n";
          echo "<TR>\n";
            echo "<TD STYLE='border-style:none' align='Left' valign='top' colspan='2'>\n";
              echo "<form method='post' name='Main' action='MajData_new.php' enctype='multipart/form-data'>\n";
                echo "<input type='hidden' name='Choix' value='Ajt'>\n";
                echo "<input type='hidden' name='Act' value='0'>\n";
                echo "<input type='hidden' name='Etiq' value='".$Etq."'>\n";
                //$prv='Prev("Ajt0")';
                echo "<input type='submit' value='Précédent'>";
              echo "</form>\n";
            echo "</TD>\n";
          echo "</TR>\n";
          echo "<TR style='font-weight:bold; font-size:80%; color:#AAAAAA;'>\n";
            echo "<TD STYLE='border-style:none;border-top-style:solid;' align='center' valign='top' colspan='2'>\n";
              echo "(*) champs modifiable à l'impression - (O) champs obligatoire";
            echo "</TD>\n";
           echo "</TR>\n";
          echo "<form method='post' name='Maj' action='MajBdd_new.php' onSubmit='return CtrlForm()' enctype='multipart/form-data'>\n";
            echo "<input type='hidden' name='Choix' value='Ajt'>\n";
            echo "<input type='hidden' name='Act' value='0'>\n";
            echo "<input type='hidden' name='Etiq' value='".$Etq."'>\n";
            $i=0;
            $Etiq=$Etq;
            // Récupération des données de structure de l'étiquette
            // 1 - Libellés utilisateurs des champs : Clé Map = 'NomChampUser'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'NomChampUser'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowNom = mysql_fetch_array($result, MYSQL_ASSOC);
            // 2 - Pictogrammes : Clé Map = 'Picto'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'Picto'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowPict = mysql_fetch_array($result, MYSQL_ASSOC);
            // 3 - Données Modifiables : Clé Map = 'ChampModif'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'ChampModif'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowMod = mysql_fetch_array($result, MYSQL_ASSOC);
            // 4 - Longueur des Chamsp : Clé Map = 'LongChampLab'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'LongChampLab'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowLabLong = mysql_fetch_array($result, MYSQL_ASSOC);
            // 5 - Champs obligatoire : Clé Map = 'ChampObligatoire'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'ChampObligatoire'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowOblig = mysql_fetch_array($result, MYSQL_ASSOC);

            $Indice=0;
            foreach($rowNom as $Ind => $dat) {
              if ($Ind != 'Map') {
                $Indice++;
                echo "<TR>\n";
                  if (!is_null($rowNom[$Ind])) {
                    echo "<TD STYLE='border-style:none;border-top-style:solid;' align='left' valign='top'>\n";
                      echo "<b>".$rowNom[$Ind]."</b>";
                      echo "<input type='hidden' name='L".$Ind."' value='".$rowNom[$Ind]."'>\n";
                    echo "</TD>\n";
                  } else {
                    echo "<TD STYLE='border-style:none;border-top-style:none;' align='left' valign='top'>\n";
                      echo "&nbsp;";
                      echo "<input type='hidden' name='L".$Ind."' value='Pas de nom'>\n";
                    echo "</TD>\n";
                  }
                  echo "<TD STYLE='border-style:none;border-left-style:solid;border-top-style:solid;' align='left' valign='top'>\n";
                    $Siz=$rowLabLong[$Ind] + 1;
                    if ($Ind == 'Chp01') { // La clé n'est pas modifiable
                      echo "<input type='hidden' name='".$Ind."' value='".trim($Ref)."'>\n";
                      echo "<b>".trim($Ref)."</b>\n";
                    } else {
                      if ($rowPict[$Ind] == 'X') {
                        $ChgPict='ChgPict("'.$Ind.'","'.$Siz.'")';
                        echo "<input type='text' name='".$Ind."' size='".$Siz."' maxlength='".$rowLabLong[$Ind]."' onchange='".$ChgPict."'>\n";
                        for ($ii=1; $ii<$Siz; $ii++) {
                          echo "<img name='I".$Ind."_".$ii."' src='Picto/Blanc.jpg' border=0>\n";
                        }
                        echo "<script language='JavaScript'>toto=ChgPict('".$Ind."','".$Siz."');</script>\n";
                      } else {
                       echo "<input type='text' name='".$Ind."' size='".$Siz."' maxlength='".$rowLabLong[$Ind]."'>\n";
                      }
                      if (trim($rowMod[$Ind])=='O') {
                        echo " *";
                      }
                    }
                    if (trim($rowOblig[$Ind])=='O') {
                      echo " O";
                      echo "<input type='hidden' name='O".$Ind."' value='O'>\n";
                    } else {
                      echo "<input type='hidden' name='O".$Ind."' value='N'>\n";
                    }
                  echo "</TD>\n";
                echo "</TR>\n";
              }
            }
            echo "<TR>\n";
              echo "<TD STYLE='border-style:none' align='Right' valign='top' colspan='2'>\n";
                echo "<input type='hidden' name='NbChp' value='".$Indice."'>\n";
                echo "<input type='submit' value='Ajouter'>";
              echo "</TD>\n";
            echo "</TR>\n";
          echo "</form>\n";
        echo "</TABLE>\n";
      echo "</p>\n";
    }
    
    // etape choix de la référence à copier
    if ($Act == '2') {
      // Accès aux type d'étiquettes pour récupérer les références
      $query = "SELECT * FROM ref_type where TypeEtiq = '".$Etq."' ORDER BY RefCli";
      $result = mysql_query($query) or die("Query failed");
      $nrows = mysql_num_rows($result);
      echo "<p align=center style='font-size:100%;'>\n";
        echo "<form method='post' name='Main' action='MajData_new.php' enctype='multipart/form-data'>\n";
          echo "<input type='hidden' name='Choix' value='Ajt'>\n";
          echo "<input type='hidden' name='Act' value='0'>\n";
          echo "<input type='hidden' name='Etiq' value='".$Etq."'>\n";
          //igne ajoutée
          echo "<input type='hidden' name='Ref' value='".$Ref."'>\n";
          echo "<input type='hidden' name='Ref2' value='".$Ref."'>\n";
          echo "<TABLE BORDER='1' CELLSPACING='0' WIDTH='600px'>\n";
            echo "<colgroup>\n";
              echo "<col width='200'>\n";
              echo "<col width='400'>\n";
            echo "</colgroup>\n";
            // Texte 'COPIE" centré
            echo "<TR style='font-weight:bold; font-size:120%;'>\n";
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                echo "COPIE\n";
              echo "</TD>\n";
            echo "</TR>\n";
            echo "<TR>\n";
            // Bouton  "Précédent" à gauche
              echo "<TD STYLE='border-style:none' align='left' valign='top' colspan='2'>\n";
                  //$prv='Prev("Ajt0")';
                  //echo "<input type='submit' onclick='".$prv."' value='Précédent'>";
                    echo "<input type='submit' value='Précédent'>";
                echo "</TD>\n";
              echo "</TR>\n";
              echo "<TR>\n";
               // Texte "Séléctionnez la référence à copier" centré
                echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                  echo "Séléctionnez la référence à copier\n";
                echo "</TD>\n";
              $i=0;
              $Err = 0;
              //   Affiche la liste des refs
              if ($nrows > 0) {
                // Texte ""Il existe ".$nrows." références" à gauche
                echo "<TD STYLE='border-style:none' align='left' valign='top'>\n";
                  echo "Il existe ".$nrows." références\n";
                echo "</TD>\n";
                // Liste déroulante des références centrée
                echo "<TD STYLE='border-style:none' align='center' valign='top'>\n";
                  echo "<select name='Ref' size='1' style='width:150px'>";
                    echo("<option value='' Selected></option>\n");
                    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                      $i++;
                      $Ref_W = $row["RefCli"];
                      echo("<option value=".$Ref_W.">".$Ref_W."</option>\n");
                    }
                  echo"</select>";
                echo "</TD>\n";
                // Bouton "suivant" à droite
                echo "<TD STYLE='border-style:none' align='right' valign='top'>\n";
                  $copie='Copie("Action3")';
                  echo "<input type='submit' onclick='".$copie."' value='Suivant'>";
                echo "</TD>\n";
              echo "</TR>\n";
            echo "<TR style='font-weight:bold; font-size:130%; color:#FF0000; vertical-align:top;'>\n";
              // Message d'erreur ou non
              echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
                echo $Mess."\n";
              echo "</TD>\n";
            echo "</TR>\n";
          echo "</TABLE>\n";
        echo "</form>\n";
      echo "</p>\n";
    }
  }
  
    // etape formulaire pré-rempli
    if ($Act == '3') {
        echo "<p align=center style='font-size:100%;'>\n";
        echo "<TABLE BORDER='1' CELLSPACING='0' WIDTH='600px'>\n";
          echo "<colgroup>\n";
            echo "<col width='200'>\n";
            echo "<col width='400'>\n";
          echo "</colgroup>\n";
          echo "<TR style='font-weight:bold; font-size:120%;'>\n";
            echo "<TD STYLE='border-style:none' align='center' valign='top' colspan='2'>\n";
              echo "COPIE\n";
            echo "</TD>\n";
          echo "</TR>\n";
          echo "<TR>\n";
            echo "<TD STYLE='border-style:none' align='Left' valign='top' colspan='2'>\n";
              echo "<form method='post' name='Main' action='MajData_new.php' enctype='multipart/form-data'>\n";
                echo "<input type='hidden' name='Choix' value='Ajt'>\n";
                echo "<input type='hidden' name='Act' value='2'>\n";
                //ligne ajoutée
                echo "<input type='hidden' name='Ref2' value='".$Ref2."'>\n";
                echo "<input type='hidden' name='Etiq' value='".$Etq."'>\n";
                //$prv='Prev("Mod0")';
                echo "<input type='submit' value='Précédent'>";
              echo "</form>\n";
            echo "</TD>\n";
          echo "</TR>\n";
          echo "<TR style='font-weight:bold; font-size:80%; color:#AAAAAA;'>\n";
            echo "<TD STYLE='border-style:none;border-top-style:solid;' align='center' valign='top' colspan='2'>\n";
              echo "(*) champs modifiable à l'impression - (O) champs obligatoire";
            echo "</TD>\n";
           echo "</TR>\n";
          echo "<form method='post' name='Maj' action='MajBdd_new.php' onSubmit='return CtrlForm()' enctype='multipart/form-data'>\n";
            echo "<input type='hidden' name='Choix' value='Ajt'>\n";
            echo "<input type='hidden' name='Act' value='0'>\n";
            echo "<input type='hidden' name='Etiq' value='".$Etq."'>\n";
            $i=0;
            $Etiq=$Etq;
            // Récupération des données de structure de l'étiquette
            // 1 - Libellés utilisateurs des champs : Clé Map = 'NomChampUser'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'NomChampUser'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowNom = mysql_fetch_array($result, MYSQL_ASSOC);
            // 2 - Pictogrammes : Clé Map = 'Picto'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'Picto'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowPict = mysql_fetch_array($result, MYSQL_ASSOC);
            // 3 - Données Modifiables : Clé Map = 'ChampModif'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'ChampModif'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowMod = mysql_fetch_array($result, MYSQL_ASSOC);
            // 4 - Longueur des Chamsp : Clé Map = 'LongChampLab'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'LongChampLab'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowLabLong = mysql_fetch_array($result, MYSQL_ASSOC);
            // 5 - Champs obligatoire : Clé Map = 'ChampObligatoire'
            $query = "SELECT * FROM ".strtolower($Etiq)." where Map = 'ChampObligatoire'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $rowOblig = mysql_fetch_array($result, MYSQL_ASSOC);

            // Récupération des Datas
            $query = "SELECT * FROM ".strtolower($Etiq)." where Chp01 = '".$Ref."'";
            $result = mysql_query($query) or die("Query failed");
            $nrows = mysql_num_rows($result);
            $row = mysql_fetch_array($result, MYSQL_ASSOC);
            $Indice=0;
            foreach($rowNom as $Ind => $dat) {
              if ($Ind != 'Map') {
                $Indice++;
                echo "<TR>\n";
                  if (!is_null($rowNom[$Ind])) {
                    echo "<TD STYLE='border-style:none;border-top-style:solid;' align='left' valign='top'>\n";
                       echo "<b>".$rowNom[$Ind]."</b>";
                      echo "<input type='hidden' name='L".$Ind."' value='".$rowNom[$Ind]."'>\n";
                    echo "</TD>\n";
                  } else {
                    echo "<TD STYLE='border-style:none;border-top-style:none;' align='left' valign='top'>\n";
                      echo "&nbsp;";
                      echo "<input type='hidden' name='L".$Ind."' value='Pas de nom'>\n";
                    echo "</TD>\n";
                  }
                  echo "<TD STYLE='border-style:none;border-left-style:solid;border-top-style:solid;' align='left' valign='top'>\n";
                    $Siz=$rowLabLong[$Ind] + 1;
                    if ($Ind == 'Chp01') { // La clé n'est pas modifiable
                      echo "<input type='hidden' name='".$Ind."' value='".$Ref2."'>\n";
                      //echo "<b>".trim($row[$Ind])."</b>\n";
                      echo "<b>".$Ref2."</b>\n";
                    } else {
                      if ($rowPict[$Ind] == 'X') {
                        $ChgPict='ChgPict("'.$Ind.'","'.$Siz.'")';
                        echo "<input type='text' name='".$Ind."' value='".trim($row[$Ind])."' size='".$Siz."' maxlength='".$rowLabLong[$Ind]."' onchange='".$ChgPict."'>\n";
                        for ($ii=1; $ii<$Siz; $ii++) {
                          echo "<img name='I".$Ind."_".$ii."' src='Picto/Blanc.jpg' border=0>\n";
                        }
                        echo "<script language='JavaScript'>toto=ChgPict('".$Ind."','".$Siz."');</script>\n";
                      } else {
                       echo "<input type='text' name='".$Ind."' value='".trim($row[$Ind])."' size='".$Siz."' maxlength='".$rowLabLong[$Ind]."'>\n";
                      }
                      if (trim($rowMod[$Ind])=='O') {
                        echo " *";
                      }
                    }
                    if (trim($rowOblig[$Ind])=='O') {
                      echo " O";
                      echo "<input type='hidden' name='O".$Ind."' value='O'>\n";
                    } else {
                      echo "<input type='hidden' name='O".$Ind."' value='N'>\n";
                    }
                  echo "</TD>\n";
                echo "</TR>\n";
              }
            }
            echo "<TR>\n";
              echo "<TD STYLE='border-style:none' align='Right' valign='top' colspan='2'>\n";
                echo "<input type='hidden' name='NbChp' value='".$Indice."'>\n";
                echo "<input type='submit' value='Ajouter'>";
              echo "</TD>\n";
            echo "</TR>\n";
          echo "</form>\n";
        echo "</TABLE>\n";
      echo "</p>\n";
    }
  }


  echo "<script language='JavaScript'>toto=LoadEtiq('".$Etq."');</script>\n";
  
  echo "<hr />\n";
       "HAPedit 3.1.11.111 (août 2007 16:20:52)";
?>
</body>

</html>

sad


http://data110.free.fr/images/insomniac.png

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 363

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 363

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 497

#2 03-04-2008 09:51:58

Gz'
Modérateur
Date d'inscription: 21-09-2007
Messages: 1087
Site web

Re: Meurs Harold!!!

wha de hell is dat shit


http://masgul2.free.fr/pix/yoursister-044415_08-05-08.png
http://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gif

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 363

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 363

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 497

#3 03-04-2008 09:53:42

Caillou
Super Floodeur
Lieu: trou du Q du trou du Q du mond
Date d'inscription: 26-09-2007
Messages: 542
Site web

Re: Meurs Harold!!!

+1 mit Poule


Keep Smiling, Life pursuits .... "La vie n'est qu'un jeu" N&SK
http://img44.imageshack.us/img44/5143/17230.gif
http://img.userbars.pl/1/79.jpg
http://img.userbars.pl/97/19272.jpg

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

#4 03-04-2008 13:33:06

Panda
Floodeur
Lieu: Vincennes
Date d'inscription: 19-09-2007
Messages: 224

Re: Meurs Harold!!!

Hum sympatoche comme code

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

#5 03-04-2008 14:54:29

Gz'
Modérateur
Date d'inscription: 21-09-2007
Messages: 1087
Site web

Re: Meurs Harold!!!

Si seulement vous voyez ce que j'ai au boulot ;x


http://masgul2.free.fr/pix/yoursister-044415_08-05-08.png
http://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gif

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

#6 03-04-2008 16:00:05

DaTa
Administrateur
Lieu: Maltot
Date d'inscription: 19-09-2007
Messages: 986

Re: Meurs Harold!!!

Bah postes! On fait un concours du plus mauvais code!


http://data110.free.fr/images/insomniac.png

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

#7 03-04-2008 16:07:56

thbkrshw
Floodeur
Date d'inscription: 24-09-2007
Messages: 206

Re: Meurs Harold!!!

Et ça einh ? Répété sur un peu moins de 200 pages php (vive les fonctions...)

Code:

session_start();                                                             // on poursuit la session    
    
    /*******************************************************************************************************************
        But de cette partie :
        On veut vérifier que les utilisateurs qui accède à cette page sont bien des utilisateurs connus et qu'ils se sont bien identifiés.
        Pour cela, on se sert des sessions créées lors de la connexion sur le formulaire 'formConnexion.php'.
        On va vérifier le login posté par le formulaire de connexion et vérifier les privilèges.
    ********************************************************************************************************************/
    
    $loginOK = false;                                                            // booléen pour vérifier le login
    require_once('../connect.php');                                             // on récupère les informations du fichier 'connect.php'
    
    if (isset($_POST) && (!empty($_SESSION['login'])) && (!empty($_SESSION['privilege'])))  // on vérifie que les données de connexion ont bien été envoyées
    {     
        extract($_POST);
        
        $login = $_SESSION['login'];
        $privilege = $_SESSION['privilege'];
        
        $requete = "SELECT privilege
            FROM utilisateurs
            WHERE login = '$login'";
        $resultat = mysql_query($requete) or die('Erreur : '.mysql_error());    // on sélectionne les privilèges de l'utilisateur se connectant
        
        if (mysql_num_rows($resultat) > 0) {                                    // s'il y a un utilisateur qui correspond
            $ligne = mysql_fetch_assoc($resultat);                                // on récupère les infos de la requete dens une varible '$ligne'
            
            if (($privilege == $ligne['privilege']) && ($privilege == 'Admin')) {    // on teste l'égalité entre la variable '$privilege' et le résultat de la requete 
                $loginOK = true;
            }
        }
    }

    if ($loginOK == true)
    {

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 363

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 363

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 497

#8 03-04-2008 16:21:12

kana
Super Floodeur
Lieu: QG - Glorieuse Nation Roussie
Date d'inscription: 20-09-2007
Messages: 836
Site web

Re: Meurs Harold!!!

Ha bah c'est du joli !


http://img129.imageshack.us/img129/710/rss16.pnghttp://img386.imageshack.us/img386/6109/twitter16.pnghttp://img386.imageshack.us/img386/858/tumblr16.png
http://img253.imageshack.us/img253/6960/798905780lje3.gif

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 363

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 363

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 436

#9 03-04-2008 17:14:38

DaTa
Administrateur
Lieu: Maltot
Date d'inscription: 19-09-2007
Messages: 986

Re: Meurs Harold!!!

Ouais mais t'as pas echo à mettre à chaque début de ligne! tongue


http://data110.free.fr/images/insomniac.png

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

#10 04-04-2008 05:33:53

Gz'
Modérateur
Date d'inscription: 21-09-2007
Messages: 1087
Site web

Re: Meurs Harold!!!

T'es pas obligé de mettre  echo à chaque ligne ptite tête smile


http://masgul2.free.fr/pix/yoursister-044415_08-05-08.png
http://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gif

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

#11 04-04-2008 09:58:25

DaTa
Administrateur
Lieu: Maltot
Date d'inscription: 19-09-2007
Messages: 986

Re: Meurs Harold!!!

Bah je suis les procédures moi monsieur!


http://data110.free.fr/images/insomniac.png

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

#12 05-04-2008 00:06:35

legyptien
Super Floodeur
Date d'inscription: 25-09-2007
Messages: 622

Re: Meurs Harold!!!

pfff faites de l'ASP.NET, au moins c'est propre big_smile


(\_/)
(O.o)
(> <) This is Bunny. Copy Bunny into your signature to help him on his way to world domination.

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

#13 05-04-2008 14:48:13

Gz'
Modérateur
Date d'inscription: 21-09-2007
Messages: 1087
Site web

Re: Meurs Harold!!!

haha


http://masgul2.free.fr/pix/yoursister-044415_08-05-08.png
http://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gifhttp://masgul2.free.fr/pix/onoes-115023_16-07-08.gif

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

#14 05-04-2008 20:19:19

Anono
Floodeur
Date d'inscription: 29-10-2007
Messages: 294

Re: Meurs Harold!!!

moi j'ai pas encore vu la moindre ligne de code québecois, ça promet, je commence lundi...

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

#15 05-04-2008 22:45:57

thbkrshw
Floodeur
Date d'inscription: 24-09-2007
Messages: 206

Re: Meurs Harold!!!

Propre, propre, mon cul et des patates ! lol

Hors ligne

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 378

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /sda/6/b/data110/forum/include/parser.php on line 379

#16 06-04-2008 16:21:26

legyptien
Super Floodeur
Date d'inscription: 25-09-2007
Messages: 622

Re: Meurs Harold!!!

tes pratiques sexuelles ne nous concernent pas harold... et la propreté de ton cul non plus big_smile


(\_/)
(O.o)
(> <) This is Bunny. Copy Bunny into your signature to help him on his way to world domination.

Hors ligne

 

Pied de page des forums

Propulsé par PunBB
© Copyright 2002–2005 Rickard Andersson
Traduction par punbb.fr