Bonjour à Tous,

Dans le code ci-dessous, je cherche à afficher dans la fenêtre modale les coloris et prix d'un article.
Ma structure est constitué de 2 tables

1- Articles
2- Coloris et tarifs

J'ai donc une requête qui me renvoi bien l'ensemble des données mais je ne sais pas comment afficher dans la modale que les champs "TAR_COLx, TAR_HTx et TAR_TTCx" alors que je n'ai pas à les afficher dans le tableau
Malgré mes recherches, je ne vois pas comment faire
Sauriez vous me guider vers la solution svp

Un grand merci

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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
             <section>
                <h4>Enregistrements</h4>
                <table>
                    <thead>
                        <tr>
                            <th width=100%>Code</th>
                            <th width=100%>Désignation........</th>
                            <th width=100%>Unité..........</th>
                            <th width=100%>Conditionnement</th>
                            <th width=100%>Code fournisseur</th>
                            <th width=100%>Nom founisseur</th>
                            <th width=100%>Commentaire</th>
                            <th width=100%>Date création</th>
                            <th width=100%>Date modification</th>
                            <th width=17%>......</th>
 
                        </tr>
                    </thead>
                    <tbody>
                        <!-- CONSTRUCTION TABLEAU DES USERS -->
                        <?php
                        require('../simag/requete/userlistReq.php');
                        $query = $bdd->prepare('SELECT ART_CODE,ART_DESIGN,ART_UNITMESURE,ART_BOX,ART_FOURCODE,
                        ART_FOURNAME,ART_FOURREF,ART_CREATE,ART_COMMENT,ART_MODIF, TAR_COL1,TAR_HT1,TAR_TTC1,TAR_COL2,TAR_HT2,
                        TAR_TTC2 FROM ARTICLES,TARIF WHERE TAR_ART_CODE=ART_CODE');
                        $query->execute();
                        while ($data = $query->fetch()) {
                        ?>
                            <tr onclick="fctClick(this)">
                                <td><?php echo $data['ART_CODE']; ?></td>
                                <td><?php echo $data['ART_DESIGN']; ?></td>
                                <td><?php echo $data['ART_UNITMESURE']; ?></td>
                                <td><?php echo $data['ART_BOX']; ?></td>
                                <td><?php echo $data['ART_FOURCODE']; ?></td>
                                <td><?php echo $data['ART_FOURNAME']; ?></td>
                                <td><?php echo $data['ART_COMMENT']; ?></td>
                                <td><?php echo $data['ART_CREATE']; ?></td>
                                <td><?php echo $data['ART_MODIF']; ?></td>
                                <td><button class="btnR" onClick="bascule('boite');">+</button></td>
                            </tr>
 
                        <?php
                        }
                        ?>
                    </tbody>
                </table>
                <form method="POST" action="" class="forma">
                    <div name="boite" id="boite" style="visibility: hidden">
                        <h5>Formulaire</h5>
                        <dialog id="mydialog" open>
                            <table>
                                <fieldset class="fieldseta">
                                    <p><label>COL 1</label><input type="text" name="col1"></p>
                                    <p><label>HT 1</label><input type="text" name="ht1"></p>
                                    <p><label>TTC 1</label><input type="text" name="ttc1"></p>
                                    <p><label>COL 2</label><input type="text" name="col2"></p>
                                    <p><label>HT 2</label><input type="text" name="ht2"></p>
                                    <p><label>TTC 2</label><input type="text" name="ttc2"></p>
                                    <p><label>Date modif</label><input type="text" name="modif"></p>
                                    <p>
                                        <input type="submit" name="update" value="Modifier">
                                        <input type="reset" value="Annuler">
                                        <button class="btn"><a href="index.php" class="btna">Accueil</a></button>
                                    </p>
                                </fieldset>
                            </table>
                            <div class="boutons"><button onclick="$dialog.close()">Fermer</button></div>
                        </dialog>
                        </script>
                        <script src="../js/userDialog.js"></script>
                        </dialog>
                </form>
            </section>
Le code JS

Code javascript : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
var $dialog = document.getElementById('mydialog');
if (!('show' in $dialog)) {
    document.getElementById('promptCompat').className = 'no_dialog';
}
$dialog.addEventListener('close', function() {
    console.log('Fermeture. ', this.returnValue);
});