j'ai honte, je devrait plus poster cet aprem à dans trois semaine (je vais faire une cure de repos)
Et avec 50 cures de vitamines A, B, C, D et F s'il te plaît !bpn ben j'ai plus qu'a aller me coucher ...![]()
j'ai honte, je devrait plus poster cet aprem à dans trois semaine (je vais faire une cure de repos)
. "<td><a href='_admin.php?mode=". MAJ
. "&id=$idURL'><img hspace='2' width='16' height='16'src='./images/b_edit.png' alt='Modifier' title='Modifier' border='0'></a>\n"
Dans ton code, tu as transformé cette ligne en Code : Tout sélectionner
<td><a href="_admin.php?mode=MAJ&id=<?php echo $idURL;?>"><img hspace="2" width="16" height="16" src="./images/b_edit.png" alt="Modifier" title='Modifier" border="0"></a></td> Code : Tout sélectionner
<td><a href="_admin.php?mode=<?php echo MAJ?>&id=<?php echo $idURL;?>"><img hspace="2" width="16" height="16" src="./images/b_edit.png" alt="Modifier" title='Modifier" border="0"></a></td>
<?php echo MAJ?> ? Ce n'est pas une variable puisqu'il n'y a pas de $ devant...<td><a href="_admin.php?mode=<?php echo MAJ?>&id=<?php echo $idURL;?>"><img hspace="2" width="16" height="16" src="./images/b_edit.png" alt="Modifier" title='Modifier" border="0"></a></td>
reviendrait exactement à ce que j'ai mis à savoir :
<td><a href="_admin.php?mode=MAJ&id=<?php echo $idURL;?>"><img hspace="2" width="16" height="16" src="./images/b_edit.png" alt="Modifier" title='Modifier" border="0"></a></td>define ("DEFAUT","defaut");
define ("ARC","archive");
define ("INSERT","insertion");
define ("MAJ","maj");
define ("DEL","delete");
define ("LISTCOM","list_com");
define ("LISTARC","list_arc");
Donc je récupère bien ma variable.function Tableau ($connexion)
{
$requete = "SELECT id, dcrea, texte, DATE_FORMAT(dcrea, '%d/%m/%y %H:%i') AS 'dcreation',DATE_FORMAT(MAJ, '%d/%m/%y %H:%i') AS 'dmaj' "
. " FROM filinfo"
. " LEFT JOIN refinfo ON filinfo.id = refinfo.idinf"
. " ORDER BY dcrea DESC";
$resultat = ExecRequete ($requete, $connexion);
$num=mysql_num_rows ($resultat);
if ($num < 1)
{
echo "Aucun <span class='i'>i-</span>communiqué publié<br>\n";
}
else
{
echo "<h1>" .$num. ($num ==1 ? ' <span class="i">i-</span>communiqué publié' : ' <span class="i">i-</span>communiqués publiés') ."</h1>";
// . "<center><table border=0 cellspacing=2 cellpadding=2>"
// . "<caption align=bottom>Gestion des <span class='i'>i-</span>communiqués</caption>"
// . "<tr class='titre'><th>Info<th>Création<th>Modif.<th>ref<th colspan='3'>Action</tr>\n";
$i=0;
while ($info = ObjetSuivant($resultat))
{
$i++;
$idURL=urlEncode ($info->id);
?>
<tr class="A<?php echo ($i%2);?>" onMouseOver="this.className='over'" onMouseOut="this.className='A<?php echo ($i%2);?>'">
<td width=450><?php echo $info->texte;?></td>
<td><?php echo $info->dcreation;?></td>
<td><?php echo $info->dmaj;?></td>
<td><input type="checkbox" name="ref[]" value="rae"<?php if($toto=="1") {echo " checked='checked'" ;}?>"/>
<td><a href="_admin.php?mode=<?php echo MAJ?>&id=<?php echo $idURL;?>"><img hspace="2" width="16" height="16" src="./images/b_edit.png" alt="Modifier" title='Modifier" border="0"></a></td>
<td><a href='_admin.php?mode=<?php echo ARC?>&id=<?php echo $idURL;?>"><img hspace="2" width="16" height="16" src="./images/b_tblexport.png" alt="Archiver" title="Archiver" border='0'></a></td>
<td><a href='_admin.php?mode=<?php echo DEL?>&id=<?php echo $idURL;?>"><img hspace="2" width="16" height="16" src="./images/b_drop.png" alt="Supprimer" title="Supprimer" border='0'></a></td>
<?
}
echo "</table></center>\n";
}
}
J'ai encore du boulot ...
C'est pitetre une constante ? s'il a un define("MAJ", 8732) parce que dans son appli les mises à jour sont qualifiées du code 8732, faut qu'il fasse comme il à ditA quoi correspond ton? Ce n'est pas une variable puisqu'il n'y a pas de $ devant...<?php echo MAJ?>
<?php
function Tableau ($connexion)
{
$requete = "SELECT id, dcrea, texte, DATE_FORMAT(dcrea, '%d/%m/%y %H:%i') AS 'dcreation',DATE_FORMAT(MAJ, '%d/%m/%y %H:%i') AS 'dmaj' "
. " FROM filinfo"
. " LEFT JOIN refinfo ON filinfo.id = refinfo.idinf"
. " ORDER BY dcrea DESC";
$resultat = ExecRequete ($requete, $connexion);
$num=mysql_num_rows ($resultat);
if ($num < 1)
{
echo "Aucun <span class='i'>i-</span>communiqué publié<br>\n";
}
else
{
echo "<h1>" .$num. ($num ==1 ? ' <span class="i">i-</span>communiqué publié' : ' <span class="i">i-</span>communiqués publiés') ."</h1>"
. "<center><table border=0 cellspacing=2 cellpadding=2>"
. "<caption align=bottom>Gestion des <span class='i'>i-</span>communiqués</caption>"
. "<tr class='titre'><th>Info<th>Création<th>Modif.<th>ref<th colspan='3'>Action</tr>\n";
$i=0;
while ($info = ObjetSuivant($resultat))
{
$i++;
$idURL=urlEncode ($info->id);
?>
<tr class="A<?php echo ($i%2);?>" onMouseOver="this.className='over'" onMouseOut="this.className='A<?php echo ($i%2);?>'">
<td width=450><?php echo $info->texte;?></td>
<td><?php echo $info->dcreation;?></td>
<td><?php echo $info->dmaj;?></td>
<td><input type="checkbox" name="ref[]" value="rae"<?php if($toto=="1") {echo " checked='checked'" ;}?>"/>
<td><a href="_admin.php?mode=maj&id=<?php echo $idURL;?>"><img hspace="2" width="16" height="16" src="./images/b_edit.png" alt="Modifier" title="Modifier" border="0"></a></td>
<td><a href="_admin.php?mode=archive&id=<?php echo $idURL;?>"><img hspace="2" width="16" height="16" src="./images/b_tblexport.png" alt="Archiver" title="Archiver" border='0'></a></td>
<td><a href="_admin.php?mode=delete&id=<?php echo $idURL;?>"><img hspace="2" width="16" height="16" src="./images/b_drop.png" alt="Supprimer" title="Supprimer" border='0'></a></td>
</tr>
<?
}
echo "</table></center>\n";
}
}
?>
Reste à supprimer le $toto et à récupérer les "vraies" variables.