Bonjour,

Je commence à passer de Windev vers ce nouveau monde et rencontre un souci.....
Dans le code joint, j'arrive à ouvrir une fenêtre modale en cliquant sur une ligne de mon tableau, mais je bloque sur l'alimentation de la fenêtre modale.
J'ai laisser le formulaire dans ma page pour les besoins de construction

Pourriez vous me mettre dans la bonne direction svp
Merci beaucoup

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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../user.css" />
 
    <script type="text/javascript">
        //<!--
        document.oncontextmenu = new Function("return false");
        //-->
    </script>
    <title>LISTE DES USERS</title>
 
</head>
 
<body>
    <nav class="side-nav">
        <div class="wrapper">
            <div class="three-dots-container">
                <div class="dot d1"></div>
                <div class="dot d2"></div>
                <div class="dot d3"></div>
            </div>
            <div class="nav-bloc n-1">
                <svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="file" class="svg-inline--fa fa-file fa-w-12" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
                    <path d="M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z"></path>
                </svg>
                <div class="sub-nav">
                    <h2>Les articles</h2>
                    <ul>
                        <li>
                            <a href="article.php">Création des articles</a>
                        </li>
                        <li>
                            <a>Liste des articles</a>
                        </li>
                        <li>
                            <a>Stock par articles</a>
                        </li>
                        <li>
                            <a>Monitoring</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="nav-bloc n-2">
                <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="user-alt" class="svg-inline--fa fa-user-alt fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
                    <path d="M256 288c79.5 0 144-64.5 144-144S335.5 0 256 0 112 64.5 112 144s64.5 144 144 144zm128 32h-55.1c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16H128C57.3 320 0 377.3 0 448v16c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48v-16c0-70.7-57.3-128-128-128z"></path>
                </svg>
 
                <div class="sub-nav">
                    <h2>Fournisseurs</h2>
                    <ul>
                        <li>
                            <a>Création</a>
                        </li>
                        <li>
                            <a>Liste des fournisseurs</a>
                        </li>
                        <li>
                            <a>Stock par fournisseur</a>
                        </li>
                        <li>
                            <a>Monitoring</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="nav-bloc n-3">
                <svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
                    <path d="M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z"></path>
                </svg>
                <div class="sub-nav">
                    <h2>Subtitle 3</h2>
                    <ul>
                        <li>
                            <a>Link</a>
                        </li>
                        <li>
                            <a>Link</a>
                        </li>
                        <li>
                            <a>Link</a>
                        </li>
                        <li>
                            <a>Link</a>
                        </li>
                        <li>
                            <a>Link</a>
                        </li>
                        <li>
                            <a>Link</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="nav-bloc n-4">
                <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="cog" class="svg-inline--fa fa-cog fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
                    <path d="M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"></path>
                </svg>
                <div class="sub-nav">
                    <h2>Paramètres</h2>
                    <ul>
                        <li>
                            <a href="user.php"><i class="fa-solid fa-circle-info"></i>&nbsp;&nbsp;Users</a>
                        </li>
                        <li>
                            <a href="usersList.php"><i class="fa-solid fa-circle-info"></i>&nbsp;&nbsp;Users List</a>
                        </li>
                        <li>
                            <a>Link</a>
                        </li>
                        <li>
                            <a>Link</a>
                        </li>
                        <li>
                            <a>Link</a>
                        </li>
                        <li>
                            <a>Link</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="nav-bloc n-5">
                <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="cog" class="svg-inline--fa fa-cog fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
                    <path d="M256 288c79.5 0 144-64.5 144-144S335.5 0 256 0 112 64.5 112 144s64.5 144 144 144zm128 32h-55.1c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16H128C57.3 320 0 377.3 0 448v16c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48v-16c0-70.7-57.3-128-128-128z"></path>
                </svg>
                <div class="sub-nav">
                    <h2>A propos</h2>
                    <ul>
                        <li>
                            <a href="apropos.php"><i class="fa-solid fa-circle-info"></i>&nbsp;&nbsp;A propos</a>
                        </li>
                        <li>
                            <a href="Contact.php"><i class="fa-solid fa-address-card"></i>&nbsp;&nbsp;Contact</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </nav>
    <main class="main-content">
        <!-- DEBUT DE PAGE -->
        <div id="main">
            <header>
                <h1>USER LIST</h1>
            </header>
            <section>
                <h2>Enregistrements</h2>
                <table>
                    <thead>
                        <tr>
                            <th width=7%>ID</th>
                            <th width=13%>Nom</th>
                            <th width=7%>Prenom</th>
                            <th width=10%>level</th>
                            <th width=7%%>ID</th>
                            <th width=12%>PASSWORD</th>
                            <th width=17%>CREATE</th>
                            <th width=17%>MODIF</th>
                        </tr>
                    </thead>
                    <tbody>
                        <!-- CONSTRUCTION TABLEAU DES USERS -->
                        <?php
                        try {
                            $bdd = new PDO('mysql:host=localhost;dbname=xxx;charset=utf8', 'xxxxx', 'xxxx');
                        } catch (Exception $e) {
                            die('Erreur : ' . $e->getMessage());
                        }
                        $query = $bdd->prepare('SELECT * FROM USERS');
                        $query->execute();
                        while ($data = $query->fetch()) {
                        ?>
                            <tr onclick="fctClick(this)">
                                <td <a href="#rh" OnClick="window.open('modal.php','titre','width=500,height=500');" ></a>
                                <?php echo $data['USER_CODE']; ?></td>
                                <td <a href="#rh" OnClick="window.open('modal.php','titre','width=500,height=500');" ></a>
                                <?php echo $data['USER_NAME']; ?></td>
                                <td <a href="#rh" OnClick="window.open('modal.php','titre','width=500,height=500');" ></a>
                                <?php echo $data['USER_PRENOM']; ?></td>
                                <td <a href="#rh" OnClick="window.open('modal.php','titre','width=500,height=500');" ></a>
                                <?php echo $data['USER_LEVEL']; ?></td>
                                <td <a href="#rh" OnClick="window.open('modal.php','titre','width=500,height=500');" ></a>
                                <?php echo $data['USER_ID']; ?></td>
                                <td <a href="#rh" OnClick="window.open('modal.php','titre','width=500,height=500');" ></a>
                                <?php echo $data['USER_PASSWORD']; ?></td>
                                <td <a href="#rh" OnClick="window.open('modal.php','titre','width=500,height=500');" ></a>
                                <?php echo $data['USER_CREATE']; ?></td>
                                <td <a href="#rh" OnClick="window.open('modal.php','titre','width=500,height=500');" ></a>
                                <?php echo $data['USER_MODIF']; ?></td>
                            </tr>
 
                        <?php
                        }
                        ?>
                    </tbody>
                </table>
                <h2>Formulaire</h2>
                <form method="POST" action="#" class="forma">
                    <table>
                        <fieldset class="fieldseta">
                            <legend>Données à modifier</legend>
                            <p><label>USER CODE</label><input type="text" name="CODE"></p>
                            <p><label>USER NAME</label><input type="text" name="Nom"></p>
                            <p><label>USER NAME 1</label><input type="text" name="Prenom"></p>
                            <p><label>USER LEVEL</label><input type="text" name="LEVEL"></p>
                            <p><label>USER ID</label><input type="text" name="ID"></p>
                            <p><label>USER PASS</label><input type="text" name="PASS"></p>
                            <p><label>USER CREATE</label><input type="text" name="CREATE"></p>
                            <p><label>USER MOFIF</label><input type="text" name="MODIF"></p>
                            <p><input type="submit" value="Modifier"><input type="reset" value="Annuler"></p>
                        </fieldset>
                    </table>
                </form>
            </section>
        </div>
        <script>
            function fctClick(obj) {
                // récup. formulaire
                var oForm = document.querySelector('form');
                // récup. INPUT type text
                var oInputs = oForm.querySelectorAll('input[type=text]');
                // transfert des contenus
                for (var i = 0, nb = obj.cells.length; i < nb; i += 1) {
                    oInputs[i].value = obj.cells[i].textContent;
                }
            }
        </script>
     <?php      
      if (isset($_POST['CODE'])) { // si formulaire soumis
      echo $_POST['code'];
      echo $_POST['name'];
      echo $_POST['prenom'];
      echo $_POST['level'];
      echo $_POST['id'];
      echo $_POST['password'];
      echo $_POST['create'];
      echo $_POST['modif'];
    }
    ?>
</body>
 
</html>