Pop qui ne se ferme pas

men75 Messages postés 3 Date d'inscription jeudi 27 octobre 2005 Statut Membre Dernière intervention 21 avril 2006 - 27 oct. 2005 à 17:11
cs_yes Messages postés 33 Date d'inscription vendredi 28 février 2003 Statut Membre Dernière intervention 26 février 2008 - 28 oct. 2005 à 08:05
Bonjour,
voila je reprends derriere quelqu'un et je ne comprends pas, je fais appel a une liste et
mon pop up ne se ferme pas voici mon code

$req_agent
"SELECT * FROM AGENT WHERE NUMEN'$numen'" ;
$result
= mysql_query
($req_agent
, $db
);

if
($result
&& mysql_num_rows
($result
)>0) {

$array
= mysql_fetch_array
($result
);
$titre
= $ array
[ "Titre" ];
if
($titre "Monsieur" ) $rangForm
3 ;
if
($titre
= =
"Madame" ) $rangForm
=
4 ;
if
($titre
= =
"Mademoiselle" ) $rangForm
=
5 ;
$nom
= $ array
[ "Nom" ];
$prenom
=$array
["Prenom"];
$nomu
= $ array
[ "Epouse" ];
$daten1
=$array
["DateNaissance"];
$daten
= substr
($daten1
,8,2). "/" .substr
($daten1
,5,3).substr
($daten1
,0,4);
$adp1
=$array
["AdPerso1"];
$adp2
= $ array
[ "AdPerso2" ];
$cp1
=$array
["CodePostal1"];
$ville1
= $ array
[ "Ville1" ];
$tp
=$array
["TelPersoP"];
$tf
= $ array
[ "TelPersoF" ];
// tel perso et tel F !!
$mail
=$array
["MailPerso"];
$cate
= $ array
[ "Categorie" ];
$position
=$array
["Position"];
$idcorps
= $ array
[ "IdCorps" ];
$idgrade
=$array
["IdGrade"];

/*$service= $array["Service"];*/
$dateda
=$ array
[ "DateDerniereAffectation" ];
$adp1et
=$array
["AdPersoEt1"];
$adp2et
= $ array
[ "AdPersoEt2" ];
$villeet
=$array
["VilleEt"];
$pays
= $ array
[ "Pays" ];
$telpet
=$array
["TelPersoEt"];
$telpetp
= $ array
[ "TelPersoEtP" ];
$telprof
=$array
["TelProf"];
$mailprof
= $ array
[ "MailProf" ];

/*$libetab =$array["NumEtab"];
$minor= $array["MinistereOrigine"]; */
$organisme
=$ array
[ "Organisme" ];
$minde
=$array
["MinistereDetachemnet"];
$datere
= $ array
[ "DateReintegration" ];
$empant
=$array
["EmploiAnterieur"];
$hdebm
= $ array
[ "HeureDebMatinTravail" ];
$hfinm
=$array
["HeureFinMatinTravail"];
$hdeba
= $ array
[ "HeureDebApMidiTravail" ];
$hfina
=$array
["HeureFinApMidiTravail"];
$numetab
= $ array
[ "NumEtab" ];

// - grade et corps - //

$req_corps
="SELECT LibelleCorps FROM CORPS WHERE IdCorps= $idcorps";
$req_grade
"SELECT LibelleGrade FROM GRADE WHERE IdGrade$idgrade" ;
$resul_c
= mysql_query
($req_corps
,$db
);
$resul_g
= mysql_query
($req_grade
,$db
);
$row_c
= mysql_fetch_row
($resul_c
);
$row_g
=mysql_fetch_row
($resul_g
);
$libcorps
= $row_c
[0];
$libgrade
=$row_g
[0];

// - etablissement - //

if
($libetab
! ="")
{
$libetab
= addslashes
($libetab
) ;
$req_infoetab
= "SELECT * FROM ETABLISSEMENT WHERE LibelleEtablissement= '$libetab'" ;
$result_etab
= mysql_query
($req_infoetab
, $db
);
$row2
= mysql_fetch_array
($result_etab
);
$libetab
= $row2
[ "LibelleEtablissement" ];
$ad1etab
=$row2
["Ad1"];
$ad2etab
= $row2
[ "Ad2" ];
$cpetab
=$row2
["CodePostal"];
$villeetab
= $row2
[ "Ville" ];
$teleetab
=$row2
["TelProf"];
$mailetab
= $row2
[ "Mel" ];
}

?>

<html>

<head>

<title>Chargement
</title>

</head>



<center>Veuillez patienter ...
</center>

<SCRIPT
LANGUAGE =
"JAVASCRIPT">
window.opener.F1.elements[
<?php print $rangForm ;
?>].checked= true ;
window.opener.MiseAJour('nom',"
<? print $nom;
?>");
window.opener.MiseAJour('prenom',"
<? print $prenom;
?>");
window.opener.MiseAJour('epouse',"
<? print $nomu;
?>");
window.opener.MiseAJour('datenaissance',"
<? print $daten ;
?>");
window.opener.MiseAJour('adperso1',"
<? print $adp1;
?>");
window.opener.MiseAJour('adperso2',"
<? print $adp2;
?>");
window.opener.MiseAJour('codepostal1',"
<? print $cp1;
?>");
window.opener.MiseAJour('ville1',"
<? print $ville1;
?>");
window.opener.MiseAJour('telperso',"
<? print $tf;
?>",NameForm);
window.opener.MiseAJour('telpersop',"
<? print $tp;
?>",NameForm);
window.opener.MiseAJour('mailperso',"
<? print $mail;
?>");
window.opener.MiseAJour('adpersoet1',"
<? print $adp1et;
?>");
window.opener.MiseAJour('adpersoet2',"
<? print $adp2et;
?>");
window.opener.MiseAJour('villeet',"
<? print $villeet;
?>");
window.opener.MiseAJour('pays',"
<? print $pays;
?>");
window.opener.MiseAJour('telpersoet',"
<? print $telpet;
?>");
window.opener.MiseAJour('telpersoetp',"
<? print $telpetp;
?>");

// - categorie -
for(var i =0; i
<
window.
opener.
F1.
categorie.
length &&
window.
opener.
F1.
categorie[
i].
value !=
"<? print $cate;?>";
i ++);

window.
opener.
F1.
categorie[
i].
selected =
true;

// -
postion -

for(
var
i=
0;
i
<
window.
opener.
F1.
situationadmin.
length &&
window.
opener.
F1.
situationadmin[
i].
value ! =
"<? print $position;?>";
i++);

window.
opener.
F1.
situationadmin[
i].
selected =
true ;

// -
affichage
du
corps
et
du
grade - //

window.
opener.
MiseAJour('
grade',
"<? print $libcorps;?>");

window.
opener.
MiseAJour('
corps',
"<? print $libgrade;?>");

// -
affichage
des
infos
sur
l'
etablissement - //

window.
opener.
MiseAJour('
etablissement',
"<? print $libetab;?>");

window.
opener.
MiseAJour('
ad1etab',
"<? print $ad1etab;?>");

window.
opener.
MiseAJour('
ad2etab',
"<? print $ad2etab;?>");

window.
opener.
MiseAJour('
cpetab',
"<? print $cpetab ;?>");

window.
opener.
MiseAJour('
villeetab',
"<? print $villeeatb ;?>");

window.
opener.
MiseAJour('
mailetab',
"<? print $mailetab ;?>");

this.
close();

</SCRIPT>



</html>

<? }else {

?>

<html>

<head>

<title>Chargement
</title>

</head>



<SCRIPT
LANGUAGE =
"JAVASCRIPT">
window.opener.alerte() ;
this.close();

</SCRIPT>



</html>

<?
}

?>

merci pour vos réponses

1 réponse

cs_yes Messages postés 33 Date d'inscription vendredi 28 février 2003 Statut Membre Dernière intervention 26 février 2008
28 oct. 2005 à 08:05
D'apres ton code ta fenetre ne se ferme que dans un certain cas :

if ($result && mysql_num_rows($result)>0)
{
...
}else {

?>

...
<SCRIPT
LANGUAGE=
"JAVASCRIPT">
window.opener.alerte() ;
this.close();

</SCRIPT>

...
<? }
?>
0
Rejoignez-nous