Bonjour
Je monte actuellement un formulaire de génération de fiche, en gros selon les informations entrées, l'utilisateur récupère un texte contenant ces informations (le texte étant formaté, etc).
Voyez:
http://warforum-jdr.com/genprez/presentation.php
Essayez le en utilisant uniquement les ajouts de champs dynamiques, et générez le résultat via le bouton submit. Dans le code généré, vous aurez (avec de la chance) une partie ou toutes les informations rentrées. Maintenant faits "Page précédente": les champs ont disparus, ajoutez en en entrant des nouvelles valeurs (ou les mêmes qu'avant), et générez. Il y a de grande chances pour que plus rien ne soient affichés dans les zones qui devraient afficher les valeurs des champs.
Les zones en questions:
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 echo '^ Inventaire (Encombrement: '.stripslashes($enc2).' ) ^^^^^'; if(empty($arma1[1])) { echo ''; } else{ foreach(array_keys($arma1) as $val1) { echo ' | Icone | **'.stripslashes($arma1[$val1]).'** | '.stripslashes($arma2[$val1]).' | '.stripslashes($arma3[$val1]).' |'; } } if(empty($usu1[1])) { echo ''; } else{ foreach(array_keys($usu1) as $val2) { echo ' | Icone | **'.stripslashes($usu1[$val2]).'** |||'; } } if(empty($sort1[1])) { echo ''; } else{ echo'|< 50em >| ^ Grimoire ^^'; foreach(array_keys($sort1) as $val3) { echo ' | **'.stripslashes($sort1[$val3]).'** | '.stripslashes($sort2[$val3]).' |'; } }Zone des variables concernées:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 if(empty($pdcname1[1])) { echo ''; } else{ foreach(array_keys($pdcname1) as $val4) { echo ' | **'.stripslashes($pdcname1[$val4]).'** | '.stripslashes($pdcname2[$val4]).' | 0 |'; } }
Essayez plusieurs fois et vous verrez par vous même le problème si je n'ai pas réussi à l'expliquer correctement ci dessus.
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 // Recup variables inventaires // $i=-1; while($_POST['arma1'][++$i]) { $arma1[] = $_POST['arma1'][$i]; } $i=-1; while($_POST['arma2'][++$i]) { $arma2[] = $_POST['arma2'][$i]; } $i=-1; while($_POST['arma3'][++$i]) { $arma3[] = $_POST['arma3'][$i]; } $i=-1; while($_POST['usu1'][++$i]) { $usu1[] = $_POST['usu1'][$i]; } // Fin recup variables inventaire // // Recup variables PDC // $i=-1; while($_POST['pdcname1'][++$i]) { $pdcname1[] = $_POST['pdcname1'][$i]; } $i=-1; while($_POST['pdcname2'][++$i]) { $pdcname2[] = $_POST['pdcname2'][$i]; } // Fin recup variables PDC // // Recup variables sorts // $i=-1; while($_POST['sort1'][++$i]) { $sort1[] = $_POST['sort1'][$i]; } $i=-1; while($_POST['sort2'][++$i]) { $sort2[] = $_POST['sort2'][$i]; } // Fin recup variables sorts //
Je ne comprend pas pourquoi cela donne ce résultatUn problème de variables $val- ? Ou autre chose ?
Voici le code complet de la page si besoin:
le header, presentation.php, qui contient les scripts:
presentation_generator.php correspondant le formulaire et le résultat obtenu:
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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Warhammer JDR: Jeu de rôle par forum</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="stylegenprez.css" rel="stylesheet" type="text/css" /> <!-- Ajout dynamique de champs--> <script src="http://warforum-jdr.com/genprez/champsdynoyau.js"> </script> <script type="text/javascript"> <!-- Ajout champs pdc--> function Constructpdc(){ var monfieldset=document.getElementById('Croyances'); var pdc1=$C({"obj":"input","type":"text","name":"pdcname1[]","size":"15","maxlenght":"255","value":"Nom Dieu","onclick":function(){this.value='';}} ); $Close(pdc1,monfieldset); var pdc2=$C({"obj":"input","type":"text","name":"pdcname2[]","size":"3","maxlenght":"2"} ); $Close(pdc2,monfieldset); var pdc3=$C({"obj":"br"} ); $Close(pdc3,monfieldset); } <!-- Fin ajout champs pdc--> <!-- Ajout champs armes--> function Constructarma(){ var monfieldset=document.getElementById('Armesarmures'); var pdc1=$C({"obj":"input","type":"text","name":"arma1[]","size":"20","maxlenght":"255","value":"Nom arme/armure","onclick":function(){this.value='';}} ); $Close(pdc1,monfieldset); var pdc2=$C({"obj":"input","type":"text","name":"arma2[]","size":"20","maxlenght":"255","value":"Caractéristiques","onclick":function(){this.value='';}} ); $Close(pdc2,monfieldset); var pdc3=$C({"obj":"input","type":"text","name":"arma3[]","size":"20","maxlenght":"255","value":"Autres","onclick":function(){this.value='';}} ); $Close(pdc3,monfieldset); var pdc4=$C({"obj":"br"} ); $Close(pdc4,monfieldset); } <!-- Fin ajout champs armes--> <!-- Ajout champs objets usuels--> function Constructusu(){ var monfieldset=document.getElementById('objusu'); var pdc1=$C({"obj":"input","type":"text","name":"usu1[]","size":"20","maxlenght":"255","value":"Objet usuel","onclick":function(){this.value='';}} ); $Close(pdc1,monfieldset); } <!-- Fin ajout champs objets usuels--> <!-- Ajout champs sorts--> function Constructsort(){ var monfieldset=document.getElementById('sorts'); var pdc1=$C({"obj":"input","type":"text","name":"sort1[]","size":"15","maxlenght":"255","value":"Nom du sort","onclick":function(){this.value='';}} ); $Close(pdc1,monfieldset); var pdc2=$C({"obj":"input","type":"text","name":"sort2[]","size":"20","maxlenght":"255","value":"Effets du sort","onclick":function(){this.value='';}} ); $Close(pdc2,monfieldset); var pdc3=$C({"obj":"br"} ); $Close(pdc3,monfieldset); } <!-- Fin ajout champs sorts--> </script> <!-- Calcul des caract du profil--> <script type="text/javascript"> function computeResult(colonne) { var elmt_form = document.getElementById('form1'); var resultat = elmt_form.elements['result' + colonne]; var value1 = elmt_form.elements[colonne + '1'].value; var value2 = elmt_form.elements[colonne + '2'].value; var value3 = elmt_form.elements[colonne + '3'].value; if (!isNaN(value1) && !isNaN(value2) && !isNaN(value3)) { resultat.value = parseInt(value1, 10) + parseInt(value2, 10) + parseInt(value3, 10); } else { alert('Une valeur a mal été enregistrée ou il manque une valeur'); } } </script> <!-- Anti-abus des PC--> <script type="text/javascript"> function ma_verification(champ) { if(parseInt(champ.value,10) >= 0 && parseInt(champ.value,10) <= 3) { var elmt_form = document.getElementById('form1'); var champ1 = elmt_form.elements['for2'].value; var champ2 = elmt_form.elements['end2'].value; var champ3 = elmt_form.elements['hab2'].value; var champ4 = elmt_form.elements['char2'].value; var champ5 = elmt_form.elements['int2'].value; var champ6 = elmt_form.elements['ini2'].value; var champ7 = elmt_form.elements['par2'].value; var champ8 = elmt_form.elements['att2'].value; champ1 = champ1 == "" ? 0 : champ1; champ2 = champ2 == "" ? 0 : champ2; champ3 = champ3 == "" ? 0 : champ3; champ4 = champ4 == "" ? 0 : champ4; champ5 = champ5 == "" ? 0 : champ5; champ6 = champ6 == "" ? 0 : champ6; champ7 = champ7 == "" ? 0 : champ7; champ8 = champ8 == "" ? 0 : champ8; var total = parseInt(champ1,10) + parseInt(champ2,10) + parseInt(champ3,10) + parseInt(champ4,10) + parseInt(champ5,10) + parseInt(champ6,10) + parseInt(champ7,10) + parseInt(champ8,10); if(total > 5) { alert("Vous ne disposez que de 5 PC initiaux, vous ne pouvez pas en utiliser plus ;) "); champ.value = 0; champ.focus(); } else { } } else { alert("Vous ne pouvez pas investir plus de 3 PC dans une même caractéristique au départ"); champ.value = 0; champ.focus(); } } </script> <!-- Anti-abus des bonus malus de classe--> <script type="text/javascript"> function ma_verification2(champ) { if(parseInt(champ.value,10) >= -2 && parseInt(champ.value,10) <= 2) { } else { alert("Le bonus/malus indiqué semble trop élevé"); champ.value = 0; champ.focus(); } } </script> <script language="Javascript"> // ================== // Activations - Désactivations du champs sorcier // ================== function GereControle(Controleur, Controle, Masquer) { var objControleur = document.getElementById(Controleur); var objControle = document.getElementById(Controle); if (Masquer=='1') objControle.style.visibility=(objControleur.checked==true)?'visible':'hidden'; else objControle.disabled=(objControleur.checked==true)?false:true; return true; } </script> </head> <body style="background-image:url(http://i40.tinypic.com/nwgdh1.jpg); background-attachment: fixed; background-repeat: no-repeat;"> <?php require('../traceIP/trace_ip.php'); ?> <table width="950" align="center" border="0" style="background-color:#929B98;"> <tr> <td width="300"><div class="heading"> <p>Warhammer JDR</p> <blockquote> <blockquote> <p>Générateur de personnage</p> </blockquote> </blockquote> </div> <p align="left"><em><br /> Cette page vous permet, grâce à une interface claire et rapide, de créer votre personnage de A à Z, de manière assistée et pas à pas. Suivez les étapes une à une, et vous génèrerez le code complet correspondant à la fiche de votre personnage, mise en page, qui n'attendra qu'une validation de la part des MJ. </em><br /> <strong>Veuillez remplir - entièrement - ce formulaire pour générer votre fiche personnage simplement. Les (?) sont des infobulles d'aide qui vous seront utiles, lisez-les en pointant votre souris dessus.</strong></p></td> <td width="193" style="padding-left:15px" align="center"> <?php include("../menu.php"); ?> <br> </td> </tr> </table> <?php require("presentation_generator.php"); form_meta("presentationfinale.php"); ?> </body> </html>
Merci d'avance de votre aide
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477 <?php function form_meta($wow) { echo' <form id="form1" method="post" action="'.$wow.'"> <table width="950" align="center" border="0" cellspacing="0" cellpadding="0" class="table" style="background-color:#929B98;"> <tr> <td valign="top" align="right" >Nom & Prénom du personnage: </td> <td valign="top" align="left" ><input name="nomperso" type="text" id="nomperso" size="25" maxlength="255" /></td> </tr> <tr> <td valign="top" align="right" >Sexe: </td> <td valign="top" align="left"> <input type="radio" name="sexe" value="Masculin" id="sexemale" /><label for="sexemale">♂</label> <input type="radio" name="sexe" value="Féminin" id="sexefemelle" /> <label for="sexefemelle">♀</label> <input type="radio" name="sexe" value="Indéfini ou asexué" id="sexeindefini" /> <label for="sexeindefinie"> Indéfini</label> </p> </td> </tr> <tr> <td valign="top" align="right" >Âge du personnage: </td> <td valign="top" align="left"><input name="age" type="text" id="age" size="4" maxlength="4"> ans</td> </tr> <tr> <td valign="top" align="right" >Avatar du personnage (adresse image): </td> <td valign="top" align="left"><input name="avatar" type="text" id="avatar" size="35" maxlength="255"></td> </tr> <tr> <td valign="top" align="right" >Race </td> <td valign="top" align="left"><input name="race" type="text" id="race" size="15" maxlength="255"></td> </tr> <tr> <td valign="top" align="right" >Carrière : <br /></td> <td valign="top" align="left"><input name="carriere" type="text" id="carriere" /></td> </tr> <tr> <td valign="top" align="right" >Lieu de départ: <br /></td> <td valign="top" align="left"><input name="depart" type="text" id="depart"></td> </tr> <tr> <td valign="top" align="right" >Fréquence de jeu: <br /></td> <td valign="top" align="left"><input name="frequence" type="text" id="frequence"></td> </tr> <tr> <td valign="top" align="right" >Description physique du personnage (minimum 15 lignes complètes)<br /></td> <td valign="top" align="left"><textarea name="physique" cols="50" rows="2" id="physique"></textarea></td> </tr> <tr> <td valign="top" align="right" >Description psychologique du personnage (minimum 15 lignes complètes)<br /></td> <td valign="top" align="left"><textarea name="psycho" cols="50" rows="2" id="psycho"></textarea></td> </tr> <tr> <td valign="top" align="right" >Alignement du personnage: </td> <td valign="top" align="left"><input name="align" type="text" id="align" size="25" maxlength="255" /></td> </tr> <tr> <td valign="top" align="right" >Histoire du personnage (avant qu\'il ne commence l\'aventure ici) (minimum 20 lignes complètes)<br /></td> <td valign="top" align="left"><textarea name="histoire" cols="50" rows="2" id="histoire"></textarea></td> </tr> <tr> <td valign="top" align="right" >Vos compétence de départ (et leurs descriptions !) (<a href="http://warforum-jdr.com/wiki-v2/doku.php?id=1.5_competences" target=_blank>règles</a>):<br /></td> <td valign="top" align="left"><textarea name="comp" cols="50" rows="2" id="comp"></textarea></td> </tr> <tr> <td valign="top" align="right" >Votre bourse de pistole de départ: <strong><a title="Souvent 50 pistoles, néanmoins certaines carrières peuvent proposer un petit bonus pécunier au départ. Les Marchands ont quant à eux 4000 pistoles de départ pour couvrir leurs frais d\'ouvertures de magasins et d\'achat d\'objets.">(?)</a></strong><br /></td> <td valign="top" align="left"><input name="bourse" type="text" id="bourse" size="4" maxlength="3"> Pistoles</td> </tr> <tr> <td valign="top" align="right" >Vos dotations initiales (<a href="http://warhammer-jdr.kalikoba.com/shop.php" target=_blank>La liste des objets par magasin</a>)<strong><a title="Un personnage non marchand a droit à 2 objets raciaux (armes/armures) qui devront être en lien avec son background, et correspondre à sa vocation ! De plus, ils ne devront pas être exagéré (donc pas de hache à 2000 pistoles en commençant). Ces objets seront vérifiés par le MJ en charge du PJ. Il aura également droit à 5 objets usuels libre au choix. || Un personnage marchand, lui, ne reçoit pas d\'objets de départ, mais une bourse assez conséquente en contrepartie.">(?)</a></strong>:<br /></td> <td valign="top" align="left"> <fieldset id=\'Armesarmures\'> <legend>Armes et armures:</legend> <input type=\'button\' value=\'Ajouter un objet\' onclick="Constructarma()" /><br /> </fieldset> <fieldset id=\'objusu\'> <legend>Objets usuels:</legend> <input type=\'button\' value=\'Ajouter un objet\' onclick="Constructusu()" /><br /> </fieldset> <br></td> </tr> <tr> <td valign="top" align="right"></td> <td valign="top" align="left"> <fieldset id=\'Croyances\'> <legend>Croyance religieuse (<a href="http://warforum-jdr.com/wiki-v2/doku.php?id=3.7_regles_concernant_les_croyances" target=_blank>Points de croyances</a>):</legend> <input type=\'button\' value=\'Ajouter un Dieu\' onclick=\'Constructpdc()\' /><br /> </fieldset> <br> </tr> <tr> <td valign="top" align="right" ><input type="checkbox" id="chkb_10" onClick="GereControle(\'chkb_10\', \'texte_10\', \'1\');" CHECKED> <label for="chkb_10">Décochez si vous n\'êtes pas une carrière magique </label>:<br /></td> <td valign="top" align="left"><fieldset id=\'sorts\'> <legend>Grimoire de sorts (<a href="http://warforum-jdr.com/wiki-v2/doku.php?id=magie" target=_blank>Domaines de Magie et sorts disponibles</a>):</legend> <input type=\'button\' id="texte_10" value=\'Ajouter un sort\' onclick=\'Constructsort()\' /><br /> </fieldset><br \></td> </tr> <tr> <td valign="top" align="right" >Autres (traits particuliers, notes, etc):<br /></td> <td valign="top" align="left"><textarea name="autre" cols="50" rows="2" id="autre"></textarea><br \></td> </tr> </table> <!-- debut demarche profil --> <table width="950" align="center" border="0" cellspacing="0" cellpadding="0" class="table" align="justify" style="background-color:#929B98;"> <tr > <th scope="col"></th> <th scope="col">FOR</th> <th scope="col">END</th> <th scope="col">HAB</th> <th scope="col">CHAR</th> <th scope="col">INT</th> <th scope="col">INI</th> <th scope="col">PAR</th> <th scope="col">ATT</th> </tr> <tr> <th scope="row">Profil de base</th> <td align="left"><input name="for1" onchange="javascript:computeResult(\'for\');" value="0" size="2" maxlength="2" /></td> <td align="left"><input name="end1" onchange="javascript:computeResult(\'end\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="hab1" onchange="javascript:computeResult(\'hab\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="char1" onchange="javascript:computeResult(\'char\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="int1" onchange="javascript:computeResult(\'int\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="ini1" onchange="javascript:computeResult(\'ini\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="par1" onchange="javascript:computeResult(\'par\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="att1" onchange="javascript:computeResult(\'att\');" value="0" size="2" maxlength="2" /> </td> </tr> <tr> <th scope="row">Vos 5 PC</th> <td align="left"><input name="for2" onchange="javascript:ma_verification(this); computeResult(\'for\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="end2" onchange="javascript:ma_verification(this); computeResult(\'end\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="hab2" onchange="javascript:ma_verification(this); computeResult(\'hab\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="char2" onchange="javascript:ma_verification(this); computeResult(\'char\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="int2" onchange="javascript:ma_verification(this); computeResult(\'int\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="ini2" onchange="javascript:ma_verification(this); computeResult(\'ini\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="par2" onchange="javascript:ma_verification(this); computeResult(\'par\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="att2" onchange="javascript:ma_verification(this); computeResult(\'att\');" value="0" size="2" maxlength="2" /> </td </tr> <tr> <th scope="row">Bonus/malus de classe (malus = nombre précédé d\'un - !)</th> <td align="left"><input name="for3" onchange="javascript:ma_verification2(this); computeResult(\'for\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="end3" onchange="javascript:ma_verification2(this); computeResult(\'end\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="hab3" onchange="javascript:ma_verification2(this); computeResult(\'hab\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="char3" onchange="javascript:ma_verification2(this); computeResult(\'char\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="int3" onchange="javascript:ma_verification2(this); computeResult(\'int\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="ini3" onchange="javascript:ma_verification2(this); computeResult(\'ini\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="par3" onchange="javascript:ma_verification2(this); computeResult(\'par\');" value="0" size="2" maxlength="2" /> </td> <td align="left"><input name="att3" onchange="javascript:ma_verification2(this); computeResult(\'att\');" value="0" size="2" maxlength="2" /> </td </tr> <tr> <th scope="row">Profil final</th> <td align="left"><input id="resultfor" name="resultfor" size="2" maxlength="2" readonly="readonly" /></td> <td align="left"><input id="resultend" name="resultend" size="2" maxlength="2" readonly="readonly" /></td> <td align="left"><input id="resulthab" name="resulthab" size="2" maxlength="2" readonly="readonly" /></td> <td align="left"><input id="resultchar" name="resultchar" size="2" maxlength="2" readonly="readonly" /> </td> <td align="left"><input id="resultint" name="resultint" size="2" maxlength="2" readonly="readonly" /></td> <td align="left"><input id="resultini" name="resultini" size="2" maxlength="2" readonly="readonly" /></td> <td align="left"><input id="resultpar" name="resultpar" size="2" maxlength="2" readonly="readonly" /></td> <td align="left"><input id="resultatt" name="resultatt" size="2" maxlength="2" readonly="readonly" /></td> </tr> </table><br \> <center><input type="submit" value="Générer la présentation" /></center> </form>'; } function generation() { // les différentes variables sont exprimées ici $nomperso = $_POST['nomperso']; $avatar = $_POST['avatar']; $age = $_POST['age']; $sexe = $_POST['sexe']; $race = $_POST['race']; $carriere = $_POST['carriere']; $depart = $_POST['depart']; $frequence = $_POST['frequence']; $physique = $_POST['physique']; $psycho = $_POST['psycho']; $align = $_POST['align']; $histoire = $_POST['histoire']; $comp = $_POST['comp']; $bourse = $_POST['bourse']; // Recup variables inventaires // $i=-1; while($_POST['arma1'][++$i]) { $arma1[] = $_POST['arma1'][$i]; } $i=-1; while($_POST['arma2'][++$i]) { $arma2[] = $_POST['arma2'][$i]; } $i=-1; while($_POST['arma3'][++$i]) { $arma3[] = $_POST['arma3'][$i]; } $i=-1; while($_POST['usu1'][++$i]) { $usu1[] = $_POST['usu1'][$i]; } // Fin recup variables inventaire // // Recup variables PDC // $i=-1; while($_POST['pdcname1'][++$i]) { $pdcname1[] = $_POST['pdcname1'][$i]; } $i=-1; while($_POST['pdcname2'][++$i]) { $pdcname2[] = $_POST['pdcname2'][$i]; } // Fin recup variables PDC // // Recup variables sorts // $i=-1; while($_POST['sort1'][++$i]) { $sort1[] = $_POST['sort1'][$i]; } $i=-1; while($_POST['sort2'][++$i]) { $sort2[] = $_POST['sort2'][$i]; } // Fin recup variables sorts // $autre = $_POST['autre']; $resultfor = $_POST['resultfor']; $resultend = $_POST['resultend']; $resulthab = $_POST['resulthab']; $resultchar = $_POST['resultchar']; $resultint = $_POST['resultint']; $resultini = $_POST['resultini']; $resultpar = $_POST['resultpar']; $resultatt = $_POST['resultatt']; $enc1 = $resultend / 2; $enc2 = $enc1 + 1; $enc2 = floor($enc2); $pv = $resultend * 5; echo 'Fenêtre n°1 avec le code à copier sur le forum: <form method="post" action=""><textarea name="code" onFocus="select()" rows="20" cols="80" readonly="readonly"> Nom et Prénom: '.stripslashes($nomperso).' Sexe: '.stripslashes($sexe).' Age: '.stripslashes($age).' ans Race: '.stripslashes($race).' Carrière: '.stripslashes($carriere).' Lieu/ville de départ: '.stripslashes($depart).' Fréquence de jeu: '.stripslashes($frequence).' Profil: FOR '.stripslashes($resultfor).' / END '.stripslashes($resultend).' / HAB '.stripslashes($resulthab).' / CHAR '.stripslashes($resultchar).' / INT '.stripslashes($resultint).' / INI '.stripslashes($resultini).' / PAR '.stripslashes($resultpar).' / ATT '.stripslashes($resultatt).' / PV '.stripslashes($pv).'/'.stripslashes($pv).' <hr /> <div style="text-align: center;">Description physique :</div> '.stripslashes($physique).' <div style="text-align: center;">Description psychologique :</div> '.stripslashes($psycho).' Alignement : '.stripslashes($align).' <div style="text-align: center;">Historique :</div> '.stripslashes($histoire).' <hr /> Compétences : pas encore codé, visible sur la fiche Bourse: '.stripslashes($bourse).' Pistoles || Autres : Inventaire: pas encore codé, visible sur la fiche <hr /> Autres: '.stripslashes($autre).' <hr /> <hr /> <div style="text-align: center;">Code pour fiche </div> Code : <html><p style="text-align: center; font-family: verdana,geneva; font-size: large; font-weight: bold; color: #6a94bd; text-decoration: underline;"></html>Informations générales sur le personnage :<html></p><center></html> |< 50em >| | **Nom et Prénom:** | '.stripslashes($nomperso).' | <html><img src="'.stripslashes($avatar).'" /></html> | | **Age:** | '.stripslashes($age).' ans | ::: | | **Sexe: ** | '.stripslashes($sexe).' | ::: | | **Race: ** | '.stripslashes($race).' | ::: | | **Carrière: ** | '.stripslashes($carriere).' | ::: | | **Lieu/ville de départ:** | '.stripslashes($depart).' | ::: | | **Fréquence de jeu:** | '.stripslashes($frequence).' | ::: | | **MJ:** | **à compléter** | ::: | <html><br></html> ^ FOR ^ END ^ HAB ^ CHAR ^ INT ^ INI ^ ATT ^ PAR ^ PV ^ | '.stripslashes($resultfor).' | '.stripslashes($resultend).' | '.stripslashes($resulthab).' | '.stripslashes($resultchar).' | '.stripslashes($resultint).' | '.stripslashes($resultini).' | '.stripslashes($resultpar).' | '.stripslashes($resultatt).' | '.stripslashes($pv).'/'.stripslashes($pv).' | <html><br></html> | **XP disponible:** | 0 | | **PC dépensés:** | 5 | | **PC disponibles:** | 0 | <html><br></center></html> ---- ---- <html><br></html> <html><img align="right" src="http://warforum-jdr.com/images/imgfiches/barre2.jpg" /></html> <html><p style="text-align: center; font-family: verdana,geneva; font-size: large; font-weight: bold; color: #6a94bd; text-decoration: underline;"></html>Description physique :<html></p></html> '.stripslashes($physique).' <html><p style="text-align: center; font-family: verdana,geneva; font-size: large; font-weight: bold; color: #6a94bd; text-decoration: underline;"></html>Description psychologique :<html></p></html> '.stripslashes($psycho).' __Alignement :__ '.stripslashes($align).' <html><p style="text-align: center; font-family: verdana,geneva; font-size: large; font-weight: bold; color: #6a94bd; text-decoration: underline;"></html>Historique du personnage :<html></p></html> '.stripslashes($histoire).' <html><br></html> ---- ---- <html><br></html> <html><img align="left" src="http://warforum-jdr.com/images/imgfiches/barre4.jpg" /></html> <html><p style="text-align: center; font-family: verdana,geneva; font-size: large; font-weight: bold; color: #6a94bd; text-decoration: underline;"></html>Compétences :<html></p></html> '.stripslashes($comp).' <html><br></html> <html><br></html> <html><br></html> <html><br></html> <html><br></html> <html><br></html> ---- ---- <html><br></html> <html><center></html> <html><img src="http://warforum-jdr.com/images/imgfiches/barre3.jpg" /></html> <html><p style="font-family: verdana,geneva; font-size: large; font-weight: bold; color: #6a94bd; text-decoration: underline;"></html>Inventaires et biens du personnage:<html></p></html> | **Bourse:** | '.stripslashes($bourse).' Pistoles || Autres : 20 Jetons de Nowel (pour event Nowel) | <html><br></html> |< 50em >| ^ Inventaire (Encombrement: '.stripslashes($enc2).' ) ^^^^^'; if(empty($arma1[1])) { echo ''; } else{ foreach(array_keys($arma1) as $val1) { echo ' | Icone | **'.stripslashes($arma1[$val1]).'** | '.stripslashes($arma2[$val1]).' | '.stripslashes($arma3[$val1]).' |'; } } if(empty($usu1[1])) { echo ''; } else{ foreach(array_keys($usu1) as $val2) { echo ' | Icone | **'.stripslashes($usu1[$val2]).'** |||'; } } if(empty($sort1[1])) { echo ''; } else{ echo'|< 50em >| ^ Grimoire ^^'; foreach(array_keys($sort1) as $val3) { echo ' | **'.stripslashes($sort1[$val3]).'** | '.stripslashes($sort2[$val3]).' |'; } } echo ' <html></center></html> <html><br></html> ===== Parcours ===== ===Quêtes accomplies=== Nom + lien + récompenses obtenues === Classes acquises === === Voie et Classe en cours d\'apprentissage=== **Voie :** <html><br></html> **Classe actuelle :** '.stripslashes($carriere).' === Dévotion religieuse === ^ Dieu ^ Points de dévotions disponibles ^ Points de dévotions dépensés ^'; if(empty($pdcname1[1])) { echo ''; } else{ foreach(array_keys($pdcname1) as $val4) { echo ' | **'.stripslashes($pdcname1[$val4]).'** | '.stripslashes($pdcname2[$val4]).' | 0 |'; } } echo ' ==== Autres ==== __**Au MJ: merci de mettre les éventuels points de croyance dans le cadre ci-dessus**__ '.stripslashes($autre).' </textarea></form>'; echo 'Fenêtre n°2 avec le code à copier pour votre signature: <form method=\"post\" action=\"\"><textarea name="codesign" rows="5" cols="70" onFocus="select()" readonly="readonly"> '.stripslashes($nomperso).', '.stripslashes($carriere).' Profil: For '.stripslashes($resultfor).' | End '.stripslashes($resultend).' | Hab '.stripslashes($resulthab).' | Cha '.stripslashes($resultchar).' | Int '.stripslashes($resultint).' | Ini '.stripslashes($resultini).' | Att '.stripslashes($resultatt).' | Par '.stripslashes($resultpar).' | PV '.stripslashes($pv).' Lien Fiche personnage: à demander au MJ </textarea></form> NB: ce code correspond au minimum de ce qu\'on vous demande en signature. Libre à vous d\'ajouter d\'autres informations. '; echo' <br/> <a href="http://warforum-jdr.com">Retour au forum</a>'; } ?>
Partager