salut.
J'ai un petit soucis sur ma mise à jour de ma liste déroulante, alors je demande à l'aide.lol.
Le popup que j'ouvre à plusieurs données de type champtext mais quand j'essaye de valider mon popup ca m'enregistre les valeurs dans la base de données mais ça n'actualise pas ma liste déroulante dans la page mere.
c'est mon code du popup
<html>
<head>
<link href="../CSS/style.css" type="text/css" rel="stylesheet">
<?php include('../connexion_requete/_connexion.php'); ?>
<script type="text/javascript">
function doc(nom)
{
if (document.layers)
{ // NS 4 et <
return document[nom];
}
if (document.all)
{ // IE
return document.all[nom];
}
if (document.getElementById)
{
return document.getElementById(nom);
}
}
function valid()
{
value = doc('value').value;
text = doc('text10').value;
opener.ajouter('nom10', value, text);
}
function valid()
{
value = doc('value').value;
text = doc('text11').value;
opener.ajouter('nom11', value, text);
}
</script>
<title>ERP Osinux</title>
<center>
</br>
<p> Gestion APE </p>
</center>
</head>
<body>
<?php
// requete pour chercher le prochain idenfiant
$requete10="SELECT MAX(APE) AS nb FROM ape WHERE APE IN (SELECT APE FROM ape) ;";
$result=mysql_query($requete10,$connexion);
$ligne=mysql_fetch_array($result);
$value = $ligne['nb'];
$value = $value + 1;
?>
<form action="" method="POST" onsubmit="valid();">
<p>
<?php
echo '<input type="hidden" name="value" id="value" value="'.$value.'" />';
?>
Code APE<input type="text" name="text10" id="text10" />
Secteur<input type="text" name="text11" id="text11" />
<br><br>
<tr><td> <input type="submit" value="Ajouter" onClick='window.close()'/></td></tr>
<?php
if((isset($_POST['text10'])) AND (isset($_POST['value'])))
{
// insertion dans la base de données
$text10=htmlentities(trim(ucfirst($_POST['text10'])));
$text11=htmlentities(trim(ucfirst($_POST['text11'])));
$add = sprintf("INSERT INTO ape (APE,Secteur) VALUES ('$text10','$text11')");
$result = mysql_query($add, $connexion) or die(mysql_error());
}
?>
</p>
</form>
</body>
</html>
c'est mon code de la page mere
<html>
<head>
<link href="../CSS/style.css" type="text/css" rel="stylesheet">
<title> ERP Osinux </title>
<p> Gestion Entreprise </p> </br> <!-- -->
<script>
function doc(nom) {
if (document.layers) { // NS 4 et <
return document[nom];
}
if (document.all) { // IE
return document.all[nom];
}
if (document.getElementById) {
return document.getElementById(nom);
}
}
function ajouter(nom0, value, text) {
formulaire = doc(nom0);
// Recuperation des informations
nb = formulaire.length;
// On compte le nombre d'<option />
nouvel_element = new Option(text, value, false, true);
// Creation
formulaire.options[nb] = nouvel_element;
// Ajout
}
function ajouter(nom10, value, text) {
formulaire = doc(nom10);
// Recuperation des informations
nb = formulaire.length;
// On compte le nombre d'<option />
nouvel_element = new Option(text, value, false, true);
// Creation
formulaire.options[nb] = nouvel_element;
// Ajout
}
function ajouter(nom20, value, text) {
formulaire = doc(nom20);
// Recuperation des informations
nb = formulaire.length;
// On compte le nombre d'<option />
nouvel_element = new Option(text, value, false, true);
// Creation
formulaire.options[nb] = nouvel_element;
// Ajout
}
function ajouter(nom21, value, text) {
formulaire = doc(nom21);
// Recuperation des informations
nb = formulaire.length;
// On compte le nombre d'<option />
nouvel_element = new Option(text, value, false, true);
// Creation
formulaire.options[nb] = nouvel_element;
// Ajout
}
function ajouter(nom3, value, text) {
formulaire = doc(nom3);
// Recuperation des informations
nb = formulaire.length;
// On compte le nombre d'<option />
nouvel_element = new Option(text, value, false, true);
// Creation
formulaire.options[nb] = nouvel_element;
// Ajout
}
</script>
</head>
<body>
<script language="JavaScript" src="../JavaScript/ejs_menu_data.js"></script>
<form action="../PHP/prospect.php" method="POST">
<table>
<tr>
<td width="5" height="10%" align="center"> <a href="../Lien/f_prospect.php"> Précédent </a> </td>
<td colspan="4" width="90%" height="10%"> </td>
<td width="5%" height="10%"> </td>
</tr>
<tr>
<td width="10%" height="10%" align="center" class="haut"><a href="../Lien/f_menu.php"> Menu principal </a> </td>
<td colspan="4" width="50%" height="20%">
<table name="type entreprise">
<tr>
<th> Type d'entreprise :</th>
<td> Prospect <INPUT type=radio name="TypEnt" value="1" checked="checked">Client <INPUT type=radio name="TypEnt" value="0"> </td>
<td> </td>
</tr>
</table>
<br><br>
<table name="premier groupe"> <!-- Commence par Statuts -->
<tr>
<td width="25%"> Statuts :</td>
<td width="25%">
<?php
//Connexion
include("../connexion_requete/_connexion.php");
$requete0 = mysql_query ("Select NumStatuts,NomStatuts from statuts;") ?> <!-- création de la reqête SQL pour la liste déroulante -->
<p><select name="nom0" id="nom0">
<?php
$requete0="select * from statuts order by NomStatuts;";
$result=mysql_query($requete0,$connexion);
$ligne=mysql_fetch_assoc($result);
if ($ligne)
{
while ($ligne)
{
echo '<option value = "'. $ligne["NomStatuts"].'">' . $ligne["NomStatuts"].'</option>';
$ligne=mysql_fetch_assoc($result);
}
}
?>
</select>
<a href="../Popup/popup_statuts.php" onclick="window.open(this.href, 'H','width=300, height=300'); return false;"><font size="3">Ajouter</a>
</td>
<td width="25%"> Code APE :</td>
<td>
<?php
include("../connexion_requete/_connexion.php");
// require_once('../connexion_requete/_connexion.php');
$requete10 = mysql_query ("Select APE,Secteur from ape;") ?> <!-- création de la reqête SQL pour la liste déroulante -->
<p><select name="nom10" id="nom10">
<?php
$requete10= ("select APE from ape where APE <> '00000' order by APE");
$result=mysql_query($requete10,$connexion);
$ligne=mysql_fetch_assoc($result);
if ($ligne)
{
while ($ligne)
{
echo '<option value = "'. $ligne["APE"].'">' . $ligne["APE"].'</option>';
$ligne=mysql_fetch_assoc($result);
}
}
?>
</select>
<a href="../Popup/popup_ape.php" onclick="window.open(this.href, 'H','width=300, height=300'); return false;"><font size="3">Ajouter</a>
</td>
</tr>
<tr>
<td width="25%"> Nom de l'entreprise :</td> <td> <input TYPE=text name="NomEnt" size="15"> </td>
<td width="25%"> Nombre d'employés :</td> <td> <input type="text" name="NbEmp" size="15"> </td>
</tr>
<tr>
<td width="25%"> Rue :</td>
<td> <input type="text" name="RueEnt" size="15"> </td>
</tr>
<tr>
<td width="25%"> Cedex :</td>
<td> <input type="text" name="CedexEnt" size="15"></td><td>Téléphone :</td>
<td> <input type="text" name="TelEnt" size="15"> </td>
</tr>
<tr>
<td width="25%"> BP :</td>
<td> <input type="text" name="BpEnt" size="15"> </td>
<td width="25%">Fax :</td>
<td> <input type="text" name="FaxEnt" size="15"> </td>
</tr>
<tr>
<td width="25%"> Nom de ville :
<input type="text" size="5" name="listecp" value="$CpVille" readonly onChange="changer();">
</td>
<td>
<?php
include("../connexion_requete/_connexion.php");
// require_once('../connexion_requete/_connexion.php');
$requete20 = mysql_query ("Select NumVille,NomVille,,CpVille from ville;") ?> <!-- création de la reqête SQL pour la liste déroulante -->
<p><select name="nom10" id="nom10">
<?php
$requete20= ("select NumVille,NomVille,CpVille from ville order by NomVille");
$result=mysql_query($requete20,$connexion);
$ligne=mysql_fetch_assoc($result);
if ($ligne)
{
while ($ligne)
{
echo '<option value = "'. $ligne["NomVille"].'">' . $ligne["NomVille"].'</option>';
$ligne=mysql_fetch_assoc($result);
}
}
?>
</select>
<a href="../Popup/popup_ville.php" onclick="window.open(this.href, 'H','width=300, height=300'); return false;"><font size="3">Ajouter</a>
</td>
</td>
</td>
<td>Site Internet :</td>
<td> <input type="text" name="Site" size="15"></td>
</tr>
</table>
<br><br>
<table name="deuxième groupe"> <!-- Commence par Nom du gérant -->
<tr>
<td width="25%"> Nom du gérant :</td>
<td> <input type="text" name="NomGeran" size="15"> </td>
<td width="25%"> Siège :</td>
<td> <input type="text" name="Siege" size="15"> </td>
</tr>
<tr>
<td width="25%"> Prénom :</td>
<td> <input type="text" name="PrenomGeran" size="15"></td>
<td> Téléphone :</td>
<td> <input type="text" name="TelSiege" size="15"> </td>
</tr>
<tr>
<td width="25%"> Téléphone :</td>
<td> <input type="text" name="TelGeran" size="15"> </td>
<td> Pays :</td>
<td> <input type="text" name="PaysSiege" size="15"> </td>
<tr><td width="25%">Email :</td> <td> <input type="text" name="EmailGeran" size="15"> </td> </tr>
</tr>
</table>
<br>
<table name="troisième groupe"> <!-- Commence par Nom resp info -->
<tr>
<td width="25%"> Nom Resp info :</td> <td><input type="text" name="NomRespInfo" size="15"> </td>
<td>Nom du contact :</td> <td> <input type="text" name="NomContact" size="15"> </td>
</tr>
<tr>
<td width="25%"> Prénom :</td> <td> <input type="text" name="PrenomRespInfo" size="15"> </td>
<td>Prénom :</td> <td> <input type="text" name="PrenomContact" size="15"> </td>
</tr>
<tr>
<td width="25%"> Téléphone :</td> <td> <input type="text" name="TelRespInfo" size="15"> </td>
<td>Téléphone :</td> <td> <input type="text" name="TelContact" size="15"> </td>
</tr>
<tr>
<td width="25%"> Email :</td> <td> <input type="text" name="EmailRespInfo" size="15"> </td>
<td>Email :</td> <td> <input type="text" name="EmailContact" size="15"> </td>
</tr>
</table>
<br><br>
<table name="quatrième groupe"> <!-- Commence par Nombre d'ordinateurs -->
<tr>
<td width="30%"> Nombre d'ordinateurs :</td>
<td> <input type="text" name="NbOrdi" size="15"> </td>
</tr>
<tr>
<td colspan="2"> <font size="1"> Serveurs non compris dans les ordinateurs </td>
</tr>
<tr>
<td width="30%"> Nombre de serveurs :</td>
<td> <input type="text" name="NbServ" size="15"> </td>
</tr>
</table>
<br><br>
<table width="20" align="center" name="cinquième groupe"> <!-- Commence par les Serveurs -->
<tr>
<th valign="center" height="40" width="30%" align="center" colspan="4"> Serveur:</th>
</tr>
<tr>
<td width="45%" align="right"> Windows NT Server :</td>
<td> <INPUT type="checkbox" name="WinNTServ" value="checkbox"> </td>
<td width="20%" align="right"> Linux Server :</td>
<td> <INPUT type="checkbox" name="Linuxserv" value="checked"> </td>
</tr>
<tr>
<td width="45%" align="right"> Windows 2000 Server :</td>
<td> <INPUT type="checkbox" name="WinNTServ" value="checked"> </td>
<td width="20%" align="right"> OS400 Server :</td>
<td> <INPUT type="checkbox" name="Os400Serv" value="checked"> </td>
</tr>
<tr>
<td width="45%" align="right"> Windows 2003 Server :</td>
<td width="5%"> <INPUT type="checkbox" name="Win2003Serv" value="checked"> </td>
<td width="20%" align="right"> Novel Server :</td>
<td> <INPUT type="checkbox" name="NovelServ" value="checked"> </td>
</tr>
<tr>
<td width="45%" align="right"> Windows Loghorn :</td>
<td> <INPUT type="checkbox" name="WinLoghorn" value="checked"> </td>
<td width="20%" align="right"> Autres Serveurs :</td>
<td> <INPUT type="checkbox" name="AutresServ" value="checked"> </td>
</tr>
</table>
<br><br>
<table name="sixième groupe"> <!-- Commence par OS Microsoft + OS Linux -->
<tr>
<th valign="center" height="40" width="30%" align="center" colspan="4"> OS :</th>
</tr>
<tr>
<td width="45%" align="right"> Windows inférieur à 95 :</td>
<td width="5%"> <INPUT type="checkbox" name="WinMoin95" value="checked"> </td>
<td width="20%" align="right"> Linux Mandrake :</td>
<td> <INPUT type="checkbox" name="LinuxMand" value="checked"> </td>
</tr>
<tr>
<td width="45%" align="right"> Windows 95 :</td>
<td width="5%"> <INPUT type="checkbox" name="Win95" value="checked"> </td>
<td width="20%" align="right"> Linux Debian :</td>
<td> <INPUT type="checkbox" name="LinuxDebian" value="checked"> </td>
</tr>
<tr>
<td width="45%" align="right"> Windows 98 :</td>
<td width="5%"> <INPUT type="checkbox" name="Win98" value="checked"> </td>
<td width="20%" align="right"> Linux RedHate :</td>
<td> <INPUT type="checkbox" name="LinuxRedH" value="checked"> </td>
</tr>
<tr>
<td width="45%" align="right"> Windows Millenium :</td>
<td width="5%"> <INPUT type="checkbox" name="WinMe" value="checked"> </td>
<td width="20%" align="right"> Linux Suse :</td>
<td> <INPUT type="checkbox" name="LinuxSuse" value="checked"> </td>
</tr>
<tr>
<td width="45%" align="right"> Windows NT :</td>
<td width="5%"> <INPUT type="checkbox" name="WinNT" value="checked"> </td>
<td width="20%" align="right"> Linux Fedora :</td>
<td> <INPUT type="checkbox" name="LinuxFedora" value="checked"> </td>
</tr>
<tr>
<td width="45%" align="right"> Windows 2000 :</td>
<td width="5%"> <INPUT type="checkbox" name="Win2K" value="checked"> </td>
<td width="20%" align="right"> Linux Autres :</td>
<td> <INPUT type="checkbox" name="LinuxAutres" value="checked"> </td>
</tr>
<tr>
<td width="45%" align="right"> Windows XP :</td>
<td width="5%"> <INPUT type="checkbox" name="WinXP" value="checked"> </td>
<td width="20%" align="right"> Mac :</td>
<td> <INPUT type="checkbox" name="Mac" value="checked"> </td>
</tr>
<tr>
<td width="45%" align="right"> Windows Vista :</td>
<td width="5%"> <INPUT type="checkbox" name="WinVista" value="checked"> </td>
<td width="20%" align="right"> Autres :</td>
<td> <INPUT type="checkbox" name="Autres" value="checked"> </td>
</tr>
</table>
<br><br>
<table name="huitième groupe"> <!-- Commence par Office -->
<tr>
<th valign="center" height="40" width="30%" align="center" colspan="4"> Office:</th>
</tr>
<tr>
<td width="45%" align="right"> Microsoft Office :</td>
<td width="5%"> <INPUT type="checkbox" name="MSOffice" value="checked"> </td>
<td width="20%" align="right"> Open Office :</td>
<td> <INPUT type="checkbox" name="OpenOff" value="checked"> </td>
</tr>
</table>
<br><br>
<table name="neuvième groupe"> <!-- Commence par Budget -->
<tr>
<th width="30%" align="center" height="40" colspan="47"> Budget:</th>
</tr>
<tr> <td width="30%" align="right"> Logiciel annuel :</td>
<td width="5%"> <input type="text" name="BudgetLogA" size="15"> </td>
<td width="25%" align="right"> Matériel annuel :</td>
<td> <input type="text" name="BudgetMatA" size="15"> </td>
</tr>
</table>
<br><br>
<table name="dixième groupe"> <!-- Commence par Concurrent -->
<tr>
<th align="center" height="40" colspan="5"> Concurrent:</th>
<tr>
</tr>
<td width="30%" align="right"> Concurrent :</td>
<td width="20%" align="right">
<?php
include("../connexion_requete/_connexion.php");
require_once('../connexion_requete/_connexion.php');
$requete3 = mysql_query ("Select NumConc,NomConc from concurrent;") ?> <!-- création de la reqête SQL pour la liste déroulante -->
<p><select size ="1" name="nom3" id="nom3">
<?php
$requete3= ("select NumConc from concurrent order by NomConc");
$result=mysql_query($requete3,$connexion);
$ligne=mysql_fetch_assoc($result);
if ($ligne)
{
while ($ligne)
{
echo '<option value = "'. $ligne["NomConc"].'">' . $ligne["NomConc"].'</option>';
$ligne=mysql_fetch_assoc($result);
}
}
?>
</select>
<a href="../Popup/popup_concurrent.php" onclick="window.open(this.href, 'H','width=300, height=300'); return false;"><font size="3">Ajouter</a>
</td>
<td width="20%" align="right"> Tarif Concurrent :</td>
<td> <input TYPE=text name="Tarif" size="15"></td>
</tr>
</table>
<br>
<table>
<tr>
<td width="35%" align="right">Type de forfait :</td>
<td>
<table name="type_forfait">
<tr>
<td width="30%" align=right>Aucun <INPUT type=radio name="TypForfait" value="0" checked="checked"> </td>
<td width="30%" align=right>Annuel <INPUT type=radio name="TypForfait" value="4"></td>
</tr>
<tr>
<td width="30%" align=right>Horaire <INPUT type=radio name="TypForfait" value="2"></td>
<td width="30%" align=right>Semestriel <INPUT type=radio name="TypForfait" value="3"></td>
</tr>
<tr>
<td width="30%" align=right>Mensuel <INPUT type=radio name="TypForfait" value="1"></td>
<td width="30%" align=right>Trimestriel <INPUT type=radio name="TypForfait" value="5" ><td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table>
<tr>
<th width="30%" height="40" align="center" colspan="4" valign="center">Commentaire:</th>
</tr>
<tr>
<td width="30%"> Date Rappel :</td>
<td width="30%"> Heure Rappel :</td>
<td width="*"> Commentaires :</td>
</tr>
<tr>
<td class="haut" width="*"> <input type="text" name="DateRap" size="15"> <br> AAAA-MM-JJ</td>
<td class="haut" width="30%"> <input type="text" name="HeureRap" size="15"> <br> HH:MM </td>
<td class="haut" width="50%"> <textarea cols=45 rows=5 name="Com"> </textarea> </td>
</tr>
</table>
</tr>
<tr>
<td width="10%" height="10%"><input type="HIDDEN" name="champstext" value="valeur"> </td>
<td align="center" rowspan="4" width="70%" height="20%"></td>
<td width="10%" height="20%"> </td>
<td width="20%" height="20%"> </td>
<td width="10%" height="10%"><input type="submit" name="envoyeraj" value="Valider"> </td>
</tr>
<tr>
<td width="10%" height="10%"> </td>
<td colspan="4" width="80%" height="10%"> </td>
<td width="10%" height="10%"> </td>
</tr>
</table>
</form>
</body>
</html>
Je vous remercie d'avance.