Salutation tout le monde!!!!
Je continue mon développement avec le plug in autocomplete de jquery et je rencontre un problème. Le problème est justement l'importation des librairies. Car je comprends pas j'ai déjà ajouté des librairie sur mes pages et tout fonctionne mais la je sais pas pourquoi mon champ autocomplete ne s'affiche pas alors que la librairie devrai marcher. Je vous explique j'ai une page web jusque la tout est bon, dans laquelle j'affcihe un tableau dans une div via du javascript, dans ce tableau j'ai des icônes qui lorsque l'on clique dessus affichent un formulaire (toujours en passant pas du javascript) et c'est dans ce formulaire que je souhaite insérer mon champ autocompete de jquery. J'espère avoir été assez clair.
Voici le code de ma page:
Code php : 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 <html lang="fr"> <head> <meta charset="utf-8"> <title><?php echo $result['LABEL_SOUS_MENU'];?></title> <link rel="shortcut icon" type="image/x-icon" href="../../image/favicon.ico" /> <link href="../../css/couleur.css" rel="stylesheet" type="text/css" /> <link href="../../css/page.css" rel="stylesheet" type="text/css" /> <link href="../../css/formulaire.css" rel="stylesheet" type="text/css" /> <link href="../../css/tableau.css" rel="stylesheet" type="text/css" /> <link href="css/dm.css" rel="stylesheet" type="text/css" /> <script src="ajax/en_cours.js"></script> <script src="ajax/besoin.js"></script> <script src="ajax/lot.js"></script> <link href="css/jquery-ui.css" rel="stylesheet"> <script type="text/javascript" language="javascript" src="ajax/jquery-2.1.4.min.js"></script> <script type="text/javascript" src="ajax/jquery-ui-1.11.4.custom/jquery-ui.js"></script> <script type="text/javascript" language="javascript" src="ajax/jquery.autocomplete.js"></script> <script src="ajax/emplacement.js"></script> </head> <body class="couleur3"> <div id="entete" class="couleur1"><?php include("../../include/entete.php");?> </div> <br clear="all" /> <div id="corps"> <form> <div class="couleur4 filtre" > <div style="float:left;"> <div class="bordure_droite"> <label for="num_lot" class="label_3">N° Lot</label><br class="br" /> <input class="input" type="text" id="num_lot" > <br clear="all" /> <label for="emplacement" class="label_3">Emplacements</label><br class="br" /> <select id="emplacement" class="select"> <option value="0">...</option><?php $req_emplacement = "SELECT ID_EMPLACEMENT,NOM_EMPLACEMENT FROM POP_EMPLACEMENT"; $req_emplacement = oci_parse($conn, $req_emplacement); oci_execute($req_emplacement,OCI_COMMIT_ON_SUCCESS); while($list_emplacement = oci_fetch_assoc($req_emplacement)){ echo "<option value=".$list_emplacement['ID_EMPLACEMENT'].">".$list_emplacement['NOM_EMPLACEMENT']."</option>"; }?> </select> </div> <div class="bordure_droite"> <label for="designation_stock" class="label_3">Désignation</label><br class="br" /> <input class="input" type="text" id="designation_stock" > </div> <div class="bordure_droite"> <label for="reference_stock" class="label_3">Reference</label><br class="br" /> <input class="input" type="text" id="reference_stock" > </div> <div class="bordure_droite"> <label for="statut" class="label_3">Statut</label><br class="br" /> <select id="statut" class="select"> <option value="1">Différent de 0</option> <option value="2">Egal à 0</option> </select> </div> </div> <div style="float:left;height:100px;"> <div style="float:left"> <button type="reset" style="float:left;margin:0px 10px 10px 10px;width:120px;" class="bouton_3 couleur16">Réinitialiser</button> <button type="button" style="float:left;margin:0px 10px 0px 10px;width:120px;" class="bouton_3 couleur16" onclick="tableau_stock(1,num_lot.value,emplacement.value,designation_stock.value,reference_stock.value,statut.value);">Rechercher</button> <br clear="all" /> <button type="button" style="float:left;margin:0px 10px 0px 10px;width:120px;" class="bouton_3 couleur16" onclick="document.location.href='aff_tracabilite.php';">Traçabilité</button> </div> </div> </div> </form> <?php //pour revenir comme avant enlever tout à partir de position ?> <div id="div_formulaire" style="display: inline;margin-top:8px;width:28%;position:fixed;float:right;right:10px;top:210px;" ></div> <div id="div_tableau" style=" display: inline;"></div> <div id="div_formulaire2" style=" display: block;"></div> </div> <script type='text/javascript'>tableau_stock(0,0,0,0,0,0);</script> <script type='text/javascript'>emplacement();</script> </body> <footer > </footer> </html>
Le code de mon tableau:
Code php : 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 <div id="div_form" style="width:75%;"> <div style="float:left;width:95%;margin:8px 5px 5px 0px;border-radius:4px;padding:5px;" class="couleur2"> <form id="form_controle" method='post' onsubmit='' action="#" > <table class="table"> <tr class="couleur5"> <th class="th site" rowspan="2" style="width:15%;">Numéro de lot <br /> <label style="color:blue;"><?php echo "Produits finis";?></label> / <label style="color:red;"><?php echo "PSO";?></label> </th> <th class="th site" rowspan="2">Date <br/> de reception</th> <th class="th site" rowspan="2" style="width:20%;">Designation <br/> Reference & Indice <br/> (Fournisseur) </th> <th class="th site" rowspan="2">N° Projet</th> <th class="th site" style="width:8%;" rowspan="2">e/c V</th> <th class="th site" colspan="3">Quantité en stock</th> <th class="th site" rowspan="2">Empl.</th> <th class="th site" rowspan="2" style="width:15%;">Faire un mouvement de stock</th> <th class="th site" rowspan="2" style="width:9%;">Impression étiquette</th> </tr> <tr class="couleur5"> <th class="th" >Qte OK</th> <th class="th">Qte DRG</th> <th class="th">Qte NOK</th> </tr> <?php $flag_couleur = 0; while($result1 = oci_fetch_assoc($statement1)) {?> <tr <?php if($flag_couleur%2 == 0){echo "class='couleur6'";}else{echo "class='couleur7'";}?>> <?php if($result1['QTE_PIECE_OK'] == 0){ $qte_ok = 0; } else { $qte_ok = $result1['QTE_PIECE_OK']; } if($result1['QTE_PIECE_DRG'] == 0){ $qte_drg = 0; } else { $qte_drg = $result1['QTE_PIECE_DRG']; } if($result1['QTE_PIECE_NOK'] == 0){ $qte_nok = 0; } else { $qte_nok = $result1['QTE_PIECE_NOK']; } if($result1['NB_PIECE_OK'] == 0){ $qte_ok_recu = 0; } else { $qte_ok_recu = $result1['NB_PIECE_OK']; } if($result1['NB_PIECE_DRG'] == 0){ $qte_drg_recu = 0; } else { $qte_drg_recu = $result1['NB_PIECE_DRG']; } if($result1['NB_PIECE_NOK'] == 0){ $qte_nok_recu = 0; } else { $qte_nok_recu = $result1['NB_PIECE_NOK']; } ?> <?php if($result1['LOT_PSO'] == 1){ ?> <td class='td' style="cursor:pointer;" onclick="Historique_mouvement(<?php echo $result1['ID_STOCK'];?>)"> <a style="color:red;font-size: 14px;font-weight: bold;" alt="<?php echo $result1['COMMENTAIRE'];?>" title="<?php echo $result1['COMMENTAIRE'];?>"><?php echo $result1['NUM_EN_COURS_DEG'];?></a> <?php if($result1['ID_STATUT_VALIDATION_QUALITE'] == 1){ ?> <img style='' src='../../icone/alarme-sonnette.png' alt='Impr_Eti' title="Lot à valider" /> <?php } ?> </td> <?php } else{ ?> <td class='td' style="cursor:pointer;" onclick="Historique_mouvement(<?php echo $result1['ID_STOCK'];?>)"> <a style="color:blue;font-size: 14px;font-weight: bold;" alt="<?php echo $result1['COMMENTAIRE'];?>" title="<?php echo $result1['COMMENTAIRE'];?>"><?php echo $result1['NUM_EN_COURS_DEG'];?></a> <?php if($result1['ID_STATUT_VALIDATION_QUALITE'] == 1){ ?> <img style='' src='../../icone/alarme-sonnette.png' alt='Impr_Eti' title="Lot à valider" /> <?php } ?> </td> <?php } ?> <td class='td' style="cursor:pointer;" onclick="Historique_mouvement(<?php echo $result1['ID_STOCK'];?>)"><?php echo $result1['DATE_RECEPTION'];?></td> <td class='td' style="cursor:pointer;" onclick="Historique_mouvement(<?php echo $result1['ID_STOCK'];?>)"> <a style="font-weight: bold;"><?php echo $result1['DESIGNATION']."<br />"."Ref :".$result1['REFERENCE']." -Ind :".$result1['INDICE'];?></a> <br /> <?php echo "(".$result1['NOM_FOURNISSEUR'].")" ?></td> <td class='td' style="cursor:pointer;" onclick="Historique_mouvement(<?php echo $result1['ID_STOCK'];?>)"><?php echo $result1['NUM_PROJET'];?> <br /> <?php echo $result1['NUM_AFFAIRE'];?> </td> <td class='td' style="cursor:pointer;<?php if($result1['ID_STATUT_VALIDATION_QUALITE'] == 1){echo "background-color:#ADD8E6;";} ?>" onclick="Historique_mouvement(<?php echo $result1['ID_STOCK'];?>)"> <?php echo $result1['QUANTITE_RECU'];?> <?php if($result1['ID_STATUT_VALIDATION_QUALITE'] == 1){ ?> <img style='' src='../../icone/alarme-sonnette.png' alt='Impr_Eti' title="Lot à valider" /> <?php } ?> <br style="clear:both;"/> <label style="float:left;color:green;font-size:10px;"title="Quantité OK"><?php echo '('.$qte_ok_recu.')';?></label> <label style="margin:auto;color:#FF8C00;font-size:10px;"title="Quantité DRG"><?php echo '('.$qte_drg_recu.')';?></label> <label style="float:right;color:red;font-size:10px;"title="Quantité NOK"><?php echo '('.$qte_nok_recu.')';?></label> </td> <td class='td' style="<?php if($qte_ok != 0) {echo "background-color:#BEE8BE;color:green;font-weight : bold;";}?>cursor:pointer;" onclick="Historique_mouvement(<?php echo $result1['ID_STOCK'];?>)"><?php echo $qte_ok;?></td> <td class='td' style="<?php if($qte_drg != 0) {echo "background-color:#EEEEBE;color:orange;font-weight : bold;";}?>cursor:pointer;" onclick="Historique_mouvement(<?php echo $result1['ID_STOCK'];?>)"><?php echo $qte_drg;?></td> <td class='td' style="<?php if($qte_nok != 0) {echo "background-color:#E8BEBE;color:red;font-weight : bold;";}?>cursor:pointer;" onclick="Historique_mouvement(<?php echo $result1['ID_STOCK'];?>)"><?php echo $qte_nok;?></td> <td class='td' style="cursor:pointer;font-weight : bold;" onclick="Historique_mouvement(<?php echo $result1['ID_STOCK'];?>)"><?php echo $result1['NOM_EMPLACEMENT'];?></td> <td class='td'> <img onclick='Mouvement_stock(<?php echo $result1['ID_STOCK'];?>)' style='cursor: pointer;margin:5px; width:30px;' src='../../icone/mouvement_stock.png' title="Mouvement de stock" /> <img style="cursor: pointer;margin-left:4px;" onclick="creer_appro(<?php echo $result1['ID_STOCK'];?>);" src='../../icone/N_copier.png' style="float:left;margin:1px 4px 0px 0px;" alt='Créer A' title='Faire une sortie sur appro et créer un appro' /> <img onclick='Deplacement(<?php echo $result1['ID_STOCK'];?>)' style='cursor: pointer;width:30px;height:30px;' src='../../icone/mise_en_stock_physique.png' title="Deplacement" /> <?php if((($qte_ok != 0) && ($qte_drg != 0) && ($qte_nok == 0)) || (($qte_ok == 0) && ($qte_drg != 0) && ($qte_nok != 0)) || (($qte_ok != 0) && ($qte_drg == 0) && ($qte_nok != 0)) || (($qte_ok != 0) && ($qte_drg != 0) && ($qte_nok != 0))){?> <img onclick='Subdiviser(<?php echo $result1['ID_STOCK'];?>)' style='cursor: pointer;width:30px;height:30px;' src='../../icone/subdiviser.png' title="Subdiviser le lot" /> <?php }?> </td> <td class='td'> <img onclick='Etiquette_lot3(<?php echo $result1['ID_STOCK'];?>)' style='cursor: pointer;margin:5px; width:30px;' src='../../icone/Barcode.ico' alt='Impr_Eti' title="Imprimer l'étiquette" /> </td> </tr><?php $flag_couleur++; } ?> </table> </form> </div> <div id="div_etiquette"></div> </div>
le code du formulaire:
Code php : 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 <div style="float:right;border-radius:4px;width:75%;" class="couleur2"> <form style="padding:5px;font-family:Segoe UI;font-size:11pt;color:black;" method="post"> <fieldset style="margin:5px auto;border-radius:4px;" class="couleur4"> <legend>Décplacer le lot : <?php echo $stock['NUM_EN_COURS_DEG']; ?></legend> <label for="qte_piece_ok" class="label">Qte piece ok</label><br class="br"/> <input id="qte_piece_ok" style="width:85%;" name="qte_piece_ok" class="input" type="text" <?php if($stock['QTE_PIECE_OK'] == 0) echo "disabled"; ?> /> <br class="br"/> <label for="emplacement_ok" class="label_3">Emplacements OK</label><br class="br" /> <select id="emplacement_ok" name="emplacement_ok" class="select" <?php if($stock['QTE_PIECE_OK'] == 0) echo "disabled"; ?>> <option value="0">...</option><?php $req_emplacement = "SELECT ID_EMPLACEMENT,NOM_EMPLACEMENT FROM POP_EMPLACEMENT"; $req_emplacement = oci_parse($conn, $req_emplacement); oci_execute($req_emplacement,OCI_COMMIT_ON_SUCCESS); while($list_emplacement = oci_fetch_assoc($req_emplacement)){ echo "<option value=".$list_emplacement['ID_EMPLACEMENT'].">".$list_emplacement['NOM_EMPLACEMENT']."</option>"; }?> </select> <br class="br"/> <label for="qte_piece_drg" class="label">Qte piece DRG</label><br class="br"/> <input id="qte_piece_drg" style="width:85%;" name="qte_piece_drg" class="input" type="text" <?php if($stock['QTE_PIECE_DRG'] == 0) echo "disabled"; ?>/> <br class="br"/> <label for="emplacement_drg" class="label_3">Emplacements DRG</label><br class="br" /> <select id="emplacement_drg" name="emplacement_drg" class="select" <?php if($stock['QTE_PIECE_DRG'] == 0) echo "disabled"; ?>> <option value="0">...</option><?php $req_emplacement = "SELECT ID_EMPLACEMENT,NOM_EMPLACEMENT FROM POP_EMPLACEMENT"; $req_emplacement = oci_parse($conn, $req_emplacement); oci_execute($req_emplacement,OCI_COMMIT_ON_SUCCESS); while($list_emplacement = oci_fetch_assoc($req_emplacement)){ echo "<option value=".$list_emplacement['ID_EMPLACEMENT'].">".$list_emplacement['NOM_EMPLACEMENT']."</option>"; }?> </select> <br class="br"/> <label for="qte_piece_nok" class="label">Qte piece nok</label><br class="br"/> <input id="qte_piece_nok" style="width:85%;" name="qte_piece_nok" class="input" type="text" <?php if($stock['QTE_PIECE_NOK'] == 0) echo "disabled"; ?> /> <br class="br"/> <label for="emplacement_nok" class="label_3">Emplacements NOK</label><br class="br" /> <select id="emplacement_nok" name="emplacement_nok" class="select" <?php if($stock['QTE_PIECE_NOK'] == 0) echo "disabled"; ?>> <option value="0">...</option><?php $req_emplacement = "SELECT ID_EMPLACEMENT,NOM_EMPLACEMENT FROM POP_EMPLACEMENT"; $req_emplacement = oci_parse($conn, $req_emplacement); oci_execute($req_emplacement,OCI_COMMIT_ON_SUCCESS); while($list_emplacement = oci_fetch_assoc($req_emplacement)){ echo "<option value=".$list_emplacement['ID_EMPLACEMENT'].">".$list_emplacement['NOM_EMPLACEMENT']."</option>"; }?> </select> <br class="br"/> <label for="empl_nok" class="label">Emplacement nok test</label><br class="br"/> <input id="empl_nok" style="width:85%;" name="empl_nok" class="input" type="text" /> <br class="br"/> <button type="submit" class="bouton_1 couleur16" name="submit_deplacement" style="float: left;margin-top:20px;width:100%;padding: 5px 14px;">Déplacer</button> <br class="br"/> <button type='button' onclick="Retour_stock();" class="bouton_1 couleur16" style="float: left;margin-top:10px;width:100%;padding: 5px 14px;">Retour</button> </fieldset> </form> </div>
le code des deux fonctions qui affiche le tableau et le formulaire:
Je me demande si l'importation des librairies ne marchent pas car vu que je passe deux fois par du javascript pour afficher des éléments, ça doit bloquer. Si quelqu'un pouvais m'aider je l'en remercie d'avance
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 function Deplacement(id_stock) { // alert(id_stock); requete = CreerRequete(); if (requete) { requete.open("GET", "formulaire/stock/deplacement.php?id_stock="+id_stock, false); requete.send(null); document.getElementById('div_formulaire').innerHTML = requete.responseText; } } function tableau_stock(init,f_numero_lot,emplacement,designation_stock,reference_stock,statut) { requete = CreerRequete(); if (requete) { requete.open("GET", "tableau_stock.php?init="+init+"&f_numero_lot="+f_numero_lot+"&emplacement="+emplacement+"&designation_stock="+designation_stock+"&reference_stock="+reference_stock+"&statut="+statut, false); requete.send(null); document.getElementById('div_tableau').innerHTML = requete.responseText; } }.
Partager