Forum » » Le coin des codeurs » » Variable globale !!!!
Posté : 13 janv. 2011 à 09:19
<html>
<head>
<link type="text/css" rel="stylesheet" href="./themes/lightbox_effect.css">
<script>
function OuvrePopup()
{
document.getElementById('Page').style.display='block';
document.getElementById('Lettre').style.display='block';
}
function FermePopup()
{
document.getElementById('Page').style.display='none';
document.getElementById('Lettre').style.display='none';
}
</script>
</head>
</html>
<body>
<!-- AFFICHAGE D'UNE LIGHTBOX -->
<div id='Page'></div>
<div id='Lettre'>
<p align='center'>
<br><br>
<div align='center'>
<h1>Template des fiches individuelles en construction </h1>
<? php
// c'est ici que j'ai besoin de récupérer $reprod_id pour faire de nouvelles requêtes et les afficher
?>
<p align='center'><img src='images/consgrl2.jpg' width='300' border='0'></p>
<p align='center'>
<font face='Arial Black' size='4' color='red'>
Merci de revenir prochainement
</font>
</p>
</div>
<p> </p>
<p align='center'><b>
<input type='button' value='Fermer' !onclick!='FermePopup()' style='cursor:pointer'>
</b></p>
</div>
<!-- FIN D'AFFICHAGE DE LIGHTBOX -->
</body>
</html>
<?php
$strSQL = 'SELECT `Titre`, `Id_parent` FROM `elev_menu` WHERE `Id_page` = '.$_ENV['id_page'];
$resultat = requete_SQL($strSQL);
$tabl_result = mysql_fetch_array($resultat);
if ($tabl_result['Titre'] == 'Nos femelles'){
$race = "";
} else {
$race = $tabl_result['Titre'];
}
$content = "<h1>Test pour gestion multiraces - femelles ".$race." </h1>
<TABLE WIDTH=100% ALIGN='CENTER'><TR><TD align='center'>\n";
if ($race == '') {
$content .= "Vous trouverez ici la liste des reproducteurs présents à l'élevage<br /><br />Choisissez la race";
} else {
$result = mysql_query("SELECT * FROM elev_reproducteurs WHERE reprod_race='$race' AND reprod_sexe='F' AND reprod_present='O' ORDER BY reprod_nom") or die(mysql_error());
if (mysql_num_rows($result) > 0)
{
$content .= "<table id = 'tableau' width = '100%' border rules = 'rows' align = 'center'><tr height = '40'><th align = 'center'>Photos</th><th align = 'center' width = '22%'>Nom & Affixe</th><th align='center' width='8%'>Née le</th><th align='center' width='20%'>Père</th><th align='center' width='20%'>Mère</th><th align='center' width='25%'>Producteur</th></tr>";
while (list($reprod_id, $reprod_nom, $reprod_affixe, $reprod_affixeplace, $reprod_race, $reprod_variete, $reprod_poil, $reprod_couleur, $reprod_taille, $reprod_poids, $reprod_sexe,$reprod_naissance, $reprod_deces, $reprod_identification, $reprod_present, $reprod_pere_id, $reprod_mere_id, $reprod_producteur_id, $reprod_photos) = mysql_fetch_row($result))
{
$content .= "<tr><td align = 'center' height = '80'>";
if ($reprod_photos) {
$content .= "
<div class=\"thumb\">
<a href=\"#\">
<img src=\"./photos/".$reprod_photos."\" width=\"80\" border=\"0\" style=\"cursor:pointer\" />
</a>
</div>
";
}
$content .= "</td>";
$content .= "<td align = 'center' height = '80'>";
// Nom et affixe
if ($reprod_affixeplace == 'B') {
$content .= "<a href='#' !onclick!='OuvrePopup()'>".$reprod_affixe." ".$reprod_nom."</a>";
} else {
$content .= "<a href='#' !onclick!='OuvrePopup()'>".$reprod_nom." ".$reprod_affixe."</a>";
}
$content .= "</td>";
Message édité par : PhilGuen / 13-01-2011 09:34
Cet article provient de NPDS
https://www.npds.org/viewtopic.php?topic=25002&forum=5