IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Ajouter ligne dans un tableau à partir d'un pop up de recherche


Sujet :

Langage PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Mai 2008
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 74
    Par défaut Ajouter ligne dans un tableau à partir d'un pop up de recherche
    bonjour;

    bon j'ai une grosse galère, je test plein de chose depuis une semaine et j'arrive à rien, j'ai les yeux qui piquent, le cerveau qui marche au ralenti ... en gros j'ai grand besoin de votre aide !!!

    comme le sujet l'indique,j'ai besoin d'inserer une ligne dans un tableau qui se trouve dans la page mère selon une target blank dont j'effectue la recherche!
    dans ma target j'ai un formulaire de recherche! je cherche l'élément je l'ajoute à un tableau dans la target,et ensuite je doit selectionner cet élément à partir d'un radio bouton et ensuite il faut que j'ajoute la même ligne dans le tableau de mapage mère et sans fermer la target ??? et là j'arrive pas???

    dans ma page mère j'ai un bouton rechercher qui m'ouvre le target de recherche:
    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    <form id="form3" name="form3" method="post" action="recherche.php" target="_blank" >
      <table align="right" border="0">
        <tr>
          <td align="center"><input type="submit" align="right" name="recherche" id="recherche" value="chercher" /></td>
        </tr>
      </table>
    </form>
    dans ma target j'ai un bouton ajouter au panier pour ajouter la ligne dans le tableau de la page mère:
    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    <form   method="post" name="form33" onSubmit="return validerMonFormulaire();" action="pagemere.php" >
    <input type="submit" name="Submitre" value="Ajouter au panier" id="Submitre" />
    ...
    </form>
    SVP aidez moi !!

  2. #2
    Membre émérite
    Profil pro
    Assistant recherche bioinformatique
    Inscrit en
    Novembre 2007
    Messages
    877
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations professionnelles :
    Activité : Assistant recherche bioinformatique

    Informations forums :
    Inscription : Novembre 2007
    Messages : 877
    Par défaut
    Salut,
    Pourrais-tu utiliser les balises CODE pour ton code html ?

    Pourrais-tu decrire comment tu ajoutes actuellement ta ligne ? (code php si tu utilises ce langage, autre code si autre langage)

    Si ton code te renvoie des erreurs, quelles sont-elles ?

    Z.

  3. #3
    Membre confirmé
    Inscrit en
    Mai 2008
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 74
    Par défaut
    merci pour votre réponse

    lorsque je clique sur un boutton rechercher une pop up s'ouvre pour effectuer la recherche:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <input name="recherche" type="submit" class="Style1" id="recherche" value="Rechercher" align="right" onclick="pop()" />
    pour le code javascript du popup:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    function pop(){ 
    fenetre=window.open("rechercheproduit.php","fenetre","weigth=toolbar=yes,scrollbars=yes,resizable=yes,width=1000, height=500") 
    }
    dont j'ouvre lapage rechercheproduit.php dans popup ça marche bien!

    cette page rechercheprouiduit.php j'effectue une recherche on choisissant un produit et je l'affiche dans un tableau ca marche bien!

    le problème que j'ai c'est je voulais lorsque je click sur un bouton ajouter au panier biensur après qu'on a choisie à partir d'un radio bouton le produit,ce dernier s'ajoute dans mapage mère???et là je suis coincée?????

    dans ma page mère je fait un test sur le bouton ajouter au panier et je fait un refresh lors du click sur ce bouton:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
     
     
     
     
    <form id="form2m" name="form2m"  method="post" action="">
      <p>
        <input name="prdre" type="hidden"  value="<?php echo $_POST['actire'] ;?>" />
      </p>
      <p>&nbsp;</p>
      <table width="100%" border="1">
        <tr>
          <th width="2%" scope="col"><span class="Style3"></span></th>
          <th width="4%" scope="col"><span class="Style3">N°r&eacute;f.</span></th>
          <th width="5%" scope="col"><span class="Style3">Nature</span></th>
          <th width="4%" scope="col"><span class="Style3">Taille</span></th>
          <th width="5%" scope="col"><span class="Style3">Forme</span></th>
          <th width="5%" scope="col"><span class="Style3">Poids</span></th>
          <th width="3%" scope="col"><span class="Style3">Longueur</span></th>
          <th width="4%" scope="col"><span class="Style3">largeur</span></th>
          <th width="3%" scope="col"><span class="Style3">Epaisseur</span></th>
          <th width="6%" scope="col"><span class="Style3">Couleur</span></th>
          <th width="8%" scope="col"><span class="Style3">Translucidit&eacute;</span></th>
          <th width="6%" scope="col"><span class="Style3">Inclusion</span></th>
          <th width="6%" scope="col"><span class="Style3">Origine</span></th>
          <th width="6%" scope="col"><span class="Style3">Livré</span></th>
        </tr>
          <?php
    if(isset($_POST['selection']) && isset($_POST['ajouteraupanier']))
    {
     
         mysql_connect("localhost", "root", "");
            mysql_select_db("produit");
     
           $idgemr=mysql_real_escape_string(htmlspecialchars($_POST['actire']));
    $reponser = mysql_query("SELECT * from prduit where idprd='$idgemr'"); 
     $donneesr = mysql_fetch_array($reponser);
     
    ?>
        <tr>
          <td><input type="radio" name="selection" onclick="selectionner('<?php echo $donneesr['idprd']; ?>','<?php echo $donneesr['prd']; ?>','<?php echo $donneesr['stock']; ?>')" /></td>
          <td><?php echo $donneesr['idprd']; ?></td>
          <td><?php echo $donneesr['prd']; ?></td>
          <td><?php echo $donneesr['stock']; ?></td>
          <td><?php echo $foge; ?></td>
              </tr>
        <?php
    }
    ?>
     </table>
     
    </form>
    merci pour votre réponse

  4. #4
    Membre émérite
    Profil pro
    Assistant recherche bioinformatique
    Inscrit en
    Novembre 2007
    Messages
    877
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations professionnelles :
    Activité : Assistant recherche bioinformatique

    Informations forums :
    Inscription : Novembre 2007
    Messages : 877
    Par défaut
    Comment as tu prevu de memoriser les produits choisis ?

  5. #5
    Membre confirmé
    Inscrit en
    Mai 2008
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 74
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
     
     
     
    <form id="form2m" name="form2m"  method="post" action="">
      <p>
        <input name="prdre" type="hidden"  value="<?php echo $_POST['actire'] ;?>" />
      </p>
      <p>&nbsp;</p>
      <table width="100%" border="1">
        <tr>
          <th width="2%" scope="col"><span class="Style3"></span></th>
          <th width="4%" scope="col"><span class="Style3">N°r&eacute;f.</span></th>
          <th width="5%" scope="col"><span class="Style3">Nature</span></th>
          <th width="4%" scope="col"><span class="Style3">Taille</span></th>
          <th width="5%" scope="col"><span class="Style3">Forme</span></th>
          <th width="5%" scope="col"><span class="Style3">Poids</span></th>
          <th width="3%" scope="col"><span class="Style3">Longueur</span></th>
          <th width="4%" scope="col"><span class="Style3">largeur</span></th>
          <th width="3%" scope="col"><span class="Style3">Epaisseur</span></th>
          <th width="6%" scope="col"><span class="Style3">Couleur</span></th>
          <th width="8%" scope="col"><span class="Style3">Translucidit&eacute;</span></th>
          <th width="6%" scope="col"><span class="Style3">Inclusion</span></th>
          <th width="6%" scope="col"><span class="Style3">Origine</span></th>
          <th width="6%" scope="col"><span class="Style3">Livré</span></th>
        </tr>
          <?php
    if(isset($_POST['selection']) && isset($_POST['ajouteraupanier']))
    {
     
         mysql_connect("localhost", "root", "");
            mysql_select_db("produit");
     
           $idgemr=mysql_real_escape_string(htmlspecialchars($_POST['actire']));
    $reponser = mysql_query("SELECT * from prduit where idprd='$idgemr'"); 
     $donneesr = mysql_fetch_array($reponser);
     
    ?>
    avec ce code j'insere les produit rechercher. en cliquant sur le bouton ajouter au panier du popup et dans ce boutton je met un refresh:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <input type="submit" name="ajouteraupanier" value="Ajouter au panier" onclick="refreshParent();" />
    et le script du refresh:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    function refreshParent()
    {
     
     
        var newRow = window.opener.document.getElementById('forme2m').actire.value;
        var det = window.opener.document.getElementById('forme1m').actimgre.value;
     
    }

  6. #6
    Membre confirmé
    Inscrit en
    Mai 2008
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 74
    Par défaut
    bon en bref ce que je voulais c passer la valeur de pop up vers la page mère et de faire un refresh du popup à la page mère???

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 2
    Dernier message: 18/05/2015, 22h09
  2. Réponses: 5
    Dernier message: 30/09/2008, 03h14
  3. [VBA - W] ajout ligne dans un tableau
    Par perophron dans le forum VBA Word
    Réponses: 2
    Dernier message: 23/05/2007, 10h27
  4. Réponses: 1
    Dernier message: 02/06/2006, 13h51
  5. Réponses: 14
    Dernier message: 22/09/2005, 16h49

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo